Module: Uptrace

Extended by:
Uptrace
Included in:
Uptrace
Defined in:
lib/uptrace.rb,
lib/uptrace/dsn.rb,
lib/uptrace/trace.rb,
lib/uptrace/client.rb,
lib/uptrace/metric.rb,
lib/uptrace/version.rb,
lib/uptrace/trace/exporter.rb

Overview

Uptrace provides Uptrace exporters for OpenTelemetry.

Defined Under Namespace

Modules: Metric, Trace Classes: Client, DSN

Constant Summary collapse

VERSION =
'0.2.6'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clientObject, Client

Returns registered client or a default no-op implementation of the client.

Returns:

  • (Object, Client)

    registered client or a default no-op implementation of the client.



15
16
17
# File 'lib/uptrace.rb', line 15

def client
  @client ||= Client.new
end

#loggerObject

Returns the value of attribute logger.



9
10
11
# File 'lib/uptrace.rb', line 9

def logger
  @logger
end

Instance Method Details

#configure_opentelemetry(c, dsn: '') ⇒ Object



23
24
25
26
27
# File 'lib/uptrace.rb', line 23

def configure_opentelemetry(c, dsn: '')
  @client = Client.new(dsn: dsn) unless dsn.empty?

  c.add_span_processor(client.span_processor) unless client.disabled?
end

#trace_url(span) ⇒ Object



19
20
21
# File 'lib/uptrace.rb', line 19

def trace_url(span)
  client.trace_url(span)
end