opentelemetry-instrumentation-faraday 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: 5d6d8ff1a2c7a14d8278bbfede179d7a5a4c034ed03ab0f3937305fa83790587
4
- data.tar.gz: d1e00624f02e58aabd52a75a71fc6228d546ecf21ffbb772edadf745d4dcb9ab
3
+ metadata.gz: fda98783faef5cce019d7008af200a08fd630cd788abfc050d8b286e6b828c9a
4
+ data.tar.gz: 6dab2946fc130712cc8c4a4c8e8eddb32fc5339bf492ec484f03b272bdd6ed97
5
5
  SHA512:
6
- metadata.gz: cc5a68101ae47bf67903f58655658fd41ca94b99199b71b96c974da25ae6970cc23ae81117bdb50cde90aebc12e77ce631c2794da307a808000139219a6d4100
7
- data.tar.gz: 7b61e920080d7c8c7645e76ecb13f839d7e6dbeb92d33475fb144c91416fc43fb3b33a0c75fd91c3e8bff1521c33275e07b74036bf2c5247542843adfff5df07
6
+ metadata.gz: 17b7fe993b923be365f97f1fd97ebd9a83c969b40cbe63a474c703cc8769d68b8298f9942e1a0fe8d801f6795d72dfa1cdc8276b3d13dbecb3efbbe51b8f8535
7
+ data.tar.gz: 9984084f4134e9161740783a4cdbb253324bc8d30a4dacea3e1f35de484a4f4655ca91a6a827d6711e60b7ec9128939aab03eda892e790e378b1b8b253d25194
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release History: opentelemetry-instrumentation-faraday
2
2
 
3
+ ### v0.17.0 / 2021-04-22
4
+
5
+ * FIXED: Fix Faraday gem dependencies.
6
+ * FIXED: Refactor propagators to add #fields
7
+
3
8
  ### v0.16.0 / 2021-03-17
4
9
 
5
10
  * FIXED: Remove passwords from http.url
@@ -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
@@ -20,6 +20,8 @@ module OpenTelemetry
20
20
  defined?(::Faraday)
21
21
  end
22
22
 
23
+ option :peer_service, default: nil, validate: :string
24
+
23
25
  private
24
26
 
25
27
  def require_dependencies
@@ -25,14 +25,11 @@ module OpenTelemetry
25
25
 
26
26
  def call(env)
27
27
  http_method = HTTP_METHODS_SYMBOL_TO_STRING[env.method]
28
-
28
+ attributes = span_creation_attributes(
29
+ http_method: http_method, url: env.url
30
+ )
29
31
  tracer.in_span(
30
- "HTTP #{http_method}",
31
- attributes: {
32
- 'http.method' => http_method,
33
- 'http.url' => env.url.to_s
34
- },
35
- kind: :client
32
+ "HTTP #{http_method}", attributes: attributes, kind: :client
36
33
  ) do |span|
37
34
  OpenTelemetry.propagation.inject(env.request_headers)
38
35
 
@@ -44,6 +41,17 @@ module OpenTelemetry
44
41
 
45
42
  attr_reader :app
46
43
 
44
+ def span_creation_attributes(http_method:, url:)
45
+ instrumentation_attrs = {
46
+ 'http.method' => http_method, 'http.url' => url.to_s
47
+ }
48
+ config = Faraday::Instrumentation.instance.config
49
+ instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service]
50
+ instrumentation_attrs.merge(
51
+ OpenTelemetry::Common::HTTP::ClientContext.attributes
52
+ )
53
+ end
54
+
47
55
  def tracer
48
56
  Faraday::Instrumentation.instance.tracer
49
57
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Faraday
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-faraday
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
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
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
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: 0.16.0
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
@@ -186,10 +214,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
186
214
  licenses:
187
215
  - Apache-2.0
188
216
  metadata:
189
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-faraday/v0.16.0/file.CHANGELOG.html
217
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-faraday/v0.17.0/file.CHANGELOG.html
190
218
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/faraday
191
219
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
192
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-faraday/v0.16.0
220
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-faraday/v0.17.0
193
221
  post_install_message:
194
222
  rdoc_options: []
195
223
  require_paths:
@@ -205,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
233
  - !ruby/object:Gem::Version
206
234
  version: '0'
207
235
  requirements: []
208
- rubygems_version: 3.1.4
236
+ rubygems_version: 3.1.6
209
237
  signing_key:
210
238
  specification_version: 4
211
239
  summary: Faraday instrumentation for the OpenTelemetry framework