opentelemetry-instrumentation-rack 0.23.5 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +17 -0
- data/lib/opentelemetry/instrumentation/rack/instrumentation.rb +2 -2
- data/lib/opentelemetry/instrumentation/rack/middlewares/event_handler.rb +1 -1
- data/lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb +2 -0
- data/lib/opentelemetry/instrumentation/rack/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d11de07129115be6b9af9347c3893327ea18c58b959fe761c86f1eabc94402eb
|
4
|
+
data.tar.gz: 27cf79e4ab1bdd60c76a90824da839948deab41ee9d9cc8eb5b4d151cb1abc2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c6330ea8a52a55c20e7b62cb6864c784993b7b3a8209ad41812904992d003e8c38d6f9c62096d3cf25c343fea0abf722c5cf978ccc2a826cefbbb4fabd208a5
|
7
|
+
data.tar.gz: 87f30078bd1ee4a8c595048754210ecf82d65f7a2d2eb3738f82138a3631faa3dc8108de9beb0ae8840a1fbf7f546fd112a8c03b435bef078315f79e0d6a82f2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-rack
|
2
2
|
|
3
|
+
### v0.24.0 / 2024-01-06
|
4
|
+
|
5
|
+
* BREAKING CHANGE: Use Rack Events By Default
|
6
|
+
|
7
|
+
* ADDED: Use Rack Events By Default
|
8
|
+
* FIXED: Backport Rack proxy event to middleware
|
9
|
+
|
3
10
|
### v0.23.5 / 2023-11-23
|
4
11
|
|
5
12
|
* CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
|
data/README.md
CHANGED
@@ -42,6 +42,23 @@ OpenTelemetry::SDK.configure do |c|
|
|
42
42
|
c.use_all
|
43
43
|
end
|
44
44
|
```
|
45
|
+
|
46
|
+
## Rack Middleware vs Rack Events
|
47
|
+
|
48
|
+
Since `v0.24.0`, this instrumentation uses `Rake::Events` as opposed to `Middleware` to support Requests that use Buffered Response Bodies.
|
49
|
+
|
50
|
+
If your application does not support `Rack::Events`, you may disable it by setting `use_rack_events: false`, e.g.
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
OpenTelemetry::SDK.configure do |c|
|
54
|
+
c.use 'OpenTelemetry::Instrumentation::Rack', use_rack_events: false
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
This will switch to using `Rack::Middleware` by default in dependent instrumentations.
|
59
|
+
|
60
|
+
See [#342](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/342) for more details.
|
61
|
+
|
45
62
|
## Controlling span name cardinality
|
46
63
|
|
47
64
|
By default we will set the rack span name to match the format "HTTP #{method}" (ie. HTTP GET). There are different ways to control span names with this instrumentation.
|
@@ -28,8 +28,8 @@ module OpenTelemetry
|
|
28
28
|
option :url_quantization, default: nil, validate: :callable
|
29
29
|
option :untraced_requests, default: nil, validate: :callable
|
30
30
|
option :response_propagators, default: [], validate: :array
|
31
|
-
# This option is only valid for
|
32
|
-
option :use_rack_events, default:
|
31
|
+
# This option is only valid for applications using Rack 2.0 or greater
|
32
|
+
option :use_rack_events, default: true, validate: :boolean
|
33
33
|
|
34
34
|
# Temporary Helper for Sinatra and ActionPack middleware to use during installation
|
35
35
|
#
|
@@ -90,7 +90,7 @@ module OpenTelemetry
|
|
90
90
|
return unless span.recording?
|
91
91
|
|
92
92
|
span.record_exception(error)
|
93
|
-
span.status = OpenTelemetry::Trace::Status.error
|
93
|
+
span.status = OpenTelemetry::Trace::Status.error(error.class.name)
|
94
94
|
rescue StandardError => e
|
95
95
|
OpenTelemetry.handle_error(exception: e)
|
96
96
|
end
|
@@ -77,6 +77,8 @@ module OpenTelemetry
|
|
77
77
|
tracer.in_span(request_span_name,
|
78
78
|
attributes: request_span_attributes(env: env),
|
79
79
|
kind: request_span_kind) do |request_span|
|
80
|
+
request_start_time = OpenTelemetry::Instrumentation::Rack::Util::QueueTime.get_request_start(env)
|
81
|
+
request_span.add_event('http.proxy.request.started', timestamp: request_start_time) unless request_start_time.nil?
|
80
82
|
OpenTelemetry::Instrumentation::Rack.with_span(request_span) do
|
81
83
|
@app.call(env).tap do |status, headers, response|
|
82
84
|
set_attributes_after_request(request_span, status, headers, response)
|
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.
|
4
|
+
version: 0.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -198,14 +198,14 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: 1.
|
201
|
+
version: 1.59.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: 1.
|
208
|
+
version: 1.59.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: rubocop-performance
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -286,10 +286,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
286
286
|
licenses:
|
287
287
|
- Apache-2.0
|
288
288
|
metadata:
|
289
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.
|
289
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.0/file/CHANGELOG.md
|
290
290
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/rack
|
291
291
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
292
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.
|
292
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.0
|
293
293
|
post_install_message:
|
294
294
|
rdoc_options: []
|
295
295
|
require_paths:
|