@@ -17,11 +17,11 @@ module Baggage
17
17
# via propagation headers. If the external services also have a Baggage span
18
18
# processor, the keys and values will appear in those child spans as well.
19
19
#
20
- # ⚠ ⚠ ⚠ ️
20
+ # ⚠️
21
21
# To repeat: a consequence of adding data to Baggage is that the keys and
22
22
# values will appear in all outgoing HTTP headers from the application.
23
23
# Do not put sensitive information in Baggage.
24
- # ⚠ ⚠ ⚠ ️
24
+ # ⚠️
25
25
#
26
26
# @example
27
27
# OpenTelemetry::SDK.configure do |c|
@@ -41,33 +41,38 @@ module Baggage
41
41
# )
42
42
# end
43
43
class BaggageSpanProcessor
44
- # Called when a { Span} is started, adds Baggage keys/values to the span as attributes.
44
+ # Called when a ` Span` is started, adds Baggage keys/values to the span as attributes.
45
45
#
46
- # @param [Span] span the { Span} that just started, expected to conform
47
- # to the concrete { Span} interface from the SDK and respond to :add_attributes.
48
- # @param [Context] parent_context the parent { Context} of the newly
46
+ # @param [Span] span the ` Span` that just started, expected to conform
47
+ # to the concrete ` Span` interface from the SDK and respond to :add_attributes.
48
+ # @param [Context] parent_context the parent ` Context` of the newly
49
49
# started span.
50
50
def on_start ( span , parent_context )
51
51
return unless span . respond_to? ( :add_attributes ) && parent_context . is_a? ( ::OpenTelemetry ::Context )
52
52
53
53
span . add_attributes ( ::OpenTelemetry ::Baggage . values ( context : parent_context ) )
54
54
end
55
55
56
+ # Called when a Span is ended, does nothing.
57
+ #
56
58
# NO-OP method to satisfy the SpanProcessor duck type.
57
59
#
58
- # @param [Span] span the {Span} that just ended.
60
+ # @param [Span] span the {OpenTelemetry::Trace:: Span} that just ended.
59
61
def on_finish ( span ) ; end
60
62
61
- # Export all ended spans to the configured `Exporter` that have not yet
62
- # been exported.
63
+ # Always successful; this processor does not maintain any state to flush.
64
+ #
65
+ # NO-OP method to satisfy the `SpanProcessor` duck type.
63
66
#
64
67
# @param [optional Numeric] timeout An optional timeout in seconds.
65
68
# @return [Integer] 0 for success and there is nothing to flush so always successful.
66
69
def force_flush ( timeout : nil )
67
70
0
68
71
end
69
72
70
- # Called when {TracerProvider#shutdown} is called.
73
+ # Always successful; this processor does not maintain any state to clean up or processes to close on shutdown.
74
+ #
75
+ # NO-OP method to satisfy the `SpanProcessor` duck type.
71
76
#
72
77
# @param [optional Numeric] timeout An optional timeout in seconds.
73
78
# @return [Integer] 0 for success and there is nothing to stop so always successful.
0 commit comments