uptrace 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d437c19b7fc3feb724d4fa895fb7ef5e9cfc8501931a16f53d598fb9ef5afddc
4
- data.tar.gz: 6340b2ba9b3991f922777310e43d7e256384f621b18c6598e422332b1940efce
3
+ metadata.gz: 3e04833f5ff0015d78af4774cc49272db2c0c10e3cd93ce5acbe6cfc3e9e3772
4
+ data.tar.gz: f027f68acd8f95b550bdbde26322307420f8e833447aff1a268d06ac57b00910
5
5
  SHA512:
6
- metadata.gz: cdb698a1ee148f598fbf2ecf93ddc47867d797fd0f72a33bdc44547dfe5cec846984eaaba71e69c198ce3423c64bfe8ff830313b770980624a8cff164b0b431d
7
- data.tar.gz: 95c417612dd655203b05d3323188536f453fa03ba4f412e84491dc23bdca90397f9ae3d99cdfd1899f06e23632282efa6f74251a9e93da8436d1255aa74431df
6
+ metadata.gz: 1ef5879252c95a7ca008f042061ecc1d674f36822739e8f17bb19ae2385ef1f6cdc02bc2885edf3538da13d3f9d5f9feca849c3f553381de4b393f55aedf570d
7
+ data.tar.gz: ef03b0f10c6d992d81f5d64c0df4d9eb8c9590399c61fe9f3b9b8cc166492309940c2e2d6479f2366a9137d111caae6ce16b6c9f53c4f89f176b532345d94e2f
data/lib/uptrace.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'logger'
4
+ require 'opentelemetry'
4
5
 
5
6
  # Uptrace provides Uptrace exporters for OpenTelemetry.
6
7
  module Uptrace
@@ -22,10 +23,28 @@ module Uptrace
22
23
  client.trace_url(span)
23
24
  end
24
25
 
26
+ # ConfigureOpentelemetry configures OpenTelemetry to export data to Uptrace.
27
+ # By default it:
28
+ # - creates tracer provider;
29
+ # - registers Uptrace span exporter;
30
+ # - sets tracecontext + baggage composite context propagator.
31
+ #
32
+ # @param [OpenTelemetry::SDK::Configurator] c
25
33
  def configure_opentelemetry(c, dsn: '')
26
34
  @client = Client.new(dsn: dsn) unless dsn.empty?
27
35
 
28
36
  c.add_span_processor(client.span_processor) unless client.disabled?
37
+
38
+ if OpenTelemetry.propagation.nil?
39
+ c.injectors = [
40
+ OpenTelemetry::Trace::Propagation::TraceContext.text_map_injector,
41
+ OpenTelemetry::Baggage::Propagation.text_map_injector
42
+ ]
43
+ c.extractors = [
44
+ OpenTelemetry::Trace::Propagation::TraceContext.text_map_extractor,
45
+ OpenTelemetry::Baggage::Propagation.text_map_extractor
46
+ ]
47
+ end
29
48
  end
30
49
  end
31
50
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uptrace
4
- VERSION = '0.16.0'
4
+ VERSION = '0.16.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uptrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uptrace Authors