Skip to content

Conversation

@mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Nov 4, 2025

What does this PR do?

Adds OpenTelemetry metrics SDK integration with OTLP exporter support for gRPC and HTTP/protobuf protocols.

Motivation:
Enables customers to use the OpenTelemetry Metrics API and export metrics via OTLP to any compatible backend, including the Datadog Agent.

Change log entry
Adds OpenTelemetry metrics SDK integration with OTLP exporter support. Configure via DD_METRICS_OTEL_ENABLED and standard OpenTelemetry environment variables.

Key Features:

  • OTLP exporter support (gRPC and HTTP/protobuf)
  • Automatic endpoint resolution based on protocol and agent hostname
  • Datadog service metadata mapped to OpenTelemetry resource attributes
  • General OTLP settings (OTEL_EXPORTER_OTLP_*) as defaults for metrics-specific settings

Required Gems for metrics support:

  • opentelemetry-metrics-sdk (~> 0.8)
  • opentelemetry-exporter-otlp-metrics (~> 0.4)

Testing:

BUNDLE_GEMFILE=gemfiles/ruby_3.2_opentelemetry.gemfile bundle exec rspec spec/datadog/opentelemetry/metrics_spec.rb

@github-actions github-actions bot added core Involves Datadog core libraries otel OpenTelemetry-related changes labels Nov 4, 2025
@pr-commenter
Copy link

pr-commenter bot commented Nov 4, 2025

Benchmarks

Benchmark execution time: 2025-12-02 19:16:04

Comparing candidate commit ac5449b in PR branch munir/add-otel-metrics-configs with baseline commit 48fa3f2 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 43 metrics, 2 unstable metrics.

scenario:tracing - Propagation - Trace Context

  • 🟩 throughput [+3422.995op/s; +3526.726op/s] or [+10.116%; +10.422%]

@mabdinur mabdinur changed the title chore(otel): add support for otel metrics [Part 1] chore(otel): add support for otel metrics Nov 4, 2025
@mabdinur mabdinur force-pushed the munir/add-otel-metrics-configs branch from a611845 to 9eb0a24 Compare November 5, 2025 00:29
@mabdinur mabdinur requested review from ivoanjo and marcotc November 26, 2025 16:58
Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it another pass! I think this is getting in quite good shape :)

@mabdinur mabdinur force-pushed the munir/add-otel-metrics-configs branch from a6ddfdc to bee73bb Compare November 27, 2025 17:57
@mabdinur
Copy link
Contributor Author

Gave it another pass! I think this is getting in quite good shape :)

Thanks so much for the thorough review and feedback. I really appreciate your time and patience. I learned a lot about ruby along the way 😸

@mabdinur mabdinur requested a review from ivoanjo November 27, 2025 19:42
Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks great to me! I really like how clean the tests ended up :)

Copy link
Contributor

@vpellan vpellan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting a change for the core/configuration/settings.rb file. Other requested changes are minor, after that it should be good !

@mabdinur mabdinur force-pushed the munir/add-otel-metrics-configs branch from b22e40e to f4c7eab Compare December 1, 2025 21:41
@mabdinur mabdinur merged commit a684817 into master Dec 3, 2025
565 checks passed
@mabdinur mabdinur deleted the munir/add-otel-metrics-configs branch December 3, 2025 01:47
@github-actions github-actions bot added this to the 2.23.0 milestone Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Involves Datadog core libraries integrations Involves tracing integrations otel OpenTelemetry-related changes tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants