opentelemetry-instrumentation-excon 0.22.4 → 0.22.5

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: 79e0db176b9e6c6dd49483e204d1a238ef4366045aad7dc43b978f5c80305c8b
4
- data.tar.gz: 2826c58d07d1b4a0f36fae7a6dc59702b9d94ed7968a918e1d9eda194ebd7123
3
+ metadata.gz: c0fd87044ff607b499f512e7949e070edf4f830c304453898b6a07b9a7306cf5
4
+ data.tar.gz: 54e0c70caa824e583d3fb5d4980a5ed7644a16563ff364b389e6bb07a1812309
5
5
  SHA512:
6
- metadata.gz: ab86b74e597195f97204b46f9cb1cbf743b41051d0ff7fdd56b51a15384f113e52784660c36566faf3792044d7013e57c8aa35873a1af63be1a594a676d772c6
7
- data.tar.gz: '095934529ba21941937674f6b8c3f2ae8d9f4742022317996353c6e097554205b49a7c2591f403bb515898d7575587c74325a57f0fcea96aac504f87b3be6099'
6
+ metadata.gz: 7cc37ae4f7b456a68bea659ea6bd7c1d110820044b3c80d3a3d345cd7428ca3057906993ccee86811e4825bce660e5c167e4da0d476e52c450067183fbde019c
7
+ data.tar.gz: 54c1612567863af0fff22f33afb323164bde465f14548d7ca0831fb907def1ecfbc2b34030fa17ec18e8651d79d5677e0280b4a038c5d09eff49e008cc780895
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-excon
2
2
 
3
+ ### v0.22.5 / 2024-11-26
4
+
5
+ * CHANGED: Performance Freeze all range objects #1222
6
+
3
7
  ### v0.22.4 / 2024-07-23
4
8
 
5
9
  * DOCS: Add cspell to CI
data/README.md CHANGED
@@ -6,7 +6,7 @@ The excon instrumentation is a community-maintained instrumentation for the [exc
6
6
 
7
7
  Install the gem using:
8
8
 
9
- ```
9
+ ```console
10
10
  gem install opentelemetry-instrumentation-excon
11
11
  ```
12
12
 
@@ -16,7 +16,6 @@ Or, if you use [bundler][bundler-home], include `opentelemetry-instrumentation-e
16
16
 
17
17
  To install the instrumentation, call `use` with the name of the instrumentation.
18
18
 
19
-
20
19
  ```ruby
21
20
  OpenTelemetry::SDK.configure do |c|
22
21
  c.use 'OpenTelemetry::Instrumentation::Excon'
@@ -35,7 +34,7 @@ end
35
34
 
36
35
  The `opentelemetry-instrumentation-excon` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
37
36
 
38
- 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].
37
+ 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].
39
38
 
40
39
  ## License
41
40
 
@@ -47,4 +46,5 @@ The `opentelemetry-instrumentation-all` gem is distributed under the Apache 2.0
47
46
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE
48
47
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
49
48
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
49
+ [slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY
50
50
  [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -21,11 +21,13 @@ module OpenTelemetry
21
21
  hash[uppercase_method] ||= "HTTP #{uppercase_method}"
22
22
  end.freeze
23
23
 
24
+ # Constant for the HTTP status range
25
+ HTTP_STATUS_SUCCESS_RANGE = (100..399)
26
+
24
27
  def request_call(datum)
25
28
  return @stack.request_call(datum) if untraced?(datum)
26
29
 
27
30
  http_method = HTTP_METHODS_TO_UPPERCASE[datum[:method]]
28
-
29
31
  attributes = {
30
32
  OpenTelemetry::SemanticConventions::Trace::HTTP_HOST => datum[:host],
31
33
  OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => http_method,
@@ -35,19 +37,14 @@ module OpenTelemetry
35
37
  OpenTelemetry::SemanticConventions::Trace::NET_PEER_NAME => datum[:hostname],
36
38
  OpenTelemetry::SemanticConventions::Trace::NET_PEER_PORT => datum[:port]
37
39
  }
38
-
39
40
  peer_service = Excon::Instrumentation.instance.config[:peer_service]
40
41
  attributes[OpenTelemetry::SemanticConventions::Trace::PEER_SERVICE] = peer_service if peer_service
41
42
  attributes.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)
42
-
43
43
  span = tracer.start_span(HTTP_METHODS_TO_SPAN_NAMES[http_method], attributes: attributes, kind: :client)
44
44
  ctx = OpenTelemetry::Trace.context_with_span(span)
45
-
46
45
  datum[:otel_span] = span
47
46
  datum[:otel_token] = OpenTelemetry::Context.attach(ctx)
48
-
49
47
  OpenTelemetry.propagation.inject(datum[:headers])
50
-
51
48
  @stack.request_call(datum)
52
49
  end
53
50
 
@@ -68,7 +65,6 @@ module OpenTelemetry
68
65
  # If the default stack contains a version of the trace middleware already...
69
66
  existing_trace_middleware = default_stack.find { |m| m <= TracerMiddleware }
70
67
  default_stack.delete(existing_trace_middleware) if existing_trace_middleware
71
-
72
68
  # Inject after the ResponseParser middleware
73
69
  response_middleware_index = default_stack.index(::Excon::Middleware::ResponseParser).to_i
74
70
  default_stack.insert(response_middleware_index + 1, self)
@@ -84,7 +80,7 @@ module OpenTelemetry
84
80
  if datum.key?(:response)
85
81
  response = datum[:response]
86
82
  span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE, response[:status])
87
- span.status = OpenTelemetry::Trace::Status.error unless (100..399).cover?(response[:status].to_i)
83
+ span.status = OpenTelemetry::Trace::Status.error unless HTTP_STATUS_SUCCESS_RANGE.cover?(response[:status].to_i)
88
84
  end
89
85
 
90
86
  if datum.key?(:error)
@@ -93,7 +89,6 @@ module OpenTelemetry
93
89
  end
94
90
 
95
91
  span.finish
96
-
97
92
  OpenTelemetry::Context.detach(datum.delete(:otel_token)) if datum.include?(:otel_token)
98
93
  end
99
94
  rescue StandardError => e
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Excon
10
- VERSION = '0.22.4'
10
+ VERSION = '0.22.5'
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-excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.4
4
+ version: 0.22.5
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-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.65.0
117
+ version: 1.68.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.65.0
124
+ version: 1.68.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rubocop-performance
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '1.20'
131
+ version: 1.23.0
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: '1.20'
138
+ version: 1.23.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: simplecov
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: '3.19'
159
+ version: 3.24.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: '3.19'
166
+ version: 3.24.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: yard
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -201,10 +201,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
201
201
  licenses:
202
202
  - Apache-2.0
203
203
  metadata:
204
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-excon/0.22.4/file/CHANGELOG.md
204
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-excon/0.22.5/file/CHANGELOG.md
205
205
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/excon
206
206
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
207
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-excon/0.22.4
207
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-excon/0.22.5
208
208
  post_install_message:
209
209
  rdoc_options: []
210
210
  require_paths: