opentelemetry-instrumentation-faraday 0.13.0 → 0.18.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: d8a236bc8e651202a0ba61d6ff2a446df18c98a69ea6f4bb70cb8d96aa18114a
4
- data.tar.gz: a388bbaa8b358608f3ae1e23ece5710fb8f22b3af751b20a0b42b83f9e80c479
3
+ metadata.gz: 1fc8cb22e262347bddd7169254357b2be3a1cf068156cdd2036b50bf4d14a2fa
4
+ data.tar.gz: b7055bd7f941783a377d0bb16782013756163bd6e02d9e05b56960f92f2faf00
5
5
  SHA512:
6
- metadata.gz: b958c8095d852077ee57691e9326b7fe40db95b6334279e7b03762f682bb75a57e31d73035bdb0869d47285a208cf0f77f77a5832f0bbf9484b17d4c2b355c16
7
- data.tar.gz: b767f78423709ca34d6ba9e9e3ed9f940f1ba742accb89eda0b67588aba1afb4a5f5046f3b6602f8eb847524039eb685fd2fe82dbfb129734cc040bc616fa220
6
+ metadata.gz: ce82235f722fbf3ee5e0d491080cfc78e1b16ea6ff078dd9a7a89ab63d2e53ed5a51885b849b9ef624bed2b044a8e7c31be59864a6687f708224158a8758f213
7
+ data.tar.gz: ab6e6d6933bb6bbb644f43004f03bab33c8e660e419a0438aa98b02fc27cfd6fd224ffaf43596e4adbe932309028f8d2a7bb70026d08a4c19f2b271910dbbdbd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Release History: opentelemetry-instrumentation-faraday
2
2
 
3
+ ### v0.18.0 / 2021-05-21
4
+
5
+ * ADDED: Updated API depedency for 1.0.0.rc1
6
+ * FIXED: Removed http.status_text attribute #750
7
+
8
+ ### v0.17.0 / 2021-04-22
9
+
10
+ * FIXED: Fix Faraday gem dependencies.
11
+ * FIXED: Refactor propagators to add #fields
12
+
13
+ ### v0.16.0 / 2021-03-17
14
+
15
+ * FIXED: Remove passwords from http.url
16
+ * FIXED: Example scripts now reference local common lib
17
+ * DOCS: Replace Gitter with GitHub Discussions
18
+
19
+ ### v0.15.0 / 2021-02-18
20
+
21
+ * FIXED: Include http.status_text only if reason_phrase is in the response
22
+
23
+ ### v0.14.0 / 2021-02-03
24
+
25
+ * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
26
+
27
+ * ADDED: Replace getter and setter callables and remove rack specific propagators
28
+
3
29
  ### v0.13.0 / 2021-01-29
4
30
 
5
31
  * (No significant changes)
@@ -10,7 +36,7 @@
10
36
 
11
37
  ### v0.11.0 / 2020-12-11
12
38
 
13
- * FIXED: Copyright comments to not reference year
39
+ * FIXED: Copyright comments to not reference year
14
40
 
15
41
  ### v0.10.0 / 2020-12-03
16
42
 
@@ -18,9 +44,9 @@
18
44
 
19
45
  ### v0.9.0 / 2020-11-27
20
46
 
21
- * BREAKING CHANGE: Add timeout for force_flush and shutdown
47
+ * BREAKING CHANGE: Add timeout for force_flush and shutdown
22
48
 
23
- * ADDED: Add timeout for force_flush and shutdown
49
+ * ADDED: Add timeout for force_flush and shutdown
24
50
 
25
51
  ### v0.8.0 / 2020-10-27
26
52
 
@@ -28,8 +54,8 @@
28
54
 
29
55
  ### v0.7.0 / 2020-10-07
30
56
 
31
- * DOCS: Faraday documentation
32
- * DOCS: Standardize toplevel docs structure and readme
57
+ * DOCS: Faraday documentation
58
+ * DOCS: Standardize toplevel docs structure and readme
33
59
 
34
60
  ### v0.6.0 / 2020-09-10
35
61
 
data/README.md CHANGED
@@ -38,7 +38,7 @@ Example usage of faraday can be seen in the `./example/faraday.rb` file [here](h
38
38
 
39
39
  The `opentelemetry-instrumentation-faraday` 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 @@ Apache 2.0 license. See [LICENSE][license-github] for more information.
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
@@ -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,16 +25,13 @@ 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
- OpenTelemetry.propagation.http.inject(env.request_headers)
34
+ OpenTelemetry.propagation.inject(env.request_headers)
38
35
 
39
36
  app.call(env).on_complete { |resp| trace_response(span, resp) }
40
37
  end
@@ -44,13 +41,23 @@ 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
50
58
 
51
59
  def trace_response(span, response)
52
60
  span.set_attribute('http.status_code', response.status)
53
- span.set_attribute('http.status_text', response.reason_phrase)
54
61
  span.status = OpenTelemetry::Trace::Status.http_to_status(
55
62
  response.status
56
63
  )
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Faraday
10
- VERSION = '0.13.0'
10
+ VERSION = '0.18.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.13.0
4
+ version: 0.18.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-01-30 00:00:00.000000000 Z
11
+ date: 2021-05-21 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.13.0
19
+ version: 1.0.0.rc1
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.13.0
26
+ version: 1.0.0.rc1
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.18.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.18.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.18.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.18.0
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: appraisal
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +114,14 @@ dependencies:
86
114
  requirements:
87
115
  - - "~>"
88
116
  - !ruby/object:Gem::Version
89
- version: '0.0'
117
+ version: 1.0.0.rc1
90
118
  type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
122
  - - "~>"
95
123
  - !ruby/object:Gem::Version
96
- version: '0.0'
124
+ version: 1.0.0.rc1
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: rubocop
99
127
  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.13.0/file.CHANGELOG.html
217
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-faraday/v0.18.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.13.0
220
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-faraday/v0.18.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