Skip to content

fix(ddtrace/tracer): align OTLP trace-metrics export with span metrics connector conventions - #5129

Closed
mabdinur wants to merge 3 commits into
mainfrom
master
Closed

fix(ddtrace/tracer): align OTLP trace-metrics export with span metrics connector conventions#5129
mabdinur wants to merge 3 commits into
mainfrom
master

Conversation

@mabdinur

@mabdinur mabdinur commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes several OTLP trace-metrics compliance gaps in stats_to_otlp_metrics.go, found during a cross-tracer audit against the OTel Span Metrics Connector's expected attribute conventions:

  • process_tags: emit a single datadog.process_tags resource attribute (arrayValue) instead of per-key datadog.<key> resource attributes.
  • is_trace_root: emit datadog.is_trace_root as a data-point attribute, reading the previously-unused ClientGroupedStats.IsTraceRoot field.
  • peer_tags: emit datadog.peer_tags as a data-point attribute (arrayValue), mirroring the same peer-tag-key allowlist the /v0.6/stats path already uses, instead of always suppressing it.
  • additional_metric_tags: emit each configured tag as its own unprefixed data-point attribute (support for this is still evolving across most SDKs).
  • span.kind: canonicalize to the Span Metrics Connector's SPAN_KIND_* string convention (e.g. SPAN_KIND_SERVER) instead of the raw lowercase Datadog value.
  • status.code: emit the Span Metrics Connector's STATUS_CODE_OK/STATUS_CODE_ERROR string convention (previously an OTel int enum), unconditionally on every data point.

All of the above except additional_metric_tags are gated by !otelMode, consistent with the existing datadog.* attribute suppression in OTel-semantics mode. http.status_code/gRPC status handling and service.name (already correct) are unaffected.

Motivation

Companion cross-tracer fix: DataDog/system-tests#7363

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.

LotharSee and others added 3 commits April 25, 2018 16:02
Bump to 0.6.1. It has no effect as this isn't the released tag.
We should it every time right before a release.
@mabdinur mabdinur added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Aug 4, 2026
@mabdinur

mabdinur commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing: opened against the wrong local branch due to a working-directory mix-up (not munir/otlp-trace-metrics-fixes). Reopening correctly.

@mabdinur mabdinur closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants