Skip to content

Support dd.internal.stats.payload in the OTLP metrics ingest pipeline #2242

Description

@lucastemb

Sub-issue of #2005.

Background

The Core Agent's production OTLP metrics translator recognizes a special metric named dd.internal.stats.payload.

This is not an ordinary metric. It is a transport envelope for a serialized APM StatsPayload:

  • Metric name: dd.internal.stats.payload
  • Metric type: Sum
  • Payload location: a bytes-valued datapoint attribute with the same key

The Core Agent's StatsToMetrics function wraps APM stats in this form, and its OTLP metrics translator performs the reverse operation: it extracts the bytes and forwards them to the APM-stats output rather than translating them as a timeseries metric.

This lets APM trace statistics cross the OTLP metrics pipeline without being emitted as normal metrics.

Current ADP behavior

ADP accepts the payload through its OTLP metrics receiver and sends it to OtlpMetricsTranslator.

ADP does not recognize dd.internal.stats.payload specially and has no equivalent of the Core Agent's statsOut handoff. The canonical payload uses an unspecified Sum temporality, so the metrics translator drops it as unsupported. No APM TraceStats event is produced.

Why this is needed

Without this support, ADP loses APM statistics that the Core Agent preserves when they are transported through OTLP metrics ingest.

This is required for transparent OTLP-ingest parity with the Core Agent under #2005. It is separate from #2016's Fargate source handling, although #2016 must recognize this payload as APM-only when deciding whether to retain a Fargate task_arn.

Proposed work

  • Recognize dd.internal.stats.payload when it is an OTLP Sum.
  • Extract the bytes-valued datapoint attribute of the same name.
  • Deserialize the encoded APM stats payload.
  • Convert or route it into Saluki's TraceStats event/output path.
  • Do not emit a normal metric for this envelope.
  • Add tests for payload extraction and conversion/routing, no normal metric emission, mixed payload and ordinary metrics, and mixed payload and runtime-only metrics on Fargate.

Non-goals

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions