Skip to content

support otlp export format#4522

Closed
mtoffl01 wants to merge 23 commits into
mainfrom
mtoff/otlp-export
Closed

support otlp export format#4522
mtoffl01 wants to merge 23 commits into
mainfrom
mtoff/otlp-export

Conversation

@mtoffl01

Copy link
Copy Markdown
Contributor

What does this PR do?

Motivation

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Mar 10, 2026

Copy link
Copy Markdown

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 5 Tests failed

TestStartupLog from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog) (Fix with Cursor)
Failed

=== RUN   TestStartupLog
--- FAIL: TestStartupLog (0.14s)
TestStartupLog/basic from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog) (Fix with Cursor)
Failed

=== RUN   TestStartupLog/basic
    log_test.go:39: 
        	Error Trace:	/home/runner/work/dd-trace-go/dd-trace-go/ddtrace/tracer/log_test.go:39
        	Test:       	TestStartupLog/basic
    --- FAIL: TestStartupLog/basic (0.01s)
TestStartupLog/configured from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog) (Fix with Cursor)
Failed

=== RUN   TestStartupLog/configured
    log_test.go:71: 
        	Error Trace:	/home/runner/work/dd-trace-go/dd-trace-go/ddtrace/tracer/log_test.go:71
        	Test:       	TestStartupLog/configured
    --- FAIL: TestStartupLog/configured (0.06s)
View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 87.16%
Overall Coverage: 59.52% (+0.28%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8eea461 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@pr-commenter

pr-commenter Bot commented Mar 10, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-03-13 15:30:11

Comparing candidate commit 8eea461 in PR branch mtoff/otlp-export with baseline commit 89047df in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 156 metrics, 8 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@kakkoyun
kakkoyun self-requested a review March 11, 2026 10:11
@codecov

codecov Bot commented Mar 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.78723% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.39%. Comparing base (89047df) to head (3c9e4ec).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
ddtrace/tracer/payload_otlp_convert.go 90.76% 9 Missing and 3 partials ⚠️
ddtrace/tracer/payload_otlp.go 82.75% 8 Missing and 2 partials ⚠️
ddtrace/tracer/otel_dd_mappings.go 77.77% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
ddtrace/tracer/log.go 87.09% <100.00%> (-4.12%) ⬇️
ddtrace/tracer/option.go 84.42% <100.00%> (-1.89%) ⬇️
ddtrace/tracer/payload.go 100.00% <ø> (ø)
ddtrace/tracer/transport.go 87.36% <ø> (-6.32%) ⬇️
ddtrace/tracer/writer.go 91.83% <100.00%> (-2.47%) ⬇️
internal/agent.go 73.91% <100.00%> (ø)
ddtrace/tracer/otel_dd_mappings.go 67.02% <77.77%> (-1.59%) ⬇️
ddtrace/tracer/payload_otlp.go 82.75% <82.75%> (ø)
ddtrace/tracer/payload_otlp_convert.go 90.76% <90.76%> (ø)

... and 272 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread ddtrace/tracer/option.go
if raw == "" {
return headers
}
for _, pair := range strings.Split(raw, ",") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
stringsseq: Ranging over SplitSeq is more efficient (modernize)

…d fix version and name fields on resource attributes
mtoffl01 added a commit that referenced this pull request Mar 20, 2026
<!--
* New contributors are highly encouraged to read our
  [CONTRIBUTING](/CONTRIBUTING.md) documentation.
* Commit and PR titles should be prefixed with the general area of the
pull request's change.

-->
### Background
This PR is part of an ongoing effort to support OTLP Traces Export Phase
1, documented
[here](https://docs.google.com/document/d/1AsUrJxjJavLvSG33kUAJLYzGU8IYgrnf1SMbFDsuGmo/edit?tab=t.avgpmfl6f0c6#heading=h.jssp4de43yev).
It contains some placeholder/no-op code (e.g. otlpTraceWriter) which
will be implemented in follow-up PRs (e.g,
#4522).

### What does this PR do?
When OTLP export mode is enabled, the SDK must not use the Datadog Agent
priority sampler, since there is no agent available to provide
per-service sampling rates. This PR introduces a replacement fallback
sampler for that mode.

New type: `otelParentBasedAlwaysOnSampler` — implements the
`parentbased_always_on` strategy
([ref](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration)),
which honors propagated sampling decisions from parent contexts,
otherwise samples all traces at rate 1.0. User-configured rules take
precedence over this fallback.

New interface: `defaultSampler` — abstracts the fallback sampling
strategy applied when no user-defined rules match a span. Both
`prioritySampler` (agent mode) and `otelParentBasedAlwaysOnSampler`
(OTLP mode) satisfy this interface, replacing the previous concrete
`*prioritySampler` field on the tracer and ensuring the fallback is
never nil.

### Motivation
See Requirements:
https://docs.google.com/document/d/1AsUrJxjJavLvSG33kUAJLYzGU8IYgrnf1SMbFDsuGmo/edit?tab=t.avgpmfl6f0c6#heading=h.nqkivnomx6oe

### Reviewer's Checklist
<!--
* Authors can use this list as a reference to ensure that there are no
problems
during the review but the signing off is to be done by the reviewer(s).
-->

- [ ] Changed code has unit tests for its functionality at or near 100%
coverage.
- [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering
this feature have been added and enabled with the va.b.c-dev version
tag.
- [ ] There is a benchmark for any new code, or changes to existing
code.
- [ ] If this interacts with the agent in a new way, a system test has
been added.
- [ ] New code is free of linting errors. You can check this by running
`make lint` locally.
- [ ] New code doesn't break existing tests. You can check this by
running `make test` locally.
- [ ] Add an appropriate team label so this PR gets put in the right
place for the release notes.
- [ ] All generated files are up to date. You can check this by running
`make generate` locally.
- [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed
by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to
date by running `make fix-modules` locally.

Unsure? Have a question? Request a review!
@mtoffl01 mtoffl01 closed this Mar 24, 2026
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.

1 participant