module Uptrace

Uptrace provides Uptrace exporters for OpenTelemetry.

Constants

VERSION

Attributes

client[W]
logger[RW]

Public Instance Methods

client() click to toggle source

@return [Object, Client] registered client or a default no-op implementation of the client.

# File lib/uptrace.rb, line 15
def client
  @client ||= Client.new
end
configure_opentelemetry(dsn: '') { |c| ... } click to toggle source

ConfigureOpentelemetry configures OpenTelemetry to export data to Uptrace. Specifically it configures and registers Uptrace span exporter.

@param [optional String] dsn @yieldparam [OpenTelemetry::SDK::Configurator] c Yields a configurator to the

provided block
# File lib/uptrace.rb, line 31
def configure_opentelemetry(dsn: '')
  OpenTelemetry::SDK.configure do |c|
    @client = Client.new(dsn: dsn) unless dsn.empty?
    c.add_span_processor(client.span_processor) unless client.disabled?

    yield c if block_given?
  end
end
trace_url(span = nil) click to toggle source

@param [optional OpenTelemetry::Trace::Span] span @return [String]

# File lib/uptrace.rb, line 21
def trace_url(span = nil)
  client.trace_url(span)
end