Skip to content

profiler: Reduce execution trace period to 15min#2091

Merged
felixge merged 1 commit into
mainfrom
felix.geisendoerfer/PROF-7904-increase-interval
Jul 5, 2023
Merged

profiler: Reduce execution trace period to 15min#2091
felixge merged 1 commit into
mainfrom
felix.geisendoerfer/PROF-7904-increase-interval

Conversation

@felixge

@felixge felixge commented Jul 4, 2023

Copy link
Copy Markdown
Member

The initial value was very conservative, especially considering that this feature is opt-in for now. We expect this new value to be a better tradeoff between overhead, data volumes and span coverage.

What does this PR do?

Motivation

Describe how to test/QA your changes

Reviewer's Checklist

  • Changed code has unit tests for its functionality.
  • If this interacts with the agent in a new way, a system test has been added.

The initial value was very conservative, especially considering that
this feature is opt-in for now. We expect this new value to be a better
tradeoff between overhead, data volumes and span coverage.
@felixge
felixge requested a review from a team as a code owner July 4, 2023 07:31
@felixge
felixge requested a review from nsrip-dd July 4, 2023 07:31
@pr-commenter

pr-commenter Bot commented Jul 4, 2023

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2023-07-04 07:41:11

Comparing candidate commit 7a41f17 in PR branch felix.geisendoerfer/PROF-7904-increase-interval with baseline commit 2c7a8f4 in branch main.

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

@felixge
felixge merged commit c10c902 into main Jul 5, 2023
@felixge
felixge deleted the felix.geisendoerfer/PROF-7904-increase-interval branch July 5, 2023 12:56
link04 added a commit that referenced this pull request Jun 12, 2026
Opt-in mode that aligns OTLP-exported spans with the pure OpenTelemetry SDK by
suppressing Datadog-specific attributes and stopping DD-convention remaps.
Mirrors dd-trace-py #18495 and libdatadog #2091.

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true:
- omit operation.name, resource.name, span.type (DD-only span attributes)
- omit error.message/type/stack/handling_stack from the span (they live on the
  exception span event for Error Tracking)
- omit span.kind (already carried by the first-class OTLP SpanKind field)
- keep http.response.status_code under its OTel key instead of remapping to the
  legacy http.status_code string tag

Registers the key in supported_configurations so env.Get resolves it.
link04 added a commit that referenced this pull request Jun 12, 2026
Opt-in mode that aligns OTLP-exported spans with the pure OpenTelemetry SDK by
suppressing Datadog-specific attributes and stopping DD-convention remaps.
Mirrors dd-trace-py #18495 and libdatadog #2091.

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true:
- omit operation.name, resource.name, span.type (DD-only span attributes)
- omit error.message/type/stack/handling_stack from the span (they live on the
  exception span event for Error Tracking)
- omit span.kind (already carried by the first-class OTLP SpanKind field)
- keep http.response.status_code under its OTel key instead of remapping to the
  legacy http.status_code string tag

Registers the key in supported_configurations so env.Get resolves it.
link04 added a commit that referenced this pull request Jun 12, 2026
Opt-in mode that aligns OTLP-exported spans with the pure OpenTelemetry SDK by
suppressing Datadog-specific attributes and stopping DD-convention remaps.
Mirrors dd-trace-py #18495 and libdatadog #2091.

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true:
- omit operation.name, resource.name, span.type (DD-only span attributes)
- omit error.message/type/stack/handling_stack from the span (they live on the
  exception span event for Error Tracking)
- omit span.kind (already carried by the first-class OTLP SpanKind field)
- keep http.response.status_code under its OTel key instead of remapping to the
  legacy http.status_code string tag

Registers the key in supported_configurations so env.Get resolves it.
link04 added a commit that referenced this pull request Jun 16, 2026
Opt-in mode that aligns OTLP-exported spans with the pure OpenTelemetry SDK by
suppressing Datadog-specific attributes and stopping DD-convention remaps.
Mirrors dd-trace-py #18495 and libdatadog #2091.

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true:
- omit operation.name, resource.name, span.type (DD-only span attributes)
- omit error.message/type/stack/handling_stack from the span (they live on the
  exception span event for Error Tracking)
- omit span.kind (already carried by the first-class OTLP SpanKind field)
- keep http.response.status_code under its OTel key instead of remapping to the
  legacy http.status_code string tag
- the OTel bridge no longer interprets Datadog reserved tags (operation.name,
  analytics.event, http.response.status_code) in SetAttributes
- SetName updates the Datadog resource (the OTLP span name) instead of the DD-only
  operation name; gated here because changing it by default shifts RED metrics

Registers the key in supported_configurations so env.Get resolves it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
link04 added a commit that referenced this pull request Jun 22, 2026
Opt-in mode that aligns OTLP-exported spans with the pure OpenTelemetry SDK by
suppressing Datadog-specific attributes and stopping DD-convention remaps.
Mirrors dd-trace-py #18495 and libdatadog #2091.

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true:
- omit operation.name, resource.name, span.type (DD-only span attributes)
- omit error.message/type/stack/handling_stack from the span (they live on the
  exception span event for Error Tracking)
- omit span.kind (already carried by the first-class OTLP SpanKind field)
- keep http.response.status_code under its OTel key instead of remapping to the
  legacy http.status_code string tag
- the OTel bridge no longer interprets Datadog reserved tags (operation.name,
  analytics.event, http.response.status_code) in SetAttributes
- SetName updates the Datadog resource (the OTLP span name) instead of the DD-only
  operation name; gated here because changing it by default shifts RED metrics

Registers the key in supported_configurations so env.Get resolves it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
link04 added a commit that referenced this pull request Jun 26, 2026
Opt-in mode that aligns OTLP-exported spans with the pure OpenTelemetry SDK by
suppressing Datadog-specific attributes and stopping DD-convention remaps.
Mirrors dd-trace-py #18495 and libdatadog #2091.

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true:
- omit operation.name, resource.name, span.type (DD-only span attributes)
- omit error.message/type/stack/handling_stack from the span (they live on the
  exception span event for Error Tracking)
- omit span.kind (already carried by the first-class OTLP SpanKind field)
- keep http.response.status_code under its OTel key instead of remapping to the
  legacy http.status_code string tag
- the OTel bridge no longer interprets Datadog reserved tags (operation.name,
  analytics.event, http.response.status_code) in SetAttributes
- SetName updates the Datadog resource (the OTLP span name) instead of the DD-only
  operation name; gated here because changing it by default shifts RED metrics

Registers the key in supported_configurations so env.Get resolves it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
link04 added a commit that referenced this pull request Jul 1, 2026
Opt-in mode that aligns OTLP-exported spans with the pure OpenTelemetry SDK by
suppressing Datadog-specific attributes and stopping DD-convention remaps.
Mirrors dd-trace-py #18495 and libdatadog #2091.

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true:
- omit operation.name, resource.name, span.type (DD-only span attributes)
- omit error.message/type/stack/handling_stack from the span (they live on the
  exception span event for Error Tracking)
- omit span.kind (already carried by the first-class OTLP SpanKind field)
- keep http.response.status_code under its OTel key instead of remapping to the
  legacy http.status_code string tag
- the OTel bridge no longer interprets Datadog reserved tags (operation.name,
  analytics.event, http.response.status_code) in SetAttributes
- SetName updates the Datadog resource (the OTLP span name) instead of the DD-only
  operation name; gated here because changing it by default shifts RED metrics

Registers the key in supported_configurations so env.Get resolves it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 10, 2026
)

### What does this PR do?
Adds an opt-in `DD_TRACE_OTEL_SEMANTICS_ENABLED` that aligns OTLP-exported spans (and the OTel bridge) with the pure OpenTelemetry SDK by suppressing Datadog-specific attributes and stopping DD-convention remaps. Mirrors dd-trace-py #18495 and libdatadog #2091.

### Behavior when `DD_TRACE_OTEL_SEMANTICS_ENABLED=true`
- Omit `operation.name`, `resource.name`, `span.type` (DD-only span attributes)
- Omit `error.message`/`type`/`stack`/`handling_stack` from the span (they live on the exception span event for Error Tracking)
- Omit `span.kind` (already carried by the first-class OTLP `SpanKind` field)
- Keep `http.response.status_code` under its OTel key instead of remapping to the legacy `http.status_code` string tag
- The OTel bridge no longer interprets Datadog reserved tags (`operation.name`, `analytics.event`, `http.response.status_code`) in `SetAttributes` — they pass through as provided
- `SetName` updates the Datadog **resource** (which the OTLP exporter emits as the span name) instead of the DD-only **operation name**

Default (flag off) behavior is unchanged.

### Why `SetName` is gated here (moved from #4887)
Changing `SetName` to update the resource is the correct OTel-aligned behavior, but doing it unconditionally is a breaking change: it shifts both the operation name **and** resource name, which changes users' RED metrics. Per team discussion (matching the dd-trace-js decision), this belongs behind the semantics flag rather than as a default change in a minor release. This supersedes #4887.

### Performance
The flag is read **once** per export batch in `otlpTraceWriter.add()` and resolved **once** at provider creation for the bridge (cached on the `oteltracer`), then threaded as a parameter / read as a field — no per-span/per-attribute global config lookup.

### Testing
`TestConvertSpanAttributesOtelSemantics`, `TestRemapStatusCodeOtelSemantics`, `TestToReservedAttributesOtelSemantics`, and `TestSpanSetNameUpdatesResourceOtelSemantics` (flag on) plus the existing `TestSpanSetName` (flag off, legacy operation-name behavior). Full `ddtrace/tracer`, `ddtrace/opentelemetry`, and `internal/config` suites pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: maximo.bautista <[email protected]>
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