Skip to content

feat(otel): metrics support#127

Merged
mabdinur merged 32 commits intomainfrom
munir/otel-metrics-vibe-coding
Jan 14, 2026
Merged

feat(otel): metrics support#127
mabdinur merged 32 commits intomainfrom
munir/otel-metrics-vibe-coding

Conversation

@mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Dec 2, 2025

What does this PR do?

Adds OpenTelemetry Metrics SDK support with OTLP transport to datadog-opentelemetry. Metrics can be exported via gRPC (default) or HTTP/protobuf, enabling Rust applications to export OpenTelemetry metrics to Datadog using the standard OpenTelemetry Metrics API.

Key Features

  • OTLP Transport: Supports gRPC (default, port 4317) and HTTP/protobuf (port 4318) protocols
  • Configuration API: Full support for OTLP metrics configuration via ConfigBuilder, including set_otel_resource_attributes()
  • Resource Attributes: Support for OTEL_RESOURCE_ATTRIBUTES environment variable
  • Temporality Control: Configurable Delta/Cumulative temporality preference
  • Graceful Degradation: HTTP/JSON protocol gracefully degrades with a warning (no-op provider)

Motivation

Enables Rust applications to export OpenTelemetry metrics to Datadog using the standard OpenTelemetry Metrics API, aligning with support in other languages and providing a consistent observability experience across the Datadog ecosystem.

Additional Notes

  • Metrics are opt-in via DD_METRICS_OTEL_ENABLED=true

Feature gating:

  • Default: cargo add datadog-opentelemetry → gRPC transport
  • HTTP-only: cargo add datadog-opentelemetry --no-default-features --features metrics-http → HTTP/protobuf without gRPC dependencies
  • Both: cargo add datadog-opentelemetry --features metrics-grpc,metrics-http → enables both protocols

Testing:

@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch from 8d540d4 to c72f21d Compare December 2, 2025 19:30
@mabdinur mabdinur changed the title feat(otel): vibe coded metrics support [WIP] feat(otel): metrics support [WIP] Dec 9, 2025
@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch from e48725d to 0bd7ee3 Compare December 10, 2025 21:48
@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch from d7d8b75 to 98d1b8e Compare December 10, 2025 22:17
@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch 2 times, most recently from 4cfcaac to 17c3a2a Compare December 12, 2025 21:15
@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch from 17c3a2a to b788439 Compare December 12, 2025 21:17
@mabdinur mabdinur changed the title feat(otel): metrics support [WIP] feat(otel): metrics support Dec 15, 2025
@mabdinur
Copy link
Contributor Author

Shared tests covering edge cases: DataDog/system-tests#5863

@mabdinur mabdinur marked this pull request as ready for review December 17, 2025 20:33
@mabdinur mabdinur requested a review from a team as a code owner December 17, 2025 20:33
@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch from be7a87d to d90aad7 Compare December 29, 2025 21:26
@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch from bc088c7 to 9da527e Compare January 14, 2026 04:39
@mabdinur mabdinur force-pushed the munir/otel-metrics-vibe-coding branch from 7ecdb1a to 06ddd45 Compare January 14, 2026 04:58
@mabdinur mabdinur merged commit e08cf6d into main Jan 14, 2026
24 checks passed
@mabdinur mabdinur deleted the munir/otel-metrics-vibe-coding branch January 14, 2026 15:40
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