Fix OTLP trace-metrics attribute compliance gaps - #12144
Conversation
Brings the traces.span.sdk.metrics.duration OTLP export in line with the RFC's attribute spec: emit datadog.process_tags as one arrayValue resource attribute instead of split per-key attributes, add the missing datadog.is_trace_root data-point attribute, canonicalize span.kind to the OTel Span Metrics Connector's uppercase convention, and emit status.code unconditionally with STATUS_CODE_OK/ERROR values instead of only on error. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Corrects a reversed static-import order in OtlpResourceJson.java and reformats a few lines flagged by google-java-format. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🎯 Code Coverage (details) 🔗 Commit SHA: 35657c0 | Docs | Datadog PR Page | Give us feedback! |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
service.name was only emitted on a data point when it differed from the writer's configured default service, which contradicts the RFC's always-present requirement already applied to status.code, span.kind, and is_trace_root. Drop the now-unused defaultService field/param.
The earlier spotless fix collapsed this Javadoc onto one physical line, but the formatter's own target (confirmed from the spotless job trace) keeps the three-line /** ... */ block and only unwraps the content itself onto a single line inside it.
Reuses the existing STRING_ARRAY_ATTRIBUTE visitor plumbing already wired for both proto and JSON collectors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This reverts commit e47c318.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e47c3183cf
ℹ️ 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".
There was a problem hiding this comment.
When process-tag propagation is enabled, a user global tag named datadog.process_tags produces two OTLP resource attributes with the same key: the user string and the new process-tag array. Duplicate OTLP keys have ambiguous consumer behavior, so the generated array must take precedence.
📊 Validated against 10 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit e47c318 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
Summary
Aligns Java OTLP trace metrics with the contract exercised by system-tests#7363.
service.nameand string-valuedstatus.code; canonicalizesspan.kindtoSPAN_KIND_*and defaults it toSPAN_KIND_INTERNAL.datadog.process_tagsas a resource array and captured peer tags asdatadog.peer_tags.datadog.is_trace_rootseparately fromdatadog.span.top_level; both use native OTLP boolean values.datadog.*and_datadog.*attributes.Map<String, Object>; this does not introduce an additional wrapper type.Validation
Added focused JSON/protobuf serialization coverage. Unit tests, Spotless, forbidden-API checks, and SpotBugs pass locally.