Skip to content

feat(otel): capture OTEL_CONFIG_WHITELIST vars with SDK-sourced type/default#4005

Open
bm1549 wants to merge 1 commit into
masterfrom
brian.marks/otel-headers-supported-config
Open

feat(otel): capture OTEL_CONFIG_WHITELIST vars with SDK-sourced type/default#4005
bm1549 wants to merge 1 commit into
masterfrom
brian.marks/otel-headers-supported-config

Conversation

@bm1549

@bm1549 bm1549 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

The supported-configurations.json generator only captured OTEL_* env vars that the C extension reads via ZAI_STRL(), so SDK-owned configs like OTEL_EXPORTER_OTLP_HEADERS were never published. This PR fixes that and corrects the published type/default for every OTEL config.

  • 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 elsewhere in the file can't leak in), and add that file to the generator's input manifest.
  • Add a static type/default table for OTEL configs, sourced from open-telemetry/sdk 1.x (ValueTypes.php / Defaults.php). Previously everything was published as string/"", which is wrong for most of these — timeouts and sizes are int, headers and resource attributes are map, exporters and propagators are array, 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_ENDPOINThttp://localhost:4318).

Defaults are the SDK's values; DatadogResolver overrides some at runtime (e.g. metrics temporality → delta).

The Configuration Consistency CI job passes. The validate_supported_configurations_v2_local_file job will be red until the matching versions are added to the Feature Parity configuration registry, handled separately.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

🤖 Generated with Claude Code

@bm1549 bm1549 added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jun 22, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jun 22, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 15 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | pecl tests: [8.2]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [8.5]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | test_web_custom: [7.3, cgi-fcgi]   View in Datadog   GitLab

View all 15 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.12% (+0.04%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1c704e5 | Docs | Datadog PR Page | Give us feedback!

@bm1549 bm1549 force-pushed the brian.marks/otel-headers-supported-config branch 4 times, most recently from 4cb73bd to 47bcb10 Compare June 24, 2026 14:56
…/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>
@bm1549 bm1549 force-pushed the brian.marks/otel-headers-supported-config branch from 47bcb10 to 1c704e5 Compare June 24, 2026 15:00
@bm1549 bm1549 marked this pull request as ready for review June 24, 2026 15:48
@bm1549 bm1549 requested a review from a team as a code owner June 24, 2026 15:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread metadata/supported-configurations.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant