Skip to content

feat(opentelemetry): add OpenTelemetry OTLP metrics exporter#608

Open
pakhomovld wants to merge 1 commit intogoogle:masterfrom
pakhomovld:add-opentelemetry-exporter
Open

feat(opentelemetry): add OpenTelemetry OTLP metrics exporter#608
pakhomovld wants to merge 1 commit intogoogle:masterfrom
pakhomovld:add-opentelemetry-exporter

Conversation

@pakhomovld
Copy link

@pakhomovld pakhomovld commented Feb 15, 2026

Summary

Add an OpenTelemetry metrics exporter plugin that sends SLO metrics via OTLP gRPC to any OpenTelemetry-compatible backend
(Grafana Mimir, Datadog, New Relic, etc.).

How it works

  • Subclasses MetricsExporter (same pattern as Prometheus, Datadog exporters)
  • Uses synchronous Gauge instruments (available since OTel SDK v1.22.0), which resolves the async gauge blocker mentioned
    in 💡 [REQUEST] - Add OpenTelemetry Exporter plugin #347
  • Creates a per-call MeterProvider with OTLPMetricExporter for endpoint isolation
  • SLO report labels map directly to OpenTelemetry metric attributes
  • All metrics use the slo_ prefix (e.g., slo_error_budget_burn_rate)

Changes

  • slo_generator/exporters/opentelemetry.py - New exporter
  • setup.cfg - opentelemetry extras group
  • Makefile - Added opentelemetry to install target
  • docs/providers/opentelemetry.md-Provider documentation
  • samples/config.yaml - Sample exporter config
  • tests/unit/test_compute.py - Unit test with mocked OTLP exporter
  • tests/unit/fixtures/exporters.yaml - Test fixture entry
  • tests/unit/test_stubs.py - Test context variables

Test plan

  • make unit - all tests pass including new test_export_opentelemetry
  • pre-commit run --all-files - all hooks pass

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.

💡 [REQUEST] - Add OpenTelemetry Exporter plugin

1 participant