opentelemetry-instrumentation-rack 0.24.2 → 0.24.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce07b0f6a44bd97b178e213c298bb798de5db2f7e91496e38d3a8f8a75e18516
|
4
|
+
data.tar.gz: df6a2ed4bd011c2aa5fdc50ae986620670100d64f59501f16036ca9136b74944
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8024e212d2088b35d2b91f95ed917cbaa061a05f90274d690d8ef74bbbb312acdbb8f08257fb3deed5106ebebb0ed67748c1ac3ad42b33550412d95c2ce632be
|
7
|
+
data.tar.gz: 4cc04477eb0f189dfe64e5110edf9926e0e8d6b67fa8b60c630f5ed12cce607282aef36f7ab48524c443f1de51b4077eba80b520775ea07883b9ed6e9a71b10b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-rack
|
2
2
|
|
3
|
+
### v0.24.4 / 2024-05-09
|
4
|
+
|
5
|
+
* FIXED: Untrace entire request
|
6
|
+
|
7
|
+
### v0.24.3 / 2024-05-08
|
8
|
+
|
9
|
+
* FIXED: Rack event baggage handling
|
10
|
+
|
3
11
|
### v0.24.2 / 2024-04-30
|
4
12
|
|
5
13
|
* FIXED: Bundler conflict warnings
|
@@ -42,7 +42,7 @@ module OpenTelemetry
|
|
42
42
|
class EventHandler
|
43
43
|
include ::Rack::Events::Abstract
|
44
44
|
|
45
|
-
|
45
|
+
OTEL_TOKEN_AND_SPAN = 'otel.rack.token_and_span'
|
46
46
|
GOOD_HTTP_STATUSES = (100..499)
|
47
47
|
|
48
48
|
# Creates a server span for this current request using the incoming parent context
|
@@ -52,11 +52,16 @@ module OpenTelemetry
|
|
52
52
|
# @param [Rack::Response] This is nil in practice
|
53
53
|
# @return [void]
|
54
54
|
def on_start(request, _)
|
55
|
-
|
55
|
+
parent_context = if untraced_request?(request.env)
|
56
|
+
extract_remote_context(request, OpenTelemetry::Common::Utilities.untraced)
|
57
|
+
else
|
58
|
+
extract_remote_context(request)
|
59
|
+
end
|
56
60
|
|
57
|
-
parent_context = extract_remote_context(request)
|
58
61
|
span = create_span(parent_context, request)
|
59
|
-
|
62
|
+
span_ctx = OpenTelemetry::Trace.context_with_span(span, parent_context: parent_context)
|
63
|
+
rack_ctx = OpenTelemetry::Instrumentation::Rack.context_with_span(span, parent_context: span_ctx)
|
64
|
+
request.env[OTEL_TOKEN_AND_SPAN] = [OpenTelemetry::Context.attach(rack_ctx), span]
|
60
65
|
rescue StandardError => e
|
61
66
|
OpenTelemetry.handle_error(exception: e)
|
62
67
|
end
|
@@ -108,7 +113,7 @@ module OpenTelemetry
|
|
108
113
|
rescue StandardError => e
|
109
114
|
OpenTelemetry.handle_error(exception: e)
|
110
115
|
ensure
|
111
|
-
|
116
|
+
detach_context(request)
|
112
117
|
end
|
113
118
|
|
114
119
|
private
|
@@ -171,9 +176,10 @@ module OpenTelemetry
|
|
171
176
|
end
|
172
177
|
end
|
173
178
|
|
174
|
-
def extract_remote_context(request)
|
179
|
+
def extract_remote_context(request, context = Context.current)
|
175
180
|
OpenTelemetry.propagation.extract(
|
176
181
|
request.env,
|
182
|
+
context: context,
|
177
183
|
getter: OpenTelemetry::Common::Propagation.rack_env_getter
|
178
184
|
)
|
179
185
|
end
|
@@ -191,11 +197,12 @@ module OpenTelemetry
|
|
191
197
|
attributes
|
192
198
|
end
|
193
199
|
|
194
|
-
def
|
195
|
-
request.env[
|
196
|
-
|
197
|
-
|
198
|
-
|
200
|
+
def detach_context(request)
|
201
|
+
return nil unless request.env[OTEL_TOKEN_AND_SPAN]
|
202
|
+
|
203
|
+
token, span = request.env[OTEL_TOKEN_AND_SPAN]
|
204
|
+
span.finish
|
205
|
+
OpenTelemetry::Context.detach(token)
|
199
206
|
rescue StandardError => e
|
200
207
|
OpenTelemetry.handle_error(exception: e)
|
201
208
|
end
|
@@ -244,15 +251,6 @@ module OpenTelemetry
|
|
244
251
|
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.config
|
245
252
|
end
|
246
253
|
|
247
|
-
def register_current_span(span)
|
248
|
-
ctx = OpenTelemetry::Trace.context_with_span(span)
|
249
|
-
rack_ctx = OpenTelemetry::Instrumentation::Rack.context_with_span(span, parent_context: ctx)
|
250
|
-
|
251
|
-
contexts = [ctx, rack_ctx]
|
252
|
-
contexts.compact!
|
253
|
-
contexts.map { |context| OpenTelemetry::Context.attach(context) }
|
254
|
-
end
|
255
|
-
|
256
254
|
def create_span(parent_context, request)
|
257
255
|
span = tracer.start_span(
|
258
256
|
create_request_span_name(request),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-instrumentation-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.24.
|
4
|
+
version: 0.24.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.21.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.21.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: opentelemetry-instrumentation-base
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -258,10 +258,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
258
258
|
licenses:
|
259
259
|
- Apache-2.0
|
260
260
|
metadata:
|
261
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.
|
261
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.4/file/CHANGELOG.md
|
262
262
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/rack
|
263
263
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
264
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.
|
264
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.4
|
265
265
|
post_install_message:
|
266
266
|
rdoc_options: []
|
267
267
|
require_paths:
|