opentelemetry-instrumentation-restclient 0.14.0 → 0.19.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: 06d35d9908dc2a03698c0c09eb69ade7efefff5b5dc4d6b2444ade9fa8e8fb8d
4
- data.tar.gz: dc3acd1482f2920493fc904fb7f60ec9c3be08e95b02f4a17815b863a568dfa9
3
+ metadata.gz: 4aee81684e85a225a393a4f00e3d2aa3a43112e9475322daec52fcb6d30aa197
4
+ data.tar.gz: 5ba6a9fd9c146488a2cef7790b010eabfa2cd7dbbff278d62e2194fd1763bb1b
5
5
  SHA512:
6
- metadata.gz: f88a3ad21d61fcfa9346f49facde2127f7f5dffb385ab65f76942ddb8b1e57000d954a731793fefa952a2e1b83eae17f673bdbda25ab38ca4056c5596978302e
7
- data.tar.gz: '095d121654d4c6e029a1263bc8b67fbcbe51b61bdde09f47f5e4f149856ddc0a219e77a20f6880cfeef3a2953fea9e968da99eb189f25179fec32fafabc582eb'
6
+ metadata.gz: 304cad30e5342e87489bae3b53938444c56096ad2bc63960650fbfc1bc2dfe95dd1795850476132c6afc0d0867410924bf8af80ff602dcfc450753d2a34f32cd
7
+ data.tar.gz: 9fe481d5ad7f4f3482456eb25dbda746b66677eca5685b98066046f536cfd4b5014900a4f98272a61d4a77f10b76898a89a321f477eb6ada2b3653bc04d5dda7
data/CHANGELOG.md CHANGED
@@ -1,10 +1,36 @@
1
1
  # Release History: opentelemetry-instrumentation-restclient
2
2
 
3
+ ### v0.19.0 / 2021-06-23
4
+
5
+ * BREAKING CHANGE: Total order constraint on span.status=
6
+
7
+ * FIXED: Total order constraint on span.status=
8
+
9
+ ### v0.18.0 / 2021-05-21
10
+
11
+ * ADDED: Updated API depedency for 1.0.0.rc1
12
+ * FIXED: Removed http.status_text attribute #750
13
+
14
+ ### v0.17.0 / 2021-04-22
15
+
16
+ * ADDED: RestClient instrumentation accepts peer service config attribute.
17
+ * FIXED: Refactor propagators to add #fields
18
+
19
+ ### v0.16.0 / 2021-03-17
20
+
21
+ * FIXED: Remove passwords from http.url
22
+ * FIXED: Example scripts now reference local common lib
23
+ * DOCS: Replace Gitter with GitHub Discussions
24
+
25
+ ### v0.15.0 / 2021-02-18
26
+
27
+ * (No significant changes)
28
+
3
29
  ### v0.14.0 / 2021-02-03
4
30
 
5
- * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
31
+ * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
6
32
 
7
- * ADDED: Replace getter and setter callables and remove rack specific propagators
33
+ * ADDED: Replace getter and setter callables and remove rack specific propagators
8
34
 
9
35
  ### v0.13.0 / 2021-01-29
10
36
 
@@ -16,7 +42,7 @@
16
42
 
17
43
  ### v0.11.0 / 2020-12-11
18
44
 
19
- * FIXED: Copyright comments to not reference year
45
+ * FIXED: Copyright comments to not reference year
20
46
 
21
47
  ### v0.10.0 / 2020-12-03
22
48
 
@@ -24,19 +50,19 @@
24
50
 
25
51
  ### v0.9.0 / 2020-11-27
26
52
 
27
- * BREAKING CHANGE: Add timeout for force_flush and shutdown
53
+ * BREAKING CHANGE: Add timeout for force_flush and shutdown
28
54
 
29
- * ADDED: Add timeout for force_flush and shutdown
55
+ * ADDED: Add timeout for force_flush and shutdown
30
56
 
31
57
  ### v0.8.0 / 2020-10-27
32
58
 
33
- * BREAKING CHANGE: Move context/span methods to Trace module
59
+ * BREAKING CHANGE: Move context/span methods to Trace module
34
60
 
35
- * FIXED: Move context/span methods to Trace module
61
+ * FIXED: Move context/span methods to Trace module
36
62
 
37
63
  ### v0.7.0 / 2020-10-07
38
64
 
39
- * DOCS: Standardize toplevel docs structure and readme
65
+ * DOCS: Standardize toplevel docs structure and readme
40
66
 
41
67
  ### v0.6.0 / 2020-09-10
42
68
 
data/README.md CHANGED
@@ -34,7 +34,7 @@ end
34
34
 
35
35
  The `opentelemetry-instrumentation-restclient` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
36
36
 
37
- 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].
37
+ 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].
38
38
 
39
39
  ## License
40
40
 
@@ -46,4 +46,4 @@ Apache 2.0 license. See [LICENSE][license-github] for more information.
46
46
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
47
47
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
48
48
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
49
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
49
+ [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?(::RestClient)
20
20
  end
21
21
 
22
+ option :peer_service, default: nil, validate: :string
23
+
22
24
  private
23
25
 
24
26
  def require_dependencies
@@ -20,12 +20,17 @@ module OpenTelemetry
20
20
 
21
21
  def trace_request # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
22
22
  http_method = method.upcase
23
+ instrumentation_attrs = {
24
+ 'http.method' => http_method,
25
+ 'http.url' => OpenTelemetry::Common::Utilities.cleanse_url(url)
26
+ }
27
+ config = RestClient::Instrumentation.instance.config
28
+ instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service]
23
29
  span = tracer.start_span(
24
30
  "HTTP #{http_method}",
25
- attributes: {
26
- 'http.method' => http_method,
27
- 'http.url' => url
28
- },
31
+ attributes: instrumentation_attrs.merge(
32
+ OpenTelemetry::Common::HTTP::ClientContext.attributes
33
+ ),
29
34
  kind: :client
30
35
  )
31
36
 
@@ -38,17 +43,12 @@ module OpenTelemetry
38
43
  # If so, add additional attributes.
39
44
  if response.is_a?(::RestClient::Response)
40
45
  span.set_attribute('http.status_code', response.code)
41
- span.set_attribute('http.status_text', ::RestClient::STATUSES[response.code])
42
- span.status = OpenTelemetry::Trace::Status.http_to_status(
43
- response.code
44
- )
46
+ span.status = OpenTelemetry::Trace::Status.error unless (100..399).include?(response.code.to_i)
45
47
  end
46
48
  end
47
49
  rescue ::RestClient::ExceptionWithResponse => e
48
50
  span.set_attribute('http.status_code', e.http_code)
49
- span.status = OpenTelemetry::Trace::Status.http_to_status(
50
- e.http_code
51
- )
51
+ span.status = OpenTelemetry::Trace::Status.error unless (100..399).include?(e.http_code.to_i)
52
52
 
53
53
  raise e
54
54
  ensure
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module RestClient
10
- VERSION = '0.14.0'
10
+ VERSION = '0.19.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-restclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.19.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-02-03 00:00:00.000000000 Z
11
+ date: 2021-06-24 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.14.0
19
+ version: 1.0.0.rc2
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.14.0
26
+ version: 1.0.0.rc2
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.19.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.19.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.1
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.1
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: appraisal
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +100,14 @@ dependencies:
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '0.0'
103
+ version: 1.0.0.rc1
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '0.0'
110
+ version: 1.0.0.rc1
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rest-client
85
113
  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-restclient/v0.14.0/file.CHANGELOG.html
216
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-restclient/v0.19.0/file.CHANGELOG.html
189
217
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/restclient
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-restclient/v0.14.0
219
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-restclient/v0.19.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: REST Client instrumentation for the OpenTelemetry framework