Module: OpenTelemetry::SDK

Extended by:
SDK
Included in:
SDK
Defined in:
lib/opentelemetry/sdk.rb,
lib/opentelemetry/sdk/trace.rb,
lib/opentelemetry/sdk/baggage.rb,
lib/opentelemetry/sdk/version.rb,
lib/opentelemetry/sdk/internal.rb,
lib/opentelemetry/sdk/resources.rb,
lib/opentelemetry/sdk/trace/span.rb,
lib/opentelemetry/sdk/trace/event.rb,
lib/opentelemetry/sdk/configurator.rb,
lib/opentelemetry/sdk/trace/config.rb,
lib/opentelemetry/sdk/trace/export.rb,
lib/opentelemetry/sdk/trace/tracer.rb,
lib/opentelemetry/sdk/trace/samplers.rb,
lib/opentelemetry/sdk/baggage/builder.rb,
lib/opentelemetry/sdk/baggage/manager.rb,
lib/opentelemetry/sdk/trace/span_data.rb,
lib/opentelemetry/sdk/resources/resource.rb,
lib/opentelemetry/sdk/resources/constants.rb,
lib/opentelemetry/sdk/trace/samplers/result.rb,
lib/opentelemetry/sdk/trace/tracer_provider.rb,
lib/opentelemetry/sdk/instrumentation_library.rb,
lib/opentelemetry/sdk/trace/samplers/decision.rb,
lib/opentelemetry/sdk/trace/config/trace_config.rb,
lib/opentelemetry/sdk/trace/noop_span_processor.rb,
lib/opentelemetry/sdk/trace/multi_span_processor.rb,
lib/opentelemetry/sdk/trace/samplers/parent_based.rb,
lib/opentelemetry/sdk/trace/export/noop_span_exporter.rb,
lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb,
lib/opentelemetry/sdk/trace/export/multi_span_exporter.rb,
lib/opentelemetry/sdk/trace/export/batch_span_processor.rb,
lib/opentelemetry/sdk/trace/export/console_span_exporter.rb,
lib/opentelemetry/sdk/trace/export/simple_span_processor.rb,
lib/opentelemetry/sdk/trace/samplers/trace_id_ratio_based.rb,
lib/opentelemetry/sdk/trace/export/in_memory_span_exporter.rb

Overview

SDK provides the reference implementation of the OpenTelemetry API.

Defined Under Namespace

Modules: Baggage, Internal, Resources, Trace Classes: Configurator, InstrumentationLibrary

Constant Summary collapse

VERSION =

Current OpenTelemetry version

'0.9.0'

Instance Method Summary collapse

Instance Method Details

#configure {|configurator| ... } ⇒ Object

Configures SDK and instrumentation

Example usage: Without a block defaults are installed without any instrumentation

OpenTelemetry::SDK.configure

Install instrumentation individually with optional config

OpenTelemetry::SDK.configure do |c|
  c.use 'OpenTelemetry::Instrumentation::Faraday', tracer_middleware: SomeMiddleware
end

Install all instrumentation with optional config

OpenTelemetry::SDK.configure do |c|
  c.use_all 'OpenTelemetry::Instrumentation::Faraday' => { tracer_middleware: SomeMiddleware }
end

Add a span processor

OpenTelemetry::SDK.configure do |c|
  c.add_span_processor SpanProcessor.new(SomeExporter.new)
end

Configure everything

OpenTelemetry::SDK.configure do |c|
  c.logger = Logger.new('/dev/null')
  c.add_span_processor SpanProcessor.new(SomeExporter.new)
  c.use_all
end

Yield Parameters:

  • configurator (Configurator)

    Yields a configurator to the provided block



56
57
58
59
60
# File 'lib/opentelemetry/sdk.rb', line 56

def configure
  configurator = Configurator.new
  yield configurator if block_given?
  configurator.configure
end