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 +4 -4
- data/lib/uptrace.rb +19 -0
- data/lib/uptrace/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e04833f5ff0015d78af4774cc49272db2c0c10e3cd93ce5acbe6cfc3e9e3772
|
4
|
+
data.tar.gz: f027f68acd8f95b550bdbde26322307420f8e833447aff1a268d06ac57b00910
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/uptrace/version.rb
CHANGED