instana 2.7.1 → 2.7.2
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/lib/instana/instrumentation/action_cable.rb +7 -1
- data/lib/instana/instrumentation/grpc.rb +1 -1
- data/lib/instana/instrumentation/net-http.rb +1 -1
- data/lib/instana/instrumentation/rack.rb +1 -1
- data/lib/instana/samplers/samplers.rb +4 -1
- data/lib/instana/trace/tracer.rb +3 -1
- data/lib/instana/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75c9fe7c6b744ebafc10428dbbfdcfe046fdcfc80b31227b29b4a18ade7ec5dd
|
|
4
|
+
data.tar.gz: 94b10d48f251f49157203534306399fed404adf619318cdebb0ff1864a74fc41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56ff7ee602ef57a060bc1e467e11dc5466469433c54abc6457bb1959c4f5abf82d491b5db272b4cf45bea72335c28a0b9213357c44bf90543c123d424743f9f7
|
|
7
|
+
data.tar.gz: 811b2bd02833ec5127fdfeee050cab1ce3c1410e120ecd4452c41207b4c7a4fbc11f390ba8a62181f7a56fd3cd073392ca5115a68bfeb3a200f84ad5812a8ba7
|
|
@@ -9,7 +9,13 @@ module Instana
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def process
|
|
12
|
-
|
|
12
|
+
# Wrapped in non_recording_span by the channel callbacks below, so it
|
|
13
|
+
# must be a SpanContext.
|
|
14
|
+
@instana_trace_context ||= if ::Instana.tracer.tracing?
|
|
15
|
+
::Instana.tracer.current_span.context
|
|
16
|
+
else
|
|
17
|
+
OpenTelemetry::Trace::SpanContext::INVALID
|
|
18
|
+
end
|
|
13
19
|
super
|
|
14
20
|
end
|
|
15
21
|
end
|
|
@@ -58,7 +58,7 @@ module Instana
|
|
|
58
58
|
kvs = { rpc: {} }
|
|
59
59
|
metadata = active_call.metadata
|
|
60
60
|
|
|
61
|
-
incoming_context =
|
|
61
|
+
incoming_context = nil
|
|
62
62
|
if metadata.key?('x-instana-t')
|
|
63
63
|
incoming_context = SpanContext.new(trace_id: ::Instana::Util.header_to_id(metadata['x-instana-t']),
|
|
64
64
|
span_id: metadata.key?('x-instana-s') ? ::Instana::Util.header_to_id(metadata['x-instana-s']) : nil,
|
|
@@ -57,7 +57,7 @@ module Instana
|
|
|
57
57
|
current_span.record_exception(nil)
|
|
58
58
|
end
|
|
59
59
|
extra_headers = ::Instana::Util.extra_header_tags(response)&.merge(::Instana::Util.extra_header_tags(request))
|
|
60
|
-
kv_payload[:http][:header] = extra_headers unless extra_headers
|
|
60
|
+
kv_payload[:http][:header] = extra_headers unless extra_headers && extra_headers.empty?
|
|
61
61
|
response
|
|
62
62
|
rescue => e
|
|
63
63
|
current_span&.record_exception(e)
|
|
@@ -34,6 +34,7 @@ module Instana
|
|
|
34
34
|
raise
|
|
35
35
|
ensure
|
|
36
36
|
finalize_trace(current_span, kvs, headers, trace_context) if ::Instana.tracer.tracing?
|
|
37
|
+
OpenTelemetry::Context.detach(@trace_token) if @trace_token
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
private
|
|
@@ -123,7 +124,6 @@ module Instana
|
|
|
123
124
|
def finalize_trace(current_span, kvs, headers, trace_context)
|
|
124
125
|
set_response_headers(headers, trace_context) if headers
|
|
125
126
|
current_span.add_attributes(kvs)
|
|
126
|
-
OpenTelemetry::Context.detach(@trace_token) if @trace_token
|
|
127
127
|
current_span.finish
|
|
128
128
|
end
|
|
129
129
|
|
|
@@ -68,7 +68,10 @@ module Instana
|
|
|
68
68
|
|
|
69
69
|
def self.should_sample?(trace_id:, parent_context:, links:, name:, kind:, attributes:) # rubocop:disable Metrics/ParameterLists, Lint/UnusedMethodArgument:
|
|
70
70
|
parent_span_context = OpenTelemetry::Trace.current_span(parent_context).context
|
|
71
|
-
|
|
71
|
+
# Parents wrapped in non_recording_span can expose a non-SpanContext
|
|
72
|
+
# #context; the new span's SpanContext needs a Tracestate, never nil.
|
|
73
|
+
tracestate = parent_span_context.tracestate if parent_span_context.respond_to?(:tracestate)
|
|
74
|
+
tracestate ||= OpenTelemetry::Trace::Tracestate::DEFAULT
|
|
72
75
|
Result.new(decision: :__record_only__, tracestate: tracestate)
|
|
73
76
|
end
|
|
74
77
|
end
|
data/lib/instana/trace/tracer.rb
CHANGED
|
@@ -323,7 +323,9 @@ module Instana
|
|
|
323
323
|
# with_parent=current context, start_timestamp=current time.
|
|
324
324
|
#
|
|
325
325
|
def start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: ::Instana::Util.now_in_ms, kind: nil) # rubocop:disable Metrics/ParameterLists
|
|
326
|
-
|
|
326
|
+
# The placeholder's #context is read back as the parent by the next span
|
|
327
|
+
# start, so it must be a SpanContext (INVALID when there is no parent).
|
|
328
|
+
return Instana::Trace.non_recording_span(OpenTelemetry::Trace.current_span(with_parent).context) if !::Instana.agent.ready? || !::Instana.config[:tracing][:enabled]
|
|
327
329
|
|
|
328
330
|
with_parent ||= OpenTelemetry::Context.current
|
|
329
331
|
name ||= 'empty'
|
data/lib/instana/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: instana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.7.
|
|
4
|
+
version: 2.7.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Giacomo Lombardo
|
|
@@ -93,6 +93,20 @@ dependencies:
|
|
|
93
93
|
- - ">="
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: '0'
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: rack
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0'
|
|
103
|
+
type: :development
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
96
110
|
- !ruby/object:Gem::Dependency
|
|
97
111
|
name: base64
|
|
98
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -362,7 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
362
376
|
- !ruby/object:Gem::Version
|
|
363
377
|
version: '0'
|
|
364
378
|
requirements: []
|
|
365
|
-
rubygems_version: 4.0.
|
|
379
|
+
rubygems_version: 4.0.16
|
|
366
380
|
specification_version: 4
|
|
367
381
|
summary: Ruby Distributed Tracing & Metrics Sensor for Instana
|
|
368
382
|
test_files: []
|