← Back to Pull requests

[otel-agent] Use zstd compression for all signals #52758

Closed
unknown closed this pull request without merging on Aug 12, 2026 14:49 UTC
View on GitHub
unknown unknown commented on Jun 25, 2026 00:02 UTC
Author

What does this PR do?

Makes the DDOT collector (otel-agent) compress every signal with zstd, replacing the previous per-signal mix (zlib for metrics, gzip for traces, zstd for logs):

  • Metrics: use the config-driven metrics compressor (metricscompression/fx) instead of the hardcoded zlib module; defaults to zstd level 3, overridable via serializer_zstd_compressor_level.

  • Logs: pin zstd and default logs_config.zstd_compression_level to 3 (overridable).

  • Traces: use the existing fx-zstd module (zstd at BestSpeed); the trace level is intentionally fixed.

  • Host metadata: rides the same serializer compressor as metrics (no dedicated knob), so it becomes zstd automatically.
  • Also adds tests that guard against future per-signal compression divergence.

    Motivation

    The DDOT exporter used a different compression algorithm per signal, which is inconsistent and harder to reason about. Standardizing on zstd gives a consistent algorithm across metrics/traces/logs and a better compression ratio, with the level configurable per signal.

    Describe how you validated your changes

  • dda inv otel-agent.build passes; dda inv linter.go → 0 issues on changed packages; gofmt clean.

  • Unit (cmd/otel-agent/config): asserts metrics and logs resolve to the same algorithm (zstd) at level 3, that the level stays env-overridable, and that host metadata uses that same serializer compressor (so it is zstd too).

  • Integration (comp/otelcol/otlp/integrationtest): now decodes trace payloads as zstd — verifies traces ship valid zstd end-to-end. Passes locally (dda inv otel-agent.integration-test).

  • E2E (TestOTelAgentComplete/TestOTLPCompression): asserts metrics, traces, and logs reach fakeintake with Content-Encoding: zstd (requires the e2e infra to run).
  • Additional Notes

  • Scope is the standalone otel-agent. The core Agent, trace-agent, host-profiler, and OSS exporter are unaffected — they use their own compression modules (metricscompression/fx, fx-zstd, fx-gzip, fx-otel respectively).

  • The v2 metrics intake is preserved (use_v3_api.series.enabled stays false); moving series to v3 is a separate effort. ⚠️ Reviewers: please confirm the v2 series intake (/api/v2/series) accepts Content-Encoding: zstd — the core Agent uses zstd→v3 for series by default, so this exact combination isn't exercised today. The new e2e test validates it against fakeintake.

  • Exhaustive compression coverage (all the DD exporter's submission clients): after this change, every active intake submission in the otel-agent is zstd — metrics (series/sketches), host metadata, logs, traces — except APM stats, which stays gzip (hardcoded in pkg/trace/writer/stats.go, shared with the trace-agent; out of scope here, separate conversation). The orchestrator/K8s-objects sub-exporter already uses zstd and is disabled by default. Internal exporter telemetry (metricsclient, COAT/gateway gauges) is scraped Prometheus/OTel-meter telemetry, not an intake submission.
  • 🤖 Generated with Claude Code

    Diff: 395 lines (+296 / -99) across 4 files Reviewer: truthbk Review duration: 70007m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 395 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #52758"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.2% (MEDIUM) · Higher = larger blast radius
    43.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.7% · Safe to merge
    18.7%