opentelemetry-instrumentation-rack 0.21.0 → 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: 78d05a138b397d0d31dd63cb7cf153ba441636a5954814e0174c6bbd48d7e81f
4
- data.tar.gz: 5db210af2bc4c76f0cae594d4eb1b5e943729aac2929e27e9156f5a323c52917
3
+ metadata.gz: adec146f5413f600be2f53c5a8ae9d2dd9388611c253886d60b0c2831546d711
4
+ data.tar.gz: 180d5b75cc9895b3d4aa9c01cf8c12d4e545c60fa477384a13350a8d4c93a6c8
5
5
  SHA512:
6
- metadata.gz: b978ef942d1b47a623fbccd032d034d5fbe9995d4796fe8abd75eb6f3a10a12dd6853a260e7c420b7d6260ab972d1b1cfd0cf5d20635021cceb053a8cd173db4
7
- data.tar.gz: 31ba609152a353b5f5dd2807aacdf0809657ea9b993fc895629cdc932fc9dbb88e77b1a0e07fb9ddeb4a810448965186f540765df048855e2ab5356072d73996
6
+ metadata.gz: c738d928bbf2ae2cfce23cb1235958817e7c5923ab8d45a8454679f300b835ee64e3e4c21026b35edfa258bb4ca8073ea77328df0195fca40fd68617ffc7e738
7
+ data.tar.gz: 2bbbe8be64060776b3afa9ea2d6ef675ccf7c0b74e3f44a52501d5346a2f460b36c2c8d63c0314448321057d075d864669d88bcffd986a4ba28ece3250f59ea7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Release History: opentelemetry-instrumentation-rack
2
2
 
3
+ ### v0.22.0 / 2022-11-16
4
+
5
+ * ADDED: Add experimental traceresponse propagator to Rack instrumentation
6
+
7
+ ### v0.21.1 / 2022-10-04
8
+
9
+ * FIXED: Bring http.request.header and http.response.header in line with semconv
10
+
3
11
  ### v0.21.0 / 2022-06-09
4
12
 
5
13
  * Upgrading Base dependency version
data/README.md CHANGED
@@ -37,7 +37,7 @@ By default we will set the rack span name to match the format "HTTP #{method}" (
37
37
 
38
38
  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.
39
39
 
40
- 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/blob/f6fb025bef69f839078748f56516ce38c7d51eb8/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/patches/action_controller/metal.rb#L15-L16 for an example.
40
+ 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.
41
41
 
42
42
  ### High cardinality example
43
43
 
@@ -51,7 +51,7 @@ end
51
51
 
52
52
  ## Examples
53
53
 
54
- Example usage can be seen in the `./example/trace_demonstration.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/rack/example/trace_demonstration.rb)
54
+ Example usage can be seen in the `./example/trace_demonstration.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/rack/example/trace_demonstration.rb)
55
55
 
56
56
  ## How can I get involved?
57
57
 
@@ -66,7 +66,7 @@ The `opentelemetry-instrumentation-rack` gem is distributed under the Apache 2.0
66
66
  [rack-home]: https://github.com/rack/rack
67
67
  [bundler-home]: https://bundler.io
68
68
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
69
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
69
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE
70
70
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
71
71
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
72
72
  [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -30,6 +30,7 @@ module OpenTelemetry
30
30
  option :untraced_endpoints, default: [], validate: :array
31
31
  option :url_quantization, default: nil, validate: :callable
32
32
  option :untraced_requests, default: nil, validate: :callable
33
+ option :response_propagators, default: [], validate: :array
33
34
 
34
35
  private
35
36
 
@@ -21,17 +21,17 @@ module OpenTelemetry
21
21
  key = header.to_s.upcase.gsub(/[-\s]/, '_')
22
22
  case key
23
23
  when 'CONTENT_TYPE', 'CONTENT_LENGTH'
24
- memo[key] = build_attribute_name('http.request.headers.', header)
24
+ memo[key] = build_attribute_name('http.request.header.', header)
25
25
  else
26
- memo["HTTP_#{key}"] = build_attribute_name('http.request.headers.', header)
26
+ memo["HTTP_#{key}"] = build_attribute_name('http.request.header.', header)
27
27
  end
28
28
  end
29
29
  end
30
30
 
31
31
  def allowed_response_headers
32
32
  @allowed_response_headers ||= Array(config[:allowed_response_headers]).each_with_object({}) do |header, memo|
33
- memo[header] = build_attribute_name('http.response.headers.', header)
34
- memo[header.to_s.upcase] = build_attribute_name('http.response.headers.', header)
33
+ memo[header] = build_attribute_name('http.response.header.', header)
34
+ memo[header.to_s.upcase] = build_attribute_name('http.response.header.', header)
35
35
  end
36
36
  end
37
37
 
@@ -58,7 +58,7 @@ module OpenTelemetry
58
58
  @untraced_endpoints = config[:untraced_endpoints]
59
59
  end
60
60
 
61
- def call(env) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
61
+ def call(env) # rubocop:disable Metrics/MethodLength
62
62
  if untraced_request?(env)
63
63
  OpenTelemetry::Common::Utilities.untraced do
64
64
  return @app.call(env)
@@ -82,6 +82,7 @@ module OpenTelemetry
82
82
  OpenTelemetry::Instrumentation::Rack.with_span(request_span) do
83
83
  @app.call(env).tap do |status, headers, response|
84
84
  set_attributes_after_request(request_span, status, headers, response)
85
+ config[:response_propagators].each { |propagator| propagator.inject(headers) }
85
86
  end
86
87
  end
87
88
  end
@@ -16,7 +16,7 @@ module OpenTelemetry
16
16
 
17
17
  module_function
18
18
 
19
- def get_request_start(env, now = nil) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
19
+ def get_request_start(env, now = nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
20
20
  header = env[REQUEST_START] || env[QUEUE_START]
21
21
  return unless header
22
22
 
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Rack
10
- VERSION = '0.21.0'
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-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
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: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: opentelemetry-sdk-experimental
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.1'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: opentelemetry-test-helpers
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +184,14 @@ dependencies:
170
184
  requirements:
171
185
  - - "~>"
172
186
  - !ruby/object:Gem::Version
173
- version: 0.73.0
187
+ version: 1.3.0
174
188
  type: :development
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
- version: 0.73.0
194
+ version: 1.3.0
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: simplecov
183
197
  requirement: !ruby/object:Gem::Requirement
@@ -252,14 +266,14 @@ files:
252
266
  - lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb
253
267
  - lib/opentelemetry/instrumentation/rack/util/queue_time.rb
254
268
  - lib/opentelemetry/instrumentation/rack/version.rb
255
- homepage: https://github.com/open-telemetry/opentelemetry-ruby
269
+ homepage: https://github.com/open-telemetry/opentelemetry-contrib
256
270
  licenses:
257
271
  - Apache-2.0
258
272
  metadata:
259
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-rack/v0.21.0/file.CHANGELOG.html
260
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/rack
261
- bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
262
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-rack/v0.21.0
273
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-rack/v0.22.0/file.CHANGELOG.html
274
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/rack
275
+ bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
276
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby-contrib/opentelemetry-instrumentation-rack/v0.22.0
263
277
  post_install_message:
264
278
  rdoc_options: []
265
279
  require_paths: