Skip to content

feat(telemetry): add per-signal ingest E2E latency histogram#63

Merged
aksOps merged 2 commits into
mainfrom
feat/ingest-latency-histogram
Apr 28, 2026
Merged

feat(telemetry): add per-signal ingest E2E latency histogram#63
aksOps merged 2 commits into
mainfrom
feat/ingest-latency-histogram

Conversation

@aksOps

@aksOps aksOps commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

PR A of 6 from the production-readiness brainstorm. Closes the SLO blind spot identified by codex round 1 — there was no way to alert on a p99 ingest SLO because IngestionRate is a counter and GRPCRequestDuration aggregated all gRPC methods.

  • New `otelcontext_ingest_duration_seconds{signal}` histogram (signal ∈ {traces, logs, metrics})
  • Observed via `defer time.Since(start)` in the three `Export` methods; HTTP OTLP delegates to the same Export, so both transports record uniformly
  • Nil-safe helper so existing tests that pass nil metrics keep working

Test plan

  • `go test -race -count=1 ./...` → 416 passed (was 414, +2 new subtests)
  • New subtests cover per-label count advance and nil-receiver safety
  • curl /metrics will expose otelcontext_ingest_duration_seconds_bucket{signal=...} after one OTLP push

🤖 Generated with Claude Code

aksOps and others added 2 commits April 28, 2026 07:25
Closes the production-readiness gap where there was no way to set or
alert on a p99 ingest SLO — IngestionRate was a counter only, and
GRPCRequestDuration covered the gRPC layer broadly without a per-signal
split.

Adds otelcontext_ingest_duration_seconds{signal} histogram observed via
defer time.Since(start) in TraceServer/LogsServer/MetricsServer.Export.
The HTTP OTLP handler delegates to the same Export methods so both
transports record uniformly with a single instrumentation site.

- New label "signal" ∈ {traces, logs, metrics} for per-signal SLO alerting
- Buckets cover 1ms..10s (typical OTLP ingest range)
- Nil-safe ObserveIngestDuration helper protects ingest tests that pass
  nil telemetry.Metrics
- Subtests in metrics_pool_test.go assert per-label count advances and
  nil-receiver safety

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@aksOps aksOps merged commit 17d9e66 into main Apr 28, 2026
17 checks passed
@aksOps aksOps deleted the feat/ingest-latency-histogram branch April 28, 2026 07:38
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.

1 participant