v2.0 restructures the bundle’s configuration to a nested, signal-grouped shape (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tracewayapp/opentelemetry-symfony-bundle/llms.txt
Use this file to discover all available pages before exploring further.
traces: / metrics: / logs:) that aligns with the OpenTelemetry specification and the OTEL_* environment variable convention. Your existing v1.x flat config keeps working in v2.0 — every flat key emits a Symfony deprecation pointing at its new nested location. Flat keys are scheduled for removal in v3.0, giving you a full release cycle to migrate without any forced downtime.
What changed
Config restructured
All flat top-level keys migrate under
traces:, metrics: (unchanged), or logs:. The shape now mirrors the OTel signal hierarchy and the existing metrics: node that has been nested since v1.7.0.Unprefixed attributes default
log_export_unprefixed_attributes defaulted to false in v1.x. v2.0 flips it to true, emitting Monolog context and extra fields as flat OTel attributes — matching Java, Python, .NET, and JS ecosystems.Dependency floors raised
OpenTelemetry PHP package minimums are raised to match the tested baseline. Anyone on a modern Symfony project will already satisfy these floors from a normal
composer update.Dependency floors
| Package | v1.x floor | v2.0 floor |
|---|---|---|
open-telemetry/api | ^1.0 | ^1.9 |
open-telemetry/context | ^1.0 | ^1.5 |
open-telemetry/sdk | ^1.0 | ^1.14 |
open-telemetry/sem-conv | ^1.0 | ^1.38 |
symfony/phpunit-bridge (dev) | ^6.4 || ^7.0 || ^8.0 | ^7.2 || ^8.0 |
composer.json below these new floors, update them first:
Migration steps
Upgrade to v2.0
Update the bundle via Composer. Your existing v1.x flat config will continue to work without any changes.
Surface deprecations
Clear the cache and watch the Symfony deprecation log. Every flat key emits exactly one deprecation pointing at its new nested location.In development, deprecations appear in the Symfony profiler’s “Logs” panel under the
php channel. In CI, run with SYMFONY_DEPRECATIONS_HELPER=weak to surface them without failing.Migrate keys to nested shape
Move keys one signal group at a time. Start with
traces: — it has the most keys. Then move logs:. The metrics: node is unchanged and requires no migration.Use the flat → nested mapping table below as a reference. You can migrate incrementally: mix flat and nested keys across separate config files (e.g. config/packages/open_telemetry.yaml for nested and config/packages/dev/open_telemetry.yaml still flat), but avoid mixing them in the same block.Decide on unprefixed_attributes
The new default for
logs.export.unprefixed_attributes is true. Decide which behavior you want:- Accept the new default (
true) — Monologcontextandextrafields are emitted as flat OTel attributes. This matches the cross-ecosystem norm (Java logback, PythonLoggingHandler, .NET, JS Winston) and is the recommended path. - Preserve v1.x behavior (
false) — setunprefixed_attributes: falseexplicitly to keep themonolog.context.*/monolog.extra.*prefixed shape your existing dashboards may depend on.
Flat → nested mapping
Every v1.x flat key and its v2.0 nested equivalent:| Legacy key (v1.x) | New nested location (v2.0) |
|---|---|
traces_enabled | traces.enabled |
tracer_name | traces.tracer_name |
excluded_paths | traces.excluded_paths |
record_client_ip | traces.record_client_ip |
error_status_threshold | traces.error_status_threshold |
console_enabled | traces.console.enabled |
console_excluded_commands | traces.console.excluded_commands |
http_client_enabled | traces.http_client.enabled |
http_client_excluded_hosts | traces.http_client.excluded_hosts |
messenger_enabled | traces.messenger.enabled |
messenger_root_spans | traces.messenger.root_spans |
doctrine_enabled | traces.doctrine.enabled |
doctrine_record_statements | traces.doctrine.record_statements |
cache_enabled | traces.cache.enabled |
cache_excluded_pools | traces.cache.excluded_pools |
twig_enabled | traces.twig.enabled |
twig_excluded_templates | traces.twig.excluded_templates |
scheduler_enabled | traces.scheduler.enabled |
mailer_enabled | traces.mailer.enabled |
mailer_record_subject | traces.mailer.record_subject |
monolog_enabled | logs.correlation.enabled |
log_export_enabled | logs.export.enabled |
log_export_level | logs.export.level |
log_export_capture_code_attributes | logs.export.capture_code_attributes |
log_export_unprefixed_attributes | logs.export.unprefixed_attributes (default flipped to true) |
metrics: is unchanged — it was already nested and requires no migration.
Before / after
Default change: logs.export.unprefixed_attributes
This is the only behavioral change in v2.0 that can silently affect running applications.
v1.x behavior (default: false)
v1.x behavior (default: false)
Monolog Dashboard queries and alert rules filtering on
context and extra fields were emitted as namespaced OTel attributes:monolog.context.* relied on this shape.v2.0 behavior (default: true)
v2.0 behavior (default: true)
The same fields are emitted as flat OTel attributes:This matches Java logback, Python
LoggingHandler, .NET OpenTelemetryLogger, and JS Winston — all of which emit user log fields flat without a namespace prefix.Conflict detection
Setting both a legacy flat key and its nested equivalent in the same configuration block causes the bundle to throwInvalidConfigurationException at container compile time:
Conflict detection only fires when both forms appear in the same file or configuration block. Across separate files (for example,
config/packages/open_telemetry.yaml and config/packages/dev/open_telemetry.yaml), Symfony merges the blocks independently before the bundle sees them. In that case, standard Symfony merge semantics apply (typically the later file wins). Avoid splitting flat and nested forms for the same key across files.Timeline
| Version | Status |
|---|---|
| v2.0 | Flat keys still accepted; each emits a Symfony deprecation pointing at the nested equivalent |
| v3.0 | Flat keys removed entirely — migrate before then |
