support otlp export format#4522
Conversation
…an conversion logic into its own file
|
✨ Fix all issues with BitsAI or with Cursor
|
BenchmarksBenchmark execution time: 2026-03-13 15:30:11 Comparing candidate commit 8eea461 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 156 metrics, 8 unstable metrics.
|
…s for these fields
…, replace interface{} with any
…on http client's Read()
Codecov Report❌ Patch coverage is Additional details and impacted files
🚀 New features to boost your workflow:
|
| if raw == "" { | ||
| return headers | ||
| } | ||
| for _, pair := range strings.Split(raw, ",") { |
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
stringsseq: Ranging over SplitSeq is more efficient (modernize)
…d fix version and name fields on resource attributes
<!-- * 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!
What does this PR do?
Motivation
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!