Skip to content

test(otel): read the Go effective log level from the tracer - #8032

Open
vpellan wants to merge 3 commits into
mainfrom
vpellan/parametric-otel-log-level-go-thresholds
Open

vpellan wants to merge 3 commits into
mainfrom
vpellan/parametric-otel-log-level-go-thresholds

Conversation

@vpellan

@vpellan vpellan commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Enable the Go OTEL_LOG_LEVEL tests from #7841 now that DataDog/dd-trace-go#5559 is merged. That change makes info, warn and error set the tracer's log threshold. The Go helper read the INFO startup line, which is now absent at warn and error.

Changes

  • The Go parametric app reports dd_trace_effective_log_level from the tracer's threshold, read through tracer.AdaptLogger.
  • _log_level reads dd_trace_effective_log_level for Go, as for Java, Python and Ruby.
  • Enable Test_OTEL_LOG_LEVEL for Go from v2.12.0-dev. Older tracers store a warn threshold by default but still print INFO, so the threshold does not match their output.
  • At warn and error, the Go app no longer reports dd_trace_enabled: false when the INFO startup line is missing. It leaves the field out, since the line's absence does not show whether the tracer is enabled.
  • Remove dd_trace_startup_log_level, which no parametric app sets anymore.

Validation

  • ./format.sh --check
  • I ran test_otel_log_level.py, test_otel_env_vars.py and Test_Parametric_DDTrace_Config locally against dd-trace-go main (2.13.0-dev): 18 passed, 1 skipped (the PHP-only probe).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/golang.yml                                                    @DataDog/system-tests-reviewers
tests/parametric/otel_env_vars/test_otel_log_level.py                   @DataDog/system-tests-reviewers
tests/parametric/test_parametric_endpoints.py                           @DataDog/system-tests-reviewers
utils/build/docker/golang/parametric/datadog.go                         @DataDog/system-tests-reviewers
utils/docker_fixtures/_test_clients/_test_client_parametric.py          @DataDog/system-tests-core

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 2 Pipeline jobs failed

Testing the test | System Tests (golang, prod) / parametric / parametric (1) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Testing the test | all-jobs-are-green

View more details · View in GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

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

Base automatically changed from vpellan/parametric-otel-log-level to main October 15, 2026 09:44
@vpellan
vpellan force-pushed the vpellan/parametric-otel-log-level-go-thresholds branch from 1ff02a1 to 8c7e97a Compare October 16, 2026 09:50
@vpellan vpellan changed the title [golang@vpellan/otel-log-level-thresholds] test(otel): read the Go effective log level from the tracer test(otel): read the Go effective log level from the tracer Oct 16, 2026
The Go helper inferred the log level from the INFO startup line, which
is absent once OTEL_LOG_LEVEL=warn or error is honored. The Go
parametric app now reports dd_trace_effective_log_level through
tracer.AdaptLogger, and the threshold tests are enabled for Go from
v2.12.0-dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vpellan
vpellan force-pushed the vpellan/parametric-otel-log-level-go-thresholds branch from 8c7e97a to 3b6934d Compare October 16, 2026 09:59
@vpellan
vpellan marked this pull request as ready for review October 16, 2026 10:01
@vpellan
vpellan requested a review from a team as a code owner October 16, 2026 10:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T10:08:35.854131Z 3b6934d Draft marked ready
ℹ️ 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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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: 3b6934d3ac

ℹ️ 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 on lines +350 to +351
if startupLogLevel == "info" && (level == "warn" || level == "error") {
return "info"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve enabled status when INFO logs are filtered

When OTEL_LOG_LEVEL is warn or error, the tracer suppresses the INFO startup configuration, so l.tracerConfig remains empty. Although this new path successfully obtains the effective level, the unchanged check later in getTraceConfigHandler interprets that empty map as a disabled tracer and returns dd_trace_enabled: "false" together with blank configuration fields. Thus every /trace/config response under either newly enabled threshold misreports a running tracer; enabled status must no longer be inferred solely from the startup INFO message.

Useful? React with 👍 / 👎.

Comment thread manifests/golang.yml Outdated
Enable Test_OTEL_LOG_LEVEL for Go from v2.12.0-dev, so the Go parametric
app reports the tracer's threshold directly and no longer caps it with
the startup line level. Drop dd_trace_startup_log_level, which no app
sets anymore.

The startup configuration line is logged at INFO, so at warn and error
its absence no longer reports the tracer as disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vpellan
vpellan requested a review from a team as a code owner October 16, 2026 10:21

This branch has not been deployed

No deployments
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.

2 participants