opentelemetry-instrumentation-excon 0.12.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: f7031a5dd36c227820262fa31871bd78940e7bb4f41dd3bfc6ebcc2dcb47aee5
4
- data.tar.gz: 5c4ff34780de766487e9b4bf9d39163544b0efeac37b376bf3a0cd46dc556592
3
+ metadata.gz: 5eb18983acdca816474316335649864b406dcc87f4fa127616ba634f320b1ed0
4
+ data.tar.gz: 7f773a173d3c97df4baef6ffd084ffc58f93801de32f3d11509b6d3c7d30d635
5
5
  SHA512:
6
- metadata.gz: f207ff09bb19606388fb76a221682ab6586ea1a301aa0f163370b1cea38bf5bf00b139b52444e05568eedeedb998c95bf743f6724daa3f45eca00f20d6635823
7
- data.tar.gz: d1ebdb911bbc9909e18e1fb77f738fbe59ee86fecef4970e3e2a122f32c4114e305b53e44ea292ac68668a1bf1f7ef46fe0b31c20abb4128947767343a0aa0c3
6
+ metadata.gz: 2d49fb540eaeb81f3323ec0363ba3cea3baebbd75394ed910b764acdc0da82921050facbc283098e81c93689eff100ee6d0e6c825f4dca9fd710ed6582e64d3b
7
+ data.tar.gz: a4ce004977099c872cf15ba34554823e2f32ac9c29f516e5b0e81da11f788af85f13d38e65ebcd77731e7c716ea08aefb1a2b8a826553fa8be9aebfb8d0520d0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
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
+
8
+ ### v0.16.0 / 2021-03-17
9
+
10
+ * FIXED: Example scripts now reference local common lib
11
+ * DOCS: Replace Gitter with GitHub Discussions
12
+
13
+ ### v0.15.0 / 2021-02-18
14
+
15
+ * (No significant changes)
16
+
17
+ ### v0.14.0 / 2021-02-03
18
+
19
+ * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
20
+
21
+ * ADDED: Replace getter and setter callables and remove rack specific propagators
22
+
23
+ ### v0.13.0 / 2021-01-29
24
+
25
+ * (No significant changes)
26
+
3
27
  ### v0.12.0 / 2020-12-24
4
28
 
5
29
  * (No significant changes)
data/README.md CHANGED
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  The `opentelemetry-instrumentation-excon` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
37
37
 
38
- 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].
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].
39
39
 
40
40
  ## License
41
41
 
@@ -44,7 +44,7 @@ The `opentelemetry-instrumentation-all` gem is distributed under the Apache 2.0
44
44
  [excon-home]: https://github.com/excon/excon
45
45
  [bundler-home]: https://bundler.io
46
46
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
47
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
47
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
48
48
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
49
49
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
50
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
50
+ [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -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,24 +22,19 @@ module OpenTelemetry
22
22
  trace: 'TRACE'
23
23
  }.freeze
24
24
 
25
- def request_call(datum) # rubocop:disable Metrics/AbcSize, 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
41
36
  OpenTelemetry::Trace.with_span(span) do
42
- OpenTelemetry.propagation.http.inject(datum[:headers])
37
+ OpenTelemetry.propagation.inject(datum[:headers])
43
38
  end
44
39
  end
45
40
  end
@@ -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.12.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.12.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: 2020-12-24 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.12.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.12.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.12.0/file.CHANGELOG.html
189
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/instrumentation/excon
216
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-excon/v0.17.0/file.CHANGELOG.html
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.12.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