Skip to content

[OTEL-3364] feat(otel): add OTel startup logs environment configuration and tests - #7978

Merged
vpellan merged 3 commits into
mainfrom
vpellan/otel-startup-configuration
Oct 9, 2026
Merged

vpellan merged 3 commits into
mainfrom
vpellan/otel-startup-configuration

Conversation

@vpellan

@vpellan vpellan commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Motivation

Currently, reporting OTel configurations at startup is handled by tracers, without standardization on which configs should be reported. This can make self-troubleshooting or troubleshooting using BitsAI harder for customers, and may slow the adoption of DDOT SDKs

Changes

This adds tests that checks that critical OTel configs are present in the startup log config JSON

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Tests, manifest, weblog are modified -> you'll need a review from system-tests-reviewers: ask to one of youre co-worker familiar with the tested feature.
    • Framework is modified, or non obvious usage of it -> get a review from system-tests-core (slack)

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

@vpellan
vpellan requested review from a team as code owners October 7, 2026 12:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T12:58:29.201612Z f0799b5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/test_otel_startup_logs.py                                         @DataDog/system-tests-reviewers
.github/workflows/run-end-to-end.yml                                    @DataDog/system-tests-core
manifests/c.yml                                                         @DataDog/system-tests-reviewers
manifests/cpp.yml                                                       @DataDog/system-tests-reviewers
manifests/cpp_httpd.yml                                                 @DataDog/system-tests-reviewers
manifests/cpp_kong.yml                                                  @DataDog/system-tests-reviewers
manifests/cpp_nginx.yml                                                 @DataDog/system-tests-reviewers
manifests/dotnet.yml                                                    @DataDog/system-tests-reviewers
manifests/golang.yml                                                    @DataDog/system-tests-reviewers
manifests/java.yml                                                      @DataDog/system-tests-reviewers
manifests/nodejs.yml                                                    @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
manifests/python.yml                                                    @DataDog/system-tests-reviewers
manifests/ruby.yml                                                      @DataDog/system-tests-reviewers
manifests/rust.yml                                                      @DataDog/system-tests-reviewers
utils/_context/_scenarios/__init__.py                                   @DataDog/system-tests-core

@vpellan vpellan changed the title feat(otel): add OTel startup logs environment configuration and tests [OTEL-3364] feat(otel): add OTel startup logs environment configuration and tests Oct 7, 2026

@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: f0799b50ea

ℹ️ 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 utils/_context/_scenarios/__init__.py
Comment thread tests/test_otel_startup_logs.py
Comment thread tests/test_otel_startup_logs.py
Comment thread manifests/cpp.yml
Comment thread utils/_context/_scenarios/__init__.py
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 306d600 | Docs | View more details | Give us feedback!

@nccatoni nccatoni left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You should probably also get a review from someone familiar with the feature

Comment thread tests/test_otel_startup_logs.py
@vpellan
vpellan enabled auto-merge (squash) October 9, 2026 13:22
@vpellan
vpellan merged commit b6bbd04 into main Oct 9, 2026
2179 of 2191 checks passed
@vpellan
vpellan deleted the vpellan/otel-startup-configuration branch October 9, 2026 13:48
MilanGarnier added a commit to DataDog/dd-trace-dotnet that referenced this pull request Oct 9, 2026
## Summary of changes

Expose resolved OpenTelemetry configuration as flat uppercase fields in
the existing `DATADOG TRACER CONFIGURATION` startup JSON.

Added feature gates:

- `OTEL_ENABLED`
- `DD_TRACE_OTEL_ENABLED`
- `DD_METRICS_OTEL_ENABLED`
- `DD_LOGS_OTEL_ENABLED`
- `DD_TRACE_OTEL_SEMANTICS_ENABLED`

Added exporter settings, emitted for each enabled OTLP pipeline:

- `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`
- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`
- `OTEL_EXPORTER_OTLP_TRACES_HEADERS`
- `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_METRICS_HEADERS`
- `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`
- `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_LOGS_HEADERS`

Added shared and trace settings:

- `OTEL_LOG_LEVEL`
- `OTEL_SERVICE_NAME`
- `OTEL_RESOURCE_ATTRIBUTES`
- `OTEL_PROPAGATORS`, when injection and extraction use the same
sequence
- `OTEL_TRACES_SAMPLER`, when the managed sampler has a supported global
rate
- `OTEL_TRACES_SAMPLER_ARG`, for rates strictly between zero and one

Added logs settings:

- `OTEL_LOGS_EXPORTER`
- `OTEL_BLRP_SCHEDULE_DELAY`, when OTLP logs export is enabled
- `OTEL_BLRP_MAX_QUEUE_SIZE`, when OTLP logs export is enabled
- `OTEL_BLRP_MAX_EXPORT_BATCH_SIZE`, when OTLP logs export is enabled

Added metrics settings, emitted when OTLP metrics export is enabled:

- `OTEL_METRIC_EXPORT_INTERVAL`
- `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`

## Reason for change

[OTEL-3367](https://datadoghq.atlassian.net/browse/OTEL-3367): make the
configuration used by OTel integrations and exporters visible at
startup, including existing defaults, precedence, and fallback behavior.

This extends the idea in
[#8936](#8936) to cover
exporter, trace, logs, and metrics settings. Whenever possible, it uses
the matching "OTEL_" env var name (the main target here is onboarding
OTel consumers).

## Implementation details

- Share metrics/logs export predicates, including framework support,
between runtime code and startup logging; reuse the existing trace
export predicate.
- Share sampling-rate validation through `EffectiveGlobalSamplingRate`
and read propagator names from resolved instances. Emit
`OTEL_PROPAGATORS` only when injection and extraction match.
- Reuse existing exporter, logs batching, and metrics getters. Redact
header values and report intervals in milliseconds. `OTEL_BLRP_*` fields
reflect existing `DD_LOGS_DIRECT_SUBMISSION_*` settings, without adding
new inputs.
- Read the effective log level, service name, and global tags. Resource
attributes use the existing `key:value` array representation.

## Test coverage

Startup-log coverage is maintained in [system-tests
#7978](DataDog/system-tests#7978). No new
assertions or test-only serialization methods are added in this PR.
Existing configuration, sampling, propagation, and exporter tests were
run locally, and the managed targets and integration-test project
compiled.

A local run against
[#7978](DataDog/system-tests#7978) with the
tracer built from the earlier implementation revision completed with 15
passed and 12 failed.
The missing fields fall into these categories:
- Generic `OTEL_EXPORTER_OTLP_*`: report per-signal effective values
instead.
- Additional `DD_*` fields and `OTEL_TRACES_EXPORTER`: supported
settings whose uppercase startup-log fields are not added by this PR.
- `OTEL_SEMCONV_STABILITY_OPT_IN` and
`DD_DBM_TRACE_PREPARED_STATEMENTS`: unsupported configuration inputs in
.NET.
- `OTEL_TRACES_SAMPLER_ARG`: only emitted for ratio sampling; the test
requires it for `always_on` too.
- `OTEL_BLRP_EXPORT_TIMEOUT`: no equivalent setting in the batching
sink.


## Other details

Uses the existing startup-log emission and controls. Generic OTLP
transport fields are omitted because exporters can have different
finalized values. `OTEL_BLRP_EXPORT_TIMEOUT` is omitted because the sink
has no equivalent finalized setting. The added getters and interface
member are internal.

[OTEL-3367]:
https://datadoghq.atlassian.net/browse/OTEL-3367?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants