opentelemetry-instrumentation-sinatra 0.21.4 → 0.22.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: 85b1b440635f35ac1e5bc03c523595be638bb891410583e0a187b4383f2a6fd3
4
- data.tar.gz: 271f907ceada618172ba071a1233c7ab6bea435088576c8a6a7851156eaadf49
3
+ metadata.gz: d81ed74253be43b2799ed45b484cc65082c1a448a748283f2a277ee94a4f2a00
4
+ data.tar.gz: 63153a18bbf89e1532a7f75b9402fda81d7d77cc5424b878a2c6b8d5514a99a0
5
5
  SHA512:
6
- metadata.gz: 6a80a8025ec62917cc02e837195e8ce986986598a8ca3e32a1c53f9858a2ae5f18d5d958aa74b133592bd5ece74731673c37605b237c66c27146ea5116399f09
7
- data.tar.gz: 3e3a1ee118b6befbe56f510e0c6b1befa2692c4aab7c16050a3de8e04a145f5855d5628042eb23b250b9a9a1d4a925b6f0933384a72fc7e0911bc2c716775092
6
+ metadata.gz: c209d38b7697b322bd2ff99ec2e5325fd123b1f2cde0739e4cfd47c126ae4cfefd24917b6fb38c935145ca1384d75755f73cfefc2f6877dfba78915291d24d5a
7
+ data.tar.gz: b27297713319a71eefffb23371b4e8361b61bcb7a67fb0f509c5e387a727a1c8bea3842afc0b7a4eb3054c8a526e1255ff8cb20e789e1d70eab9524520547697
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Release History: opentelemetry-instrumentation-sinatra
2
2
 
3
+ ### v0.22.0 / 2023-04-17
4
+
5
+ * BREAKING CHANGE: Drop support for EoL Ruby 2.7
6
+
7
+ * ADDED: Drop support for EoL Ruby 2.7
8
+
9
+ ### v0.21.5 / 2023-02-13
10
+
11
+ * FIXED: Add exceptions to sinatra spans, ruboproof test.
12
+
3
13
  ### v0.21.4 / 2023-02-08
4
14
 
5
15
  * CHANGED: incorrect error type being recorded when Sinatra route raises exception [#317](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/317)
@@ -16,17 +16,25 @@ module OpenTelemetry
16
16
  end
17
17
 
18
18
  def call(env)
19
- @app.call(env)
19
+ response = @app.call(env)
20
20
  ensure
21
- trace_response(env)
21
+ trace_response(env, response)
22
22
  end
23
23
 
24
- def trace_response(env)
24
+ def trace_response(env, response)
25
25
  span = OpenTelemetry::Instrumentation::Rack.current_span
26
26
  return unless span.recording?
27
27
 
28
28
  span.set_attribute('http.route', env['sinatra.route'].split.last) if env['sinatra.route']
29
29
  span.name = env['sinatra.route'] if env['sinatra.route']
30
+
31
+ return if response.nil?
32
+
33
+ sinatra_response = ::Sinatra::Response.new([], response.first)
34
+ return unless sinatra_response.server_error?
35
+
36
+ span.record_exception(env['sinatra.error']) if env['sinatra.error']
37
+ span.status = OpenTelemetry::Trace::Status.error
30
38
  end
31
39
  end
32
40
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Sinatra
10
- VERSION = '0.21.4'
10
+ VERSION = '0.22.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-sinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.4
4
+ version: 0.22.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: 2023-02-08 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.21.0
47
+ version: 0.22.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.21.0
54
+ version: 0.22.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: opentelemetry-instrumentation-rack
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: opentelemetry-test-helpers
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '0.3'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '0.3'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rack-test
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.41.1
159
+ version: 1.48.1
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.41.1
166
+ version: 1.48.1
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: simplecov
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -256,10 +256,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
256
256
  licenses:
257
257
  - Apache-2.0
258
258
  metadata:
259
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-sinatra/0.21.4/file/CHANGELOG.md
259
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-sinatra/0.22.0/file/CHANGELOG.md
260
260
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/sinatra
261
261
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
262
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-sinatra/0.21.4
262
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-sinatra/0.22.0
263
263
  post_install_message:
264
264
  rdoc_options: []
265
265
  require_paths:
@@ -268,14 +268,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
268
268
  requirements:
269
269
  - - ">="
270
270
  - !ruby/object:Gem::Version
271
- version: 2.6.0
271
+ version: '3.0'
272
272
  required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  requirements:
274
274
  - - ">="
275
275
  - !ruby/object:Gem::Version
276
276
  version: '0'
277
277
  requirements: []
278
- rubygems_version: 3.1.6
278
+ rubygems_version: 3.2.33
279
279
  signing_key:
280
280
  specification_version: 4
281
281
  summary: Sinatra instrumentation for the OpenTelemetry framework