opentelemetry-instrumentation-excon 0.16.0 → 0.17.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: daf656f5644c52abb37d6c27a556caf7304e5e48a7a8d25c65fc0a2434826c1e
4
- data.tar.gz: 855329e73df4d31c285694172f35e4607823799ce7e2f03a036effa85e3804d8
3
+ metadata.gz: 5eb18983acdca816474316335649864b406dcc87f4fa127616ba634f320b1ed0
4
+ data.tar.gz: 7f773a173d3c97df4baef6ffd084ffc58f93801de32f3d11509b6d3c7d30d635
5
5
  SHA512:
6
- metadata.gz: c03bd6705ad860d0a5939cf018418599feccec86763788ecbffb258ce808d4e4a2f9c989faa4c6432e341d0ade2cd07c452bbe8fcd25c746148dcf7efeb17750
7
- data.tar.gz: 13490ce5d14ea3acc70d4cc790c86713959270608f215f911739186fbcf2b3396c5b7b29297e49421bee8270a8d217bb807e064b1f7e2b22b672bc68d3ea8757
6
+ metadata.gz: 2d49fb540eaeb81f3323ec0363ba3cea3baebbd75394ed910b764acdc0da82921050facbc283098e81c93689eff100ee6d0e6c825f4dca9fd710ed6582e64d3b
7
+ data.tar.gz: a4ce004977099c872cf15ba34554823e2f32ac9c29f516e5b0e81da11f788af85f13d38e65ebcd77731e7c716ea08aefb1a2b8a826553fa8be9aebfb8d0520d0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release History: opentelemetry-instrumentation-excon
2
2
 
3
+ ### v0.17.0 / 2021-04-22
4
+
5
+ * ADDED: Excon instrumentation accepts peer service config attribute.
6
+ * FIXED: Refactor propagators to add #fields
7
+
3
8
  ### v0.16.0 / 2021-03-17
4
9
 
5
10
  * FIXED: Example scripts now reference local common lib
@@ -5,6 +5,7 @@
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  require 'opentelemetry'
8
+ require 'opentelemetry-instrumentation-base'
8
9
 
9
10
  module OpenTelemetry
10
11
  module Instrumentation
@@ -19,6 +19,8 @@ module OpenTelemetry
19
19
  defined?(::Excon)
20
20
  end
21
21
 
22
+ option :peer_service, default: nil, validate: :string
23
+
22
24
  private
23
25
 
24
26
  def require_dependencies
@@ -22,19 +22,14 @@ module OpenTelemetry
22
22
  trace: 'TRACE'
23
23
  }.freeze
24
24
 
25
- def request_call(datum) # rubocop:disable Metrics/MethodLength
25
+ def request_call(datum)
26
26
  begin
27
27
  unless datum.key?(:otel_span)
28
28
  http_method = HTTP_METHODS_SYMBOL_TO_STRING[datum[:method]]
29
-
29
+ attributes = span_creation_attributes(datum, http_method)
30
30
  tracer.start_span(
31
31
  "HTTP #{http_method}",
32
- attributes: {
33
- 'http.host' => datum[:host],
34
- 'http.method' => http_method,
35
- 'http.scheme' => datum[:scheme],
36
- 'http.target' => datum[:path]
37
- },
32
+ attributes: attributes,
38
33
  kind: :client
39
34
  ).tap do |span|
40
35
  datum[:otel_span] = span
@@ -105,6 +100,20 @@ module OpenTelemetry
105
100
  OpenTelemetry.logger.debug(e.message)
106
101
  end
107
102
 
103
+ def span_creation_attributes(datum, http_method)
104
+ instrumentation_attrs = {
105
+ 'http.host' => datum[:host],
106
+ 'http.method' => http_method,
107
+ 'http.scheme' => datum[:scheme],
108
+ 'http.target' => datum[:path]
109
+ }
110
+ config = Excon::Instrumentation.instance.config
111
+ instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service]
112
+ instrumentation_attrs.merge(
113
+ OpenTelemetry::Common::HTTP::ClientContext.attributes
114
+ )
115
+ end
116
+
108
117
  def tracer
109
118
  Excon::Instrumentation.instance.tracer
110
119
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Excon
10
- VERSION = '0.16.0'
10
+ VERSION = '0.17.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-excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.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-03-22 00:00:00.000000000 Z
11
+ date: 2021-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.16.0
19
+ version: 0.17.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.16.0
26
+ version: 0.17.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: opentelemetry-common
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.17.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.17.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: opentelemetry-instrumentation-base
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.17.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.17.0
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: appraisal
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -185,10 +213,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
185
213
  licenses:
186
214
  - Apache-2.0
187
215
  metadata:
188
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-excon/v0.16.0/file.CHANGELOG.html
216
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-excon/v0.17.0/file.CHANGELOG.html
189
217
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/excon
190
218
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
191
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-excon/v0.16.0
219
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-excon/v0.17.0
192
220
  post_install_message:
193
221
  rdoc_options: []
194
222
  require_paths:
@@ -204,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
232
  - !ruby/object:Gem::Version
205
233
  version: '0'
206
234
  requirements: []
207
- rubygems_version: 3.1.4
235
+ rubygems_version: 3.1.6
208
236
  signing_key:
209
237
  specification_version: 4
210
238
  summary: Excon instrumentation for the OpenTelemetry framework