- Using the official OpenTelemetry SDK
- Minimal auto-instrumentation for requests, console commands, consumers and doctrine
- Trace context propagation from incoming requests to consumers, outgoing http calls and databases (using
sqlcommenter
) - Configurable blacklisting of requests by path to avoid useless traces, eg.
/metrics
or/_healthz
- Automatic log inclusion with configurable log level and channels
- Using the Prometheus Client
- Minimal auto-instrumentation for common request, consumer and message metrics (see list of provided default metrics).
- Autoconfigurable metric providers, see below.
- Adds trace context to logs for correlation, with customizable keys.
- Using the official OpenTelemetry SDK
- Baggage propagation from incoming requests to consumers and outgoing http calls
- A simple endpoint to expose application health (default:
/_healthz
) - Autoconfigurable healthcheck interface to add healthchecks to be made for global application health
composer require worldia/instrumentation-bundle <your-exporter>
You will aso need to install an exporter implementation and APCu
is required by the prometheus exporter.
Add to ```bundles.php```:
```php
return [
// Other bundles
Instrumentation\InstrumentationBundle::class => ['all' => true],
];
Minimal configuration
See the complete configuration reference here or run bin/console config:dump-reference instrumentation
.
// docker-compose.yaml
services:
php:
image: php:8.1
environment:
- OTEL_PHP_TRACES_PROCESSOR=batch
- OTEL_TRACES_SAMPLER=parentbased_always_on
- OTEL_TRACES_EXPORTER=otlp
- OTEL_EXPORTER_OTLP_PROTOCOL=grpc
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
jaeger:
image: jaegertracing/all-in-one:latest
environment:
COLLECTOR_OTLP_ENABLED: "true"
// instrumentation.yaml
instrumentation: ~
- Tracing
- Simple tracing example
- Simple tracing example using the static API
- Add Urls to your traces in error messages
- Use upstream request id as trace id
- Customize operation (span) name for a message
- Link strategy for a message
- Propagating trace/baggage context in HTTP requests
- Add request / response bodies as span attributes for HTTP requests
- Metrics
- Adding a metric
- Using Redis as storage adapter (Recommended)
- Logging
- Health