opentelemetry-sdk 0.4.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +2 -2
- data/CHANGELOG.md +42 -0
- data/README.md +1 -1
- data/lib/opentelemetry/sdk.rb +4 -3
- data/lib/opentelemetry/sdk/baggage.rb +16 -0
- data/lib/opentelemetry/sdk/{correlation_context → baggage}/builder.rb +5 -5
- data/lib/opentelemetry/sdk/{correlation_context → baggage}/manager.rb +37 -27
- data/lib/opentelemetry/sdk/configurator.rb +73 -39
- data/lib/opentelemetry/sdk/instrumentation_library.rb +13 -0
- data/lib/opentelemetry/sdk/resources.rb +1 -0
- data/lib/opentelemetry/sdk/resources/constants.rb +120 -0
- data/lib/opentelemetry/sdk/resources/resource.rb +38 -19
- data/lib/opentelemetry/sdk/trace.rb +1 -0
- data/lib/opentelemetry/sdk/trace/config/trace_config.rb +3 -3
- data/lib/opentelemetry/sdk/trace/event.rb +48 -0
- data/lib/opentelemetry/sdk/trace/export.rb +9 -9
- data/lib/opentelemetry/sdk/trace/export/batch_span_processor.rb +49 -28
- data/lib/opentelemetry/sdk/trace/export/console_span_exporter.rb +3 -6
- data/lib/opentelemetry/sdk/trace/export/in_memory_span_exporter.rb +6 -2
- data/lib/opentelemetry/sdk/trace/export/multi_span_exporter.rb +7 -8
- data/lib/opentelemetry/sdk/trace/export/noop_span_exporter.rb +2 -1
- data/lib/opentelemetry/sdk/trace/export/simple_span_processor.rb +13 -3
- data/lib/opentelemetry/sdk/trace/multi_span_processor.rb +12 -4
- data/lib/opentelemetry/sdk/trace/noop_span_processor.rb +15 -3
- data/lib/opentelemetry/sdk/trace/samplers.rb +52 -51
- data/lib/opentelemetry/sdk/trace/samplers/constant_sampler.rb +33 -0
- data/lib/opentelemetry/sdk/trace/samplers/decision.rb +3 -3
- data/lib/opentelemetry/sdk/trace/samplers/parent_based.rb +53 -0
- data/lib/opentelemetry/sdk/trace/samplers/result.rb +3 -3
- data/lib/opentelemetry/sdk/trace/samplers/trace_id_ratio_based.rb +45 -0
- data/lib/opentelemetry/sdk/trace/span.rb +33 -36
- data/lib/opentelemetry/sdk/trace/span_data.rb +18 -3
- data/lib/opentelemetry/sdk/trace/tracer.rb +36 -20
- data/lib/opentelemetry/sdk/trace/tracer_provider.rb +4 -4
- data/lib/opentelemetry/sdk/version.rb +1 -1
- metadata +19 -10
- data/lib/opentelemetry/sdk/correlation_context.rb +0 -16
- data/lib/opentelemetry/sdk/trace/samplers/probability_sampler.rb +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 735ead8ec769c6a55c3e3393341366ebd4a7e83bd4bdd8a71ca474b470ab0566
|
4
|
+
data.tar.gz: 862d5aa24d401a6c215d852a4c601a58d858d452c9f3679cd33d71094de2eeb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cb9becaedfbf07126a03c68f1968c988d499042c587a4d4e1100048660d2fa699b809c7d687eb90700d63ecceda4b31172e2efd25ea147abb0ccd7afbe9b476
|
7
|
+
data.tar.gz: 718f2a0a972e3a3f60beea5f4d3d8bff47f943fc24ecc2726182449f1cb3e958122e40971f5db7b96771b9380cd79b93f0ef7e3480d4319b5466d1c7ce3e0287
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1 +1,43 @@
|
|
1
1
|
# Release History: opentelemetry-sdk
|
2
|
+
|
3
|
+
### v0.8.0 / 2020-10-27
|
4
|
+
|
5
|
+
* BREAKING CHANGE: Move context/span methods to Trace module
|
6
|
+
* BREAKING CHANGE: Remove 'canonical' from status codes
|
7
|
+
* BREAKING CHANGE: Assorted SpanContext fixes
|
8
|
+
|
9
|
+
* FIXED: Move context/span methods to Trace module
|
10
|
+
* FIXED: Remove 'canonical' from status codes
|
11
|
+
* FIXED: Assorted SpanContext fixes
|
12
|
+
|
13
|
+
### v0.7.0 / 2020-10-07
|
14
|
+
|
15
|
+
* ADDED: Add service_name setter to configurator
|
16
|
+
* ADDED: Add service_version setter to configurator
|
17
|
+
* FIXED: Fork safety for batch processor
|
18
|
+
* FIXED: Don't generate a span ID unnecessarily
|
19
|
+
* DOCS: Fix Configurator#add_span_processor
|
20
|
+
* DOCS: Standardize toplevel docs structure and readme
|
21
|
+
|
22
|
+
### v0.6.0 / 2020-09-10
|
23
|
+
|
24
|
+
* BREAKING CHANGE: Rename Resource labels to attributes
|
25
|
+
* BREAKING CHANGE: Export resource from Span/SpanData instead of library_resource
|
26
|
+
* BREAKING CHANGE: Rename CorrelationContext to Baggage
|
27
|
+
* BREAKING CHANGE: Rename Text* to TextMap* (propagators, injectors, extractors)
|
28
|
+
* BREAKING CHANGE: Rename span.record_error to span.record_exception
|
29
|
+
* BREAKING CHANGE: Update samplers to match spec
|
30
|
+
* BREAKING CHANGE: Remove support for lazy event creation
|
31
|
+
|
32
|
+
* ADDED: Add OTLP exporter
|
33
|
+
* ADDED: Add support for OTEL_LOG_LEVEL env var
|
34
|
+
* FIXED: Rename Resource labels to attributes
|
35
|
+
* ADDED: Environment variable resource detection
|
36
|
+
* ADDED: BatchSpanProcessor environment variable support
|
37
|
+
* FIXED: Remove semver prefix
|
38
|
+
* FIXED: Docs for array valued attributes
|
39
|
+
* ADDED: Add hex_trace_id and hex_span_id helpers to SpanData
|
40
|
+
* FIXED: Fix ProbabilitySampler
|
41
|
+
* ADDED: Implement GetCorrelations
|
42
|
+
* FIXED: Change default Sampler to ParentOrElse(AlwaysOn)
|
43
|
+
* FIXED: Fix probability sampler
|
data/README.md
CHANGED
@@ -41,7 +41,7 @@ tracer.in_span('foo') do |span|
|
|
41
41
|
# set an attribute
|
42
42
|
span.set_attribute('platform', 'osx')
|
43
43
|
# add an event
|
44
|
-
span.add_event(
|
44
|
+
span.add_event('event in bar')
|
45
45
|
# create bar as child of foo
|
46
46
|
tracer.in_span('bar') do |child_span|
|
47
47
|
# inspect the span
|
data/lib/opentelemetry/sdk.rb
CHANGED
@@ -30,13 +30,13 @@ module OpenTelemetry
|
|
30
30
|
# Install instrumentation individually with optional config
|
31
31
|
#
|
32
32
|
# OpenTelemetry::SDK.configure do |c|
|
33
|
-
# c.use 'OpenTelemetry::
|
33
|
+
# c.use 'OpenTelemetry::Instrumentation::Faraday', tracer_middleware: SomeMiddleware
|
34
34
|
# end
|
35
35
|
#
|
36
36
|
# Install all instrumentation with optional config
|
37
37
|
#
|
38
38
|
# OpenTelemetry::SDK.configure do |c|
|
39
|
-
# c.use_all 'OpenTelemetry::
|
39
|
+
# c.use_all 'OpenTelemetry::Instrumentation::Faraday' => { tracer_middleware: SomeMiddleware }
|
40
40
|
# end
|
41
41
|
#
|
42
42
|
# Add a span processor
|
@@ -61,8 +61,9 @@ module OpenTelemetry
|
|
61
61
|
end
|
62
62
|
|
63
63
|
require 'opentelemetry/sdk/configurator'
|
64
|
-
require 'opentelemetry/sdk/
|
64
|
+
require 'opentelemetry/sdk/baggage'
|
65
65
|
require 'opentelemetry/sdk/internal'
|
66
|
+
require 'opentelemetry/sdk/instrumentation_library'
|
66
67
|
require 'opentelemetry/sdk/resources'
|
67
68
|
require 'opentelemetry/sdk/trace'
|
68
69
|
require 'opentelemetry/sdk/version'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2019 OpenTelemetry Authors
|
4
|
+
#
|
5
|
+
# SPDX-License-Identifier: Apache-2.0
|
6
|
+
|
7
|
+
require 'opentelemetry/sdk/baggage/builder'
|
8
|
+
require 'opentelemetry/sdk/baggage/manager'
|
9
|
+
|
10
|
+
module OpenTelemetry
|
11
|
+
module SDK
|
12
|
+
# Contains operational implementations of the Baggage::Manager
|
13
|
+
module Baggage
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -6,8 +6,8 @@
|
|
6
6
|
|
7
7
|
module OpenTelemetry
|
8
8
|
module SDK
|
9
|
-
module
|
10
|
-
# SDK implementation of
|
9
|
+
module Baggage
|
10
|
+
# SDK implementation of Baggage::Builder
|
11
11
|
class Builder
|
12
12
|
attr_reader :entries
|
13
13
|
|
@@ -15,7 +15,7 @@ module OpenTelemetry
|
|
15
15
|
@entries = entries
|
16
16
|
end
|
17
17
|
|
18
|
-
# Set key-value in the to-be-created
|
18
|
+
# Set key-value in the to-be-created baggage
|
19
19
|
#
|
20
20
|
# @param [String] key The key to store this value under
|
21
21
|
# @param [String] value String value to be stored under key
|
@@ -23,14 +23,14 @@ module OpenTelemetry
|
|
23
23
|
@entries[key] = value.to_s
|
24
24
|
end
|
25
25
|
|
26
|
-
# Removes key from the to-be-created
|
26
|
+
# Removes key from the to-be-created baggage
|
27
27
|
#
|
28
28
|
# @param [String] key The key to remove
|
29
29
|
def remove_value(key)
|
30
30
|
@entries.delete(key)
|
31
31
|
end
|
32
32
|
|
33
|
-
# Clears all
|
33
|
+
# Clears all baggage from the to-be-created baggage
|
34
34
|
def clear
|
35
35
|
@entries.clear
|
36
36
|
end
|
@@ -6,38 +6,38 @@
|
|
6
6
|
|
7
7
|
module OpenTelemetry
|
8
8
|
module SDK
|
9
|
-
module
|
10
|
-
# Manages
|
9
|
+
module Baggage
|
10
|
+
# Manages baggage
|
11
11
|
class Manager
|
12
|
-
|
13
|
-
|
14
|
-
private_constant(:
|
12
|
+
BAGGAGE_KEY = OpenTelemetry::Baggage::Propagation::ContextKeys.baggage_key
|
13
|
+
EMPTY_BAGGAGE = {}.freeze
|
14
|
+
private_constant(:BAGGAGE_KEY, :EMPTY_BAGGAGE)
|
15
15
|
|
16
|
-
# Used to chain modifications to
|
17
|
-
# context with an updated
|
18
|
-
# modification is being made to
|
16
|
+
# Used to chain modifications to baggage. The result is a
|
17
|
+
# context with an updated baggage. If only a single
|
18
|
+
# modification is being made to baggage, use the other
|
19
19
|
# methods on +Manager+, if multiple modifications are being made, use
|
20
20
|
# this one.
|
21
21
|
#
|
22
22
|
# @param [optional Context] context The context to update with with new
|
23
|
-
# modified
|
23
|
+
# modified baggage. Defaults to +Context.current+
|
24
24
|
# @return [Context]
|
25
25
|
def build_context(context: Context.current)
|
26
|
-
builder = Builder.new(
|
26
|
+
builder = Builder.new(baggage_for(context).dup)
|
27
27
|
yield builder
|
28
|
-
context.set_value(
|
28
|
+
context.set_value(BAGGAGE_KEY, builder.entries)
|
29
29
|
end
|
30
30
|
|
31
|
-
# Returns a new context with empty
|
31
|
+
# Returns a new context with empty baggage
|
32
32
|
#
|
33
|
-
# @param [optional Context] context Context to clear
|
33
|
+
# @param [optional Context] context Context to clear baggage from. Defaults
|
34
34
|
# to +Context.current+
|
35
35
|
# @return [Context]
|
36
36
|
def clear(context: Context.current)
|
37
|
-
context.set_value(
|
37
|
+
context.set_value(BAGGAGE_KEY, EMPTY_BAGGAGE)
|
38
38
|
end
|
39
39
|
|
40
|
-
# Returns the corresponding
|
40
|
+
# Returns the corresponding baggage value (or nil) for key
|
41
41
|
#
|
42
42
|
# @param [String] key The lookup key
|
43
43
|
# @param [optional Context] context The context from which to retrieve
|
@@ -45,7 +45,17 @@ module OpenTelemetry
|
|
45
45
|
# Defaults to +Context.current+
|
46
46
|
# @return [String]
|
47
47
|
def value(key, context: Context.current)
|
48
|
-
|
48
|
+
baggage_for(context)[key]
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns the baggage
|
52
|
+
#
|
53
|
+
# @param [optional Context] context The context from which to retrieve
|
54
|
+
# the baggage.
|
55
|
+
# Defaults to +Context.current+
|
56
|
+
# @return [Hash]
|
57
|
+
def values(context: Context.current)
|
58
|
+
baggage_for(context).dup.freeze
|
49
59
|
end
|
50
60
|
|
51
61
|
# Returns a new context with new key-value pair
|
@@ -56,30 +66,30 @@ module OpenTelemetry
|
|
56
66
|
# value. Defaults to +Context.current+
|
57
67
|
# @return [Context]
|
58
68
|
def set_value(key, value, context: Context.current)
|
59
|
-
|
60
|
-
|
61
|
-
context.set_value(
|
69
|
+
new_baggage = baggage_for(context).dup
|
70
|
+
new_baggage[key] = value
|
71
|
+
context.set_value(BAGGAGE_KEY, new_baggage)
|
62
72
|
end
|
63
73
|
|
64
74
|
# Returns a new context with value at key removed
|
65
75
|
#
|
66
76
|
# @param [String] key The key to remove
|
67
|
-
# @param [optional Context] context The context to remove
|
77
|
+
# @param [optional Context] context The context to remove baggage
|
68
78
|
# from. Defaults to +Context.current+
|
69
79
|
# @return [Context]
|
70
80
|
def remove_value(key, context: Context.current)
|
71
|
-
|
72
|
-
return context unless
|
81
|
+
baggage = baggage_for(context)
|
82
|
+
return context unless baggage.key?(key)
|
73
83
|
|
74
|
-
|
75
|
-
|
76
|
-
context.set_value(
|
84
|
+
new_baggage = baggage.dup
|
85
|
+
new_baggage.delete(key)
|
86
|
+
context.set_value(BAGGAGE_KEY, new_baggage)
|
77
87
|
end
|
78
88
|
|
79
89
|
private
|
80
90
|
|
81
|
-
def
|
82
|
-
context.value(
|
91
|
+
def baggage_for(context)
|
92
|
+
context.value(BAGGAGE_KEY) || EMPTY_BAGGAGE
|
83
93
|
end
|
84
94
|
end
|
85
95
|
end
|
@@ -8,63 +8,93 @@ module OpenTelemetry
|
|
8
8
|
module SDK
|
9
9
|
# The configurator provides defaults and facilitates configuring the
|
10
10
|
# SDK for use.
|
11
|
-
class Configurator
|
11
|
+
class Configurator # rubocop:disable Metrics/ClassLength
|
12
12
|
USE_MODE_UNSPECIFIED = 0
|
13
13
|
USE_MODE_ONE = 1
|
14
14
|
USE_MODE_ALL = 2
|
15
15
|
|
16
16
|
private_constant :USE_MODE_UNSPECIFIED, :USE_MODE_ONE, :USE_MODE_ALL
|
17
17
|
|
18
|
-
attr_writer :logger, :http_extractors, :http_injectors, :
|
19
|
-
:
|
18
|
+
attr_writer :logger, :http_extractors, :http_injectors, :text_map_extractors,
|
19
|
+
:text_map_injectors
|
20
20
|
|
21
21
|
def initialize
|
22
|
-
@
|
23
|
-
@
|
22
|
+
@instrumentation_names = []
|
23
|
+
@instrumentation_config_map = {}
|
24
24
|
@http_extractors = nil
|
25
25
|
@http_injectors = nil
|
26
|
-
@
|
27
|
-
@
|
26
|
+
@text_map_extractors = nil
|
27
|
+
@text_map_injectors = nil
|
28
28
|
@span_processors = []
|
29
29
|
@use_mode = USE_MODE_UNSPECIFIED
|
30
|
-
@
|
30
|
+
@resource = Resources::Resource.telemetry_sdk
|
31
31
|
end
|
32
32
|
|
33
33
|
def logger
|
34
|
-
@logger ||=
|
34
|
+
@logger ||= OpenTelemetry.logger
|
35
35
|
end
|
36
36
|
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
37
|
+
# Accepts a resource object that is merged with the default telemetry sdk
|
38
|
+
# resource. The use of this method is optional, and is provided as means
|
39
|
+
# to include additional resource information.
|
40
|
+
# If a resource key collision occurs the passed in resource takes priority.
|
41
|
+
#
|
42
|
+
# @param [Resource] new_resource The resource to be merged
|
43
|
+
def resource=(new_resource)
|
44
|
+
@resource = new_resource.merge(@resource)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Accepts a string that is merged in as the service.name resource attribute.
|
48
|
+
# The most recent assigned value will be used in the event of repeated
|
49
|
+
# calls to this setter.
|
50
|
+
# @param [String] service_name The value to be used as the service name
|
51
|
+
def service_name=(service_name)
|
52
|
+
@resource = OpenTelemetry::SDK::Resources::Resource.create(
|
53
|
+
OpenTelemetry::SDK::Resources::Constants::SERVICE_RESOURCE[:name] => service_name
|
54
|
+
).merge(@resource)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Accepts a string that is merged in as the service.version resource attribute.
|
58
|
+
# The most recent assigned value will be used in the event of repeated
|
59
|
+
# calls to this setter.
|
60
|
+
# @param [String] service_version The value to be used as the service version
|
61
|
+
def service_version=(service_version)
|
62
|
+
@resource = OpenTelemetry::SDK::Resources::Resource.create(
|
63
|
+
OpenTelemetry::SDK::Resources::Constants::SERVICE_RESOURCE[:version] => service_version
|
64
|
+
).merge(@resource)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Install an instrumentation with specificied optional +config+.
|
68
|
+
# Use can be called multiple times to install multiple instrumentation.
|
69
|
+
# Only +use+ or +use_all+, but not both when installing
|
40
70
|
# instrumentation. A call to +use_all+ after +use+ will result in an
|
41
71
|
# exception.
|
42
72
|
#
|
43
|
-
# @param [String]
|
44
|
-
# @param [optional Hash] config The config for this
|
45
|
-
def use(
|
73
|
+
# @param [String] instrumentation_name The name of the instrumentation
|
74
|
+
# @param [optional Hash] config The config for this instrumentation
|
75
|
+
def use(instrumentation_name, config = nil)
|
46
76
|
check_use_mode!(USE_MODE_ONE)
|
47
|
-
@
|
48
|
-
@
|
77
|
+
@instrumentation_names << instrumentation_name
|
78
|
+
@instrumentation_config_map[instrumentation_name] = config if config
|
49
79
|
end
|
50
80
|
|
51
81
|
# Install all registered instrumentation. Configuration for specific
|
52
|
-
#
|
82
|
+
# instrumentation can be provided with the optional +instrumentation_config_map+
|
53
83
|
# parameter. Only +use+ or +use_all+, but not both when installing
|
54
84
|
# instrumentation. A call to +use+ after +use_all+ will result in an
|
55
85
|
# exception.
|
56
86
|
#
|
57
|
-
# @param [optional Hash<String,Hash>]
|
58
|
-
# representing the
|
59
|
-
def use_all(
|
87
|
+
# @param [optional Hash<String,Hash>] instrumentation_config_map A map with string keys
|
88
|
+
# representing the instrumentation name and values specifying the instrumentation config
|
89
|
+
def use_all(instrumentation_config_map = {})
|
60
90
|
check_use_mode!(USE_MODE_ALL)
|
61
|
-
@
|
91
|
+
@instrumentation_config_map = instrumentation_config_map
|
62
92
|
end
|
63
93
|
|
64
94
|
# Add a span processor to the export pipeline
|
65
95
|
#
|
66
|
-
# @param [#on_start, #on_finish, #shutdown] span_processor A span_processor
|
67
|
-
# that satisfies the duck type #on_start, #on_finish, #shutdown. See
|
96
|
+
# @param [#on_start, #on_finish, #shutdown, #force_flush] span_processor A span_processor
|
97
|
+
# that satisfies the duck type #on_start, #on_finish, #shutdown, #force_flush. See
|
68
98
|
# {SimpleSpanProcessor} for an example.
|
69
99
|
def add_span_processor(span_processor)
|
70
100
|
@span_processors << span_processor
|
@@ -80,15 +110,19 @@ module OpenTelemetry
|
|
80
110
|
# - install instrumentation
|
81
111
|
def configure
|
82
112
|
OpenTelemetry.logger = logger
|
83
|
-
OpenTelemetry.
|
113
|
+
OpenTelemetry.baggage = Baggage::Manager.new
|
84
114
|
configure_propagation
|
85
115
|
configure_span_processors
|
86
|
-
OpenTelemetry.tracer_provider =
|
116
|
+
OpenTelemetry.tracer_provider = tracer_provider
|
87
117
|
install_instrumentation
|
88
118
|
end
|
89
119
|
|
90
120
|
private
|
91
121
|
|
122
|
+
def tracer_provider
|
123
|
+
@tracer_provider ||= Trace::TracerProvider.new(@resource)
|
124
|
+
end
|
125
|
+
|
92
126
|
def check_use_mode!(mode)
|
93
127
|
@use_mode = mode if @use_mode == USE_MODE_UNSPECIFIED
|
94
128
|
raise 'Use either `use_all` or `use`, but not both' unless @use_mode == mode
|
@@ -97,15 +131,15 @@ module OpenTelemetry
|
|
97
131
|
def install_instrumentation
|
98
132
|
case @use_mode
|
99
133
|
when USE_MODE_ONE
|
100
|
-
OpenTelemetry.instrumentation_registry.install(@
|
134
|
+
OpenTelemetry.instrumentation_registry.install(@instrumentation_names, @instrumentation_config_map)
|
101
135
|
when USE_MODE_ALL
|
102
|
-
OpenTelemetry.instrumentation_registry.install_all(@
|
136
|
+
OpenTelemetry.instrumentation_registry.install_all(@instrumentation_config_map)
|
103
137
|
end
|
104
138
|
end
|
105
139
|
|
106
140
|
def configure_span_processors
|
107
141
|
processors = @span_processors.empty? ? [default_span_processor] : @span_processors
|
108
|
-
processors.each { |p|
|
142
|
+
processors.each { |p| tracer_provider.add_span_processor(p) }
|
109
143
|
end
|
110
144
|
|
111
145
|
def default_span_processor
|
@@ -117,8 +151,8 @@ module OpenTelemetry
|
|
117
151
|
def configure_propagation
|
118
152
|
OpenTelemetry.propagation.http = create_propagator(@http_injectors || default_http_injectors,
|
119
153
|
@http_extractors || default_http_extractors)
|
120
|
-
OpenTelemetry.propagation.text = create_propagator(@
|
121
|
-
@
|
154
|
+
OpenTelemetry.propagation.text = create_propagator(@text_map_injectors || default_text_map_injectors,
|
155
|
+
@text_map_extractors || default_text_map_extractors)
|
122
156
|
end
|
123
157
|
|
124
158
|
def create_propagator(injectors, extractors)
|
@@ -130,27 +164,27 @@ module OpenTelemetry
|
|
130
164
|
end
|
131
165
|
|
132
166
|
def default_http_injectors
|
133
|
-
|
167
|
+
default_text_map_injectors
|
134
168
|
end
|
135
169
|
|
136
170
|
def default_http_extractors
|
137
171
|
[
|
138
172
|
OpenTelemetry::Trace::Propagation::TraceContext.rack_extractor,
|
139
|
-
OpenTelemetry::
|
173
|
+
OpenTelemetry::Baggage::Propagation.rack_extractor
|
140
174
|
]
|
141
175
|
end
|
142
176
|
|
143
|
-
def
|
177
|
+
def default_text_map_injectors
|
144
178
|
[
|
145
|
-
OpenTelemetry::Trace::Propagation::TraceContext.
|
146
|
-
OpenTelemetry::
|
179
|
+
OpenTelemetry::Trace::Propagation::TraceContext.text_map_injector,
|
180
|
+
OpenTelemetry::Baggage::Propagation.text_map_injector
|
147
181
|
]
|
148
182
|
end
|
149
183
|
|
150
|
-
def
|
184
|
+
def default_text_map_extractors
|
151
185
|
[
|
152
|
-
OpenTelemetry::Trace::Propagation::TraceContext.
|
153
|
-
OpenTelemetry::
|
186
|
+
OpenTelemetry::Trace::Propagation::TraceContext.text_map_extractor,
|
187
|
+
OpenTelemetry::Baggage::Propagation.text_map_extractor
|
154
188
|
]
|
155
189
|
end
|
156
190
|
end
|