Skip to content

Commit 98a243d

Browse files
committed
Add example of providing tracer provider to Client#new in the docs
1 parent e679ca3 commit 98a243d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/open-telemetry.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ The first node is unavailable and results in an HTTP error, while the retry to t
2727

2828
When using the https://opentelemetry.io/docs/instrumentation/ruby/manual[OpenTelemetry Ruby SDK manually] or using the https://opentelemetry.io/docs/instrumentation/ruby/automatic/[OpenTelemetry Ruby Auto-Instrumentations], the Ruby Client's OpenTelemetry instrumentation is enabled by default and uses the global OpenTelemetry SDK with the global tracer provider. You can provide a tracer provider via the Ruby Client configuration option `opentelemetry_tracer_provider` when instantiating the client. This is sometimes useful for testing or other specific use cases.
2929

30+
[source,ruby]
31+
------------------------------------
32+
client = Elasticsearch::Client.new(
33+
cloud_id: '<CloudID>',
34+
api_key: '<ApiKey>',
35+
opentelemetry_tracer_provider: tracer_provider
36+
)
37+
------------------------------------
38+
3039
[discrete]
3140
==== Configuring the OpenTelemetry instrumentation
3241

0 commit comments

Comments
 (0)