opentelemetry-instrumentation-rack 0.24.6 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e18717dabce66a13cf0dbbb14f53820e8cd76758a4b27680db3d2b21cbb9318
4
- data.tar.gz: 0671d5f2dbddef0466ceea1f1c81a207063a2a4b201c015b1dc1ee671d9b877a
3
+ metadata.gz: a865f794a7c18421be44c072dfdc65578b51dc3ad170e0faefd2587518095e15
4
+ data.tar.gz: 16f97bd4b562f2a9acaba5194ab6286ab3739f254e7ffdbd20118c1106df5709
5
5
  SHA512:
6
- metadata.gz: 720c682e663bdb55bf01c5b1ddc37c704dd0b8173f4e6bb89d6c7a6d5d6a64557b9abc869bc516cfda7f441a8d359f4a2a5fa472ec3299340429330f55428055
7
- data.tar.gz: 1fa48af98fc0c4222f6c6449e291244f8362fa5d7ef7a26d722dd41bcaceb05c41f1735c5c7efaebd0b54a5e31b06d020c823bd1e95af49c0a00d1707e2e47b7
6
+ metadata.gz: 73da5cbf40d89c2f717969dc37afd9c34e1268655cf64652310c78e364ad49619c755d9696f789ec1afb74454fb32f9ba043e9b804b1d79de61bafb72d4766ed
7
+ data.tar.gz: 061e53e1e43ed1f0df6499976b8b75cf7927f2edc200b9773ae1efa59973cb2844470af4a312ca00d15f0badb5d712a538473aed83bef3e19b1b9064d52b65dc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-rack
2
2
 
3
+ ### v0.25.0 / 2024-10-23
4
+
5
+ * ADDED: Set span error only for 5xx response range
6
+
3
7
  ### v0.24.6 / 2024-07-23
4
8
 
5
9
  * DOCS: Add cspell to CI
data/README.md CHANGED
@@ -6,7 +6,7 @@ The Rack instrumentation is a community-maintained instrumentation for the [Rack
6
6
 
7
7
  Install the gem using:
8
8
 
9
- ```
9
+ ```console
10
10
  gem install opentelemetry-instrumentation-rack
11
11
  ```
12
12
 
@@ -67,7 +67,7 @@ By default we will set the rack span name to match the format "HTTP #{method}" (
67
67
 
68
68
  We surface a hook to easily retrieve the rack span within the context of a request so that you can add information to or rename your server span.
69
69
 
70
- This is how the rails controller instrumentation is able to rename the span names to match the controller and action that process the request. See https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/patches/action_controller/metal.rb#L15-L16 for an example.
70
+ This is how the rails controller instrumentation is able to rename the span names to match the controller and action that process the request. See <https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/opentelemetry-instrumentation-action_pack/v0.9.0/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb#L29> for an example.
71
71
 
72
72
  ### High cardinality example
73
73
 
@@ -87,7 +87,7 @@ Example usage can be seen in the `./example/trace_demonstration.rb` file [here](
87
87
 
88
88
  The `opentelemetry-instrumentation-rack` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
89
89
 
90
- The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us in [GitHub Discussions][discussions-url] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
90
+ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special interest group (SIG). You can get involved by joining us on our [GitHub Discussions][discussions-url], [Slack Channel][slack-channel] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
91
91
 
92
92
  ## License
93
93
 
@@ -99,4 +99,5 @@ The `opentelemetry-instrumentation-rack` gem is distributed under the Apache 2.0
99
99
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE
100
100
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
101
101
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
102
+ [slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY
102
103
  [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -43,7 +43,6 @@ module OpenTelemetry
43
43
  include ::Rack::Events::Abstract
44
44
 
45
45
  OTEL_TOKEN_AND_SPAN = 'otel.rack.token_and_span'
46
- GOOD_HTTP_STATUSES = (100..499)
47
46
 
48
47
  # Creates a server span for this current request using the incoming parent context
49
48
  # and registers them as the {current_span}
@@ -208,7 +207,7 @@ module OpenTelemetry
208
207
  end
209
208
 
210
209
  def add_response_attributes(span, response)
211
- span.status = OpenTelemetry::Trace::Status.error unless GOOD_HTTP_STATUSES.include?(response.status.to_i)
210
+ span.status = OpenTelemetry::Trace::Status.error if response.server_error?
212
211
  attributes = extract_response_attributes(response)
213
212
  span.add_attributes(attributes)
214
213
  rescue StandardError => e
@@ -152,7 +152,7 @@ module OpenTelemetry
152
152
  end
153
153
 
154
154
  def set_attributes_after_request(span, status, headers, _response)
155
- span.status = OpenTelemetry::Trace::Status.error unless (100..499).cover?(status.to_i)
155
+ span.status = OpenTelemetry::Trace::Status.error if (500..599).cover?(status.to_i)
156
156
  span.set_attribute('http.status_code', status)
157
157
 
158
158
  # NOTE: if data is available, it would be good to do this:
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Rack
10
- VERSION = '0.24.6'
10
+ VERSION = '0.25.0'
11
11
  end
12
12
  end
13
13
  end
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.6
4
+ version: 0.25.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: 2024-07-24 00:00:00.000000000 Z
11
+ date: 2024-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -156,28 +156,28 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.65.0
159
+ version: 1.66.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.65.0
166
+ version: 1.66.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubocop-performance
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '1.20'
173
+ version: 1.22.0
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '1.20'
180
+ version: 1.22.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: simplecov
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '3.19'
201
+ version: 3.24.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: '3.19'
208
+ version: 3.24.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: yard
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -244,10 +244,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
244
244
  licenses:
245
245
  - Apache-2.0
246
246
  metadata:
247
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.6/file/CHANGELOG.md
247
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.25.0/file/CHANGELOG.md
248
248
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/rack
249
249
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
250
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.24.6
250
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-rack/0.25.0
251
251
  post_install_message:
252
252
  rdoc_options: []
253
253
  require_paths: