opentelemetry-instrumentation-rack 0.15.0 → 0.16.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: ad21d239ad4a5008e97531f80a7e66bc4b994b9723257921a5762b4141423099
4
- data.tar.gz: 415138c23cdd98cc069a19ebb0aefa6d5be613517b7bf7ab9392a641cae503bd
3
+ metadata.gz: e590fbce994926aefc1383ded5c958e163762001b59f045bd5e88bb6eb804790
4
+ data.tar.gz: 46d516be35be8e1fa04f9626099522f666bcf952f911626a3f178a5269ee7ee8
5
5
  SHA512:
6
- metadata.gz: 3dee2f0c3eb4f16d4c23e0d15d33d287b73c3a1767fa312583f1165d2f2b704cfd9a279f3309b06604a4cf364036f7dbd0bd0465c8ba0beb27c4db18f8bca918
7
- data.tar.gz: 64174578aeb8e18bdffc0cd7a92074708d9cdba56713b96d4a94e058a9e5399a26033bca846945c96d6d509c5dcfbbe3ba5c1f4c941086269a1855b2e4314ccc
6
+ metadata.gz: b50451413b3f591eb862c2c0f5699b74950d4d4af74b8f58268c3c9de38fbb13fd3dac43b6b4398fc64de8eefa615eeb8a004097741034c79155f5e96088c707
7
+ data.tar.gz: 9ec785d592cf0582f93fd4380385ea8457c66f84026834ad92c1f4f7feb5845d9f6fe3181a8d800e6d0307ee3fb7b1d49632f03344a68230e971abd96e209d51
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Release History: opentelemetry-instrumentation-rack
2
2
 
3
+ ### v0.16.0 / 2021-03-17
4
+
5
+ * BREAKING CHANGE: Pass env to url quantization rack config to allow more flexibility
6
+
7
+ * ADDED: Pass env to url quantization rack config to allow more flexibility
8
+ * ADDED: Add rack instrumentation config option to accept callable to filter requests to trace
9
+ * FIXED: Example scripts now reference local common lib
10
+ * DOCS: Replace Gitter with GitHub Discussions
11
+
3
12
  ### v0.15.0 / 2021-02-18
4
13
 
5
14
  * ADDED: Add instrumentation config validation
data/README.md CHANGED
@@ -38,7 +38,7 @@ Example usage can be seen in the `./example/trace_demonstration.rb` file [here](
38
38
 
39
39
  The `opentelemetry-instrumentation-rack` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
40
40
 
41
- The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us on our [gitter channel][ruby-gitter] 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].
41
+ 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].
42
42
 
43
43
  ## License
44
44
 
@@ -50,4 +50,4 @@ The `opentelemetry-instrumentation-rack` gem is distributed under the Apache 2.0
50
50
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
51
51
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
52
52
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
53
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
53
+ [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -29,6 +29,7 @@ module OpenTelemetry
29
29
  option :retain_middleware_names, default: false, validate: :boolean
30
30
  option :untraced_endpoints, default: [], validate: :array
31
31
  option :url_quantization, default: nil, validate: :callable
32
+ option :untraced_requests, default: nil, validate: :callable
32
33
 
33
34
  private
34
35
 
@@ -67,7 +67,7 @@ module OpenTelemetry
67
67
 
68
68
  # restore extracted context in this process:
69
69
  OpenTelemetry::Context.with_current(frontend_context || extracted_context) do
70
- request_span_name = create_request_span_name(env['REQUEST_URI'] || original_env['PATH_INFO'])
70
+ request_span_name = create_request_span_name(env['REQUEST_URI'] || original_env['PATH_INFO'], env)
71
71
  request_span_kind = frontend_context.nil? ? :server : :internal
72
72
  tracer.in_span(request_span_name,
73
73
  attributes: request_span_attributes(env: env),
@@ -86,7 +86,10 @@ module OpenTelemetry
86
86
  private
87
87
 
88
88
  def untraced_request?(env)
89
- @untraced_endpoints.include?(env['PATH_INFO'])
89
+ return true if @untraced_endpoints.include?(env['PATH_INFO'])
90
+ return true if config[:untraced_requests]&.call(env)
91
+
92
+ false
90
93
  end
91
94
 
92
95
  # return Context with the frontend span as the current span
@@ -138,12 +141,12 @@ module OpenTelemetry
138
141
  # strip off query param value, keep param name)
139
142
  #
140
143
  # see http://github.com/open-telemetry/opentelemetry-specification/pull/416/files
141
- def create_request_span_name(request_uri_or_path_info)
144
+ def create_request_span_name(request_uri_or_path_info, env)
142
145
  # NOTE: dd-trace-rb has implemented 'quantization' (which lowers url cardinality)
143
146
  # see Datadog::Quantization::HTTP.url
144
147
 
145
148
  if (implementation = config[:url_quantization])
146
- implementation.call(request_uri_or_path_info)
149
+ implementation.call(request_uri_or_path_info, env)
147
150
  else
148
151
  request_uri_or_path_info
149
152
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Rack
10
- VERSION = '0.15.0'
10
+ VERSION = '0.16.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.15.0
4
+ version: 0.16.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: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2021-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.15.0
19
+ version: 0.16.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.15.0
26
+ version: 0.16.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -214,10 +214,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
214
214
  licenses:
215
215
  - Apache-2.0
216
216
  metadata:
217
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-rack/v0.15.0/file.CHANGELOG.html
217
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-rack/v0.16.0/file.CHANGELOG.html
218
218
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/rack
219
219
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
220
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-rack/v0.15.0
220
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-rack/v0.16.0
221
221
  post_install_message:
222
222
  rdoc_options: []
223
223
  require_paths: