Module: Uptrace
- Extended by:
- Uptrace
- Included in:
- Uptrace
- Defined in:
- lib/uptrace.rb,
lib/uptrace/dsn.rb,
lib/uptrace/client.rb,
lib/uptrace/version.rb,
lib/uptrace/id_generator.rb
Overview
Uptrace provides Uptrace exporters for OpenTelemetry.
Defined Under Namespace
Modules: IdGenerator Classes: Client, DSN
Constant Summary collapse
- VERSION =
'1.5.0'
Instance Attribute Summary collapse
-
#client ⇒ Object, Client
Registered client or a default no-op implementation of the client.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#configure_opentelemetry(dsn: '') {|c| ... } ⇒ Object
ConfigureOpentelemetry configures OpenTelemetry to export data to Uptrace.
- #trace_url(span = nil) ⇒ String
Instance Attribute Details
#client ⇒ Object, Client
Returns registered client or a default no-op implementation of the client.
17 18 19 |
# File 'lib/uptrace.rb', line 17 def client @client ||= Client.new end |
#logger ⇒ Object
Returns the value of attribute logger.
11 12 13 |
# File 'lib/uptrace.rb', line 11 def logger @logger end |
Instance Method Details
#configure_opentelemetry(dsn: '') {|c| ... } ⇒ Object
ConfigureOpentelemetry configures OpenTelemetry to export data to Uptrace. Specifically it configures and registers Uptrace span exporter.
33 34 35 36 37 38 39 40 41 |
# File 'lib/uptrace.rb', line 33 def configure_opentelemetry(dsn: '') OpenTelemetry::SDK.configure do |c| @client = Client.new(dsn: dsn) unless dsn.empty? c.add_span_processor(span_processor(@client.dsn)) unless client.disabled? c.id_generator = Uptrace::IdGenerator yield c if block_given? end end |
#trace_url(span = nil) ⇒ String
23 24 25 |
# File 'lib/uptrace.rb', line 23 def trace_url(span = nil) @client.trace_url(span) end |