feat(otel): capture OTEL_CONFIG_WHITELIST vars with SDK-sourced type/default#4005
Open
bm1549 wants to merge 1 commit into
Open
feat(otel): capture OTEL_CONFIG_WHITELIST vars with SDK-sourced type/default#4005bm1549 wants to merge 1 commit into
bm1549 wants to merge 1 commit into
Conversation
|
4cb73bd to
47bcb10
Compare
…/default The supported-configurations.json generator only scraped OTEL env vars that the C extension reads via ZAI_STRL(), so SDK-owned configs such as OTEL_EXPORTER_OTLP_HEADERS were never published. Scrape the OTEL_CONFIG_WHITELIST array in src/DDTrace/OpenTelemetry/Configuration.php as an additional source (scoped to the array literal so unrelated OTEL_ mentions can't leak in) and add that file to the input manifest. These OTEL vars are resolved by the open-telemetry/sdk PHP package rather than the extension, so publishing them all as string/"" was inaccurate. Add a static type/default table sourced from open-telemetry/sdk 1.x (Common/Configuration/ValueTypes.php and Defaults.php) so timeouts/intervals/ sizes are int, headers/resource attrs are map, exporters/propagators are array, and protocols/endpoints/samplers carry their real SDK defaults. The table is authoritative for OTEL vars, so SDK defaults are published even where the extension also defines the config (e.g. OTEL_EXPORTER_OTLP_METRICS_ENDPOINT). Existing implementation labels are preserved. Note: defaults reflect SDK values; DatadogResolver overrides some at runtime (e.g. metrics temporality -> delta). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
47bcb10 to
1c704e5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c704e51df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
supported-configurations.jsongenerator only capturedOTEL_*env vars that the C extension reads viaZAI_STRL(), so SDK-owned configs likeOTEL_EXPORTER_OTLP_HEADERSwere never published. This PR fixes that and corrects the published type/default for every OTEL config.OTEL_CONFIG_WHITELISTarray insrc/DDTrace/OpenTelemetry/Configuration.phpas an additional source (scoped to the array literal so unrelatedOTEL_mentions elsewhere in the file can't leak in), and add that file to the generator's input manifest.open-telemetry/sdk1.x (ValueTypes.php/Defaults.php). Previously everything was published asstring/"", which is wrong for most of these — timeouts and sizes areint, headers and resource attributes aremap, exporters and propagators arearray, and protocols/endpoints/samplers have real string defaults.Type mapping: SDK integer→int, list→array, map→map, enum/mixed→string. Applies to all OTEL entries; existing implementation labels (B–E) on pre-existing entries are preserved. The table is authoritative for OTEL vars, so SDK defaults are published even where the extension also defines the config (e.g.
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT→http://localhost:4318).Defaults are the SDK's values;
DatadogResolveroverrides some at runtime (e.g. metrics temporality →delta).The
Configuration ConsistencyCI job passes. Thevalidate_supported_configurations_v2_local_filejob will be red until the matching versions are added to the Feature Parity configuration registry, handled separately.Reviewer checklist
🤖 Generated with Claude Code