Skip to content

Commit a611845

Browse files
committed
add docs and justify minimum supported versions
1 parent 5ad9754 commit a611845

File tree

11 files changed

+151
-65
lines changed

11 files changed

+151
-65
lines changed

appraisal/ruby-2.6.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@
243243

244244
appraise 'opentelemetry' do
245245
gem 'opentelemetry-sdk', '~> 1.1'
246-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
247-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
246+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
247+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
248248
end
249249

250250
appraise 'opentelemetry_otlp' do

appraisal/ruby-2.7.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@
246246

247247
appraise 'opentelemetry' do
248248
gem 'opentelemetry-sdk', '~> 1.1'
249-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
250-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
249+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
250+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
251251
end
252252

253253
appraise 'opentelemetry_otlp' do

appraisal/ruby-3.0.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@
170170

171171
appraise 'opentelemetry' do
172172
gem 'opentelemetry-sdk', '~> 1.1'
173-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
174-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
173+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
174+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
175175
end
176176

177177
appraise 'opentelemetry_otlp' do

appraisal/ruby-3.1.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@
167167

168168
appraise 'opentelemetry' do
169169
gem 'opentelemetry-sdk', '~> 1.1'
170-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
171-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
170+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
171+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
172172
end
173173

174174
appraise 'opentelemetry_otlp' do

appraisal/ruby-3.2.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@
212212

213213
appraise 'opentelemetry' do
214214
gem 'opentelemetry-sdk', '~> 1.2'
215-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
216-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
215+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
216+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
217217
end
218218

219219
appraise 'opentelemetry_otlp' do

appraisal/ruby-3.3.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@
214214

215215
appraise 'opentelemetry' do
216216
gem 'opentelemetry-sdk', '~> 1.1'
217-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
218-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
217+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
218+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
219219
end
220220

221221
appraise 'opentelemetry_otlp' do

appraisal/ruby-3.4.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@
227227

228228
appraise 'opentelemetry' do
229229
gem 'opentelemetry-sdk', '~> 1.1'
230-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
231-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
230+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
231+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
232232
end
233233

234234
appraise 'opentelemetry_otlp' do

appraisal/ruby-3.5.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@
173173

174174
appraise 'opentelemetry' do
175175
gem 'opentelemetry-sdk', '~> 1.1'
176-
gem 'opentelemetry-metrics-sdk', '~> 0.11'
177-
gem 'opentelemetry-exporter-otlp-metrics', '~> 0.6'
176+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
177+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4', '< 0.5'
178178
end
179179

180180
appraise 'opentelemetry_otlp' do

docs/OpenTelemetry.md

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# OpenTelemetry
22

3-
**Supported tracing frameworks**:
3+
**Supported OpenTelemetry features**:
44

55
| Type | Documentation | datadog version | Gem version support |
66
| ------------- | ---------------------------------------------------- | --------------- | ------------------- |
7-
| OpenTelemetry | https://github.com/open-telemetry/opentelemetry-ruby | 1.9.0+ | >= 1.1.0 |
7+
| Tracing | https://github.com/open-telemetry/opentelemetry-ruby | 1.9.0+ | >= 1.1.0 |
8+
| Metrics | https://github.com/open-telemetry/opentelemetry-ruby | 1.9.0+ | SDK >= 0.8, Exporter >= 0.4 |
89

9-
## Configuring OpenTelemetry
10+
## Configuring OpenTelemetry Tracing
1011

1112
1. Add the `datadog` gem to your Gemfile:
1213

@@ -44,6 +45,59 @@
4445

4546
[Integration instrumentations](#integration-instrumentation) and OpenTelemetry [Automatic instrumentations](https://opentelemetry.io/docs/instrumentation/ruby/automatic/) are also supported.
4647

48+
## Configuring OpenTelemetry Metrics
49+
50+
1. Add required gems to your Gemfile:
51+
52+
```ruby
53+
gem 'datadog'
54+
gem 'opentelemetry-metrics-sdk', '>= 0.8'
55+
gem 'opentelemetry-exporter-otlp-metrics', '>= 0.4'
56+
```
57+
58+
1. Install gems with `bundle install`
59+
60+
1. Enable metrics export:
61+
62+
```ruby
63+
require 'opentelemetry/sdk'
64+
require 'opentelemetry-metrics-sdk'
65+
require 'opentelemetry/exporter/otlp_metrics'
66+
require 'datadog/opentelemetry/metrics'
67+
68+
# Set environment variable or configure via Datadog
69+
ENV['DD_METRICS_OTEL_ENABLED'] = 'true'
70+
71+
Datadog.configure do |c|
72+
c.service = 'my-service'
73+
c.version = '1.0.0'
74+
c.env = 'production'
75+
end
76+
```
77+
78+
1. Use the OpenTelemetry Metrics API:
79+
80+
```ruby
81+
require 'opentelemetry/metrics'
82+
83+
provider = OpenTelemetry.meter_provider
84+
meter = provider.meter('my-app')
85+
counter = meter.create_counter('requests')
86+
counter.add(1)
87+
```
88+
89+
**Configuration Options:**
90+
91+
- `DD_METRICS_OTEL_ENABLED` - Enable metrics export (default: false)
92+
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` - Protocol: `grpc` (default) or `http/protobuf`
93+
- `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` - Custom endpoint (defaults to agent hostname + protocol port)
94+
- `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` - `delta` (default) or `cumulative`
95+
- `OTEL_METRIC_EXPORT_INTERVAL` - Export interval in milliseconds (default: 60000)
96+
97+
General OTLP settings (`OTEL_EXPORTER_OTLP_*`) serve as defaults if metrics-specific settings are not provided.
98+
99+
**Note:** Minimum `opentelemetry-metrics-sdk` is v0.8.0 (contains critical bug fixes). Use the latest version for best support. Exporter minimum depends on the metrics SDK. If OpenTelemetry API breaking changes affect ddtrace, [open a GitHub issue](https://github.com/DataDog/dd-trace-rb/issues).
100+
47101
## Limitations
48102

49103
There are a few limitations to OpenTelemetry Tracing when the APM integration is activated:

gemfiles/ruby_3.2_opentelemetry.gemfile

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)