opentelemetry-exporter-otlp 0.21.0 → 0.21.3

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: 8e96df3090d11643f31476c67b12f94c4f2aca4293fb497e077a5328f182cb93
4
- data.tar.gz: cde4e3feddc09834ef01229086605ad29e8373e50786ffb416321a8703a792f6
3
+ metadata.gz: b213406e2d3c47187dfab98be6509f7622c45c18bea72bf256afc0b15ac96456
4
+ data.tar.gz: bda1a504619c2bb64f079fb136b7ddf40ea192476760ca9cbcd96df057779e88
5
5
  SHA512:
6
- metadata.gz: 4c582a7a6ba8b24a0b7e88cbaed0b7e72a2f86f112792480767b2d38fcf3fb4eb435e81614059adf7e5871964c226509c2d2868cf3cf39d9556a3bddb5c53b23
7
- data.tar.gz: 6e14cd89bd4ebf21a0fdabdaa4d3272502d123f7de2d8cecbb8a50bc8f788c266c0eee849c232cd61ca4543fb85ef5b51c4c7e74134712863fa118a76ff9c80b
6
+ metadata.gz: e30faf8e6a0c5b122fa28882482d9c03286e601bb65653937133e15c23802a495fc572f8470a1f2b1e42a45839031e31e20053a1a3e87d6d311c2243b64f604a
7
+ data.tar.gz: ad5469012f495a86f0e8ae40016cd12e06f51be4d126e09b9f7b201cbd11011003886ba12b424802cfa7c9c6d0b5756b03bf4c0a8ce51f895836d7c58965fba5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Release History: opentelemetry-exporter-otlp
2
2
 
3
+ ### v0.21.3 / 2022-05-12
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.21.2 / 2022-01-19
8
+
9
+ * FIXED: Default scheme for OTLP endpoint
10
+ * FIXED: Remove TIMEOUT status from OTLP exporter (#1087)
11
+
12
+ ### v0.21.1 / 2021-12-31
13
+
14
+ * FIXED: Allow OTLP Exporter compression value of `none`
15
+
3
16
  ### v0.21.0 / 2021-12-01
4
17
 
5
18
  * ADDED: Exporter should use gzip compression by default
data/README.md CHANGED
@@ -78,7 +78,7 @@ The collector exporter can be configured explicitly in code, or via environment
78
78
  | `ssl_verify_mode:` | `OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_PEER` or | `OpenSSL::SSL:VERIFY_PEER` |
79
79
  | | `OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_NONE` | |
80
80
 
81
- `ssl_verify_mode:` parameter values should be flags for server certificate verification: `OpenSSL::SSL:VERIFY_PEER` and `OpenSSL::SSL:VERIFY_NONE` are acceptable. These values can also be set using the appropriately named environment variables as shown where `VERIFY_PEER` will take precedence over `VERIFY_NONE`. Please see [the Net::HTTP docs](https://ruby-doc.org/stdlib-2.5.1/libdoc/net/http/rdoc/Net/HTTP.html#verify_mode) for more information about these flags.
81
+ `ssl_verify_mode:` parameter values should be flags for server certificate verification: `OpenSSL::SSL:VERIFY_PEER` and `OpenSSL::SSL:VERIFY_NONE` are acceptable. These values can also be set using the appropriately named environment variables as shown where `VERIFY_PEER` will take precedence over `VERIFY_NONE`. Please see [the Net::HTTP docs](https://ruby-doc.org/stdlib-2.7.6/libdoc/net/http/rdoc/Net/HTTP.html#verify_mode) for more information about these flags.
82
82
 
83
83
  ## How can I get involved?
84
84
 
@@ -10,6 +10,8 @@ require 'net/http'
10
10
  require 'csv'
11
11
  require 'zlib'
12
12
 
13
+ require 'google/rpc/status_pb'
14
+
13
15
  require 'opentelemetry/proto/common/v1/common_pb'
14
16
  require 'opentelemetry/proto/resource/v1/resource_pb'
15
17
  require 'opentelemetry/proto/trace/v1/trace_pb'
@@ -22,8 +24,7 @@ module OpenTelemetry
22
24
  class Exporter # rubocop:disable Metrics/ClassLength
23
25
  SUCCESS = OpenTelemetry::SDK::Trace::Export::SUCCESS
24
26
  FAILURE = OpenTelemetry::SDK::Trace::Export::FAILURE
25
- TIMEOUT = OpenTelemetry::SDK::Trace::Export::TIMEOUT
26
- private_constant(:SUCCESS, :FAILURE, :TIMEOUT)
27
+ private_constant(:SUCCESS, :FAILURE)
27
28
 
28
29
  # Default timeouts in seconds.
29
30
  KEEP_ALIVE_TIMEOUT = 30
@@ -44,7 +45,7 @@ module OpenTelemetry
44
45
  end
45
46
  end
46
47
 
47
- def initialize(endpoint: config_opt('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT', 'OTEL_EXPORTER_OTLP_ENDPOINT', default: 'https://localhost:4318/v1/traces'), # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
48
+ def initialize(endpoint: config_opt('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT', 'OTEL_EXPORTER_OTLP_ENDPOINT', default: 'http://localhost:4318/v1/traces'), # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
48
49
  certificate_file: config_opt('OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'),
49
50
  ssl_verify_mode: Exporter.ssl_verify_mode,
50
51
  headers: config_opt('OTEL_EXPORTER_OTLP_TRACES_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS', default: {}),
@@ -52,7 +53,7 @@ module OpenTelemetry
52
53
  timeout: config_opt('OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10),
53
54
  metrics_reporter: nil)
54
55
  raise ArgumentError, "invalid url for OTLP::Exporter #{endpoint}" if invalid_url?(endpoint)
55
- raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil? || compression == 'gzip'
56
+ raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil? || %w[gzip none].include?(compression)
56
57
 
57
58
  @uri = if endpoint == ENV['OTEL_EXPORTER_OTLP_ENDPOINT']
58
59
  URI("#{endpoint}/v1/traces")
@@ -165,7 +166,7 @@ module OpenTelemetry
165
166
  @headers.each { |key, value| request.add_field(key, value) }
166
167
 
167
168
  remaining_timeout = OpenTelemetry::Common::Utilities.maybe_timeout(timeout, start_time)
168
- return TIMEOUT if remaining_timeout.zero?
169
+ return FAILURE if remaining_timeout.zero?
169
170
 
170
171
  @http.open_timeout = remaining_timeout
171
172
  @http.read_timeout = remaining_timeout
@@ -186,8 +187,7 @@ module OpenTelemetry
186
187
  redo if backoff?(retry_count: retry_count += 1, reason: response.code)
187
188
  FAILURE
188
189
  when Net::HTTPBadRequest, Net::HTTPClientError, Net::HTTPServerError
189
- # TODO: decode the body as a google.rpc.Status Protobuf-encoded message when https://github.com/open-telemetry/opentelemetry-collector/issues/1357 is fixed.
190
- response.body # Read and discard body
190
+ log_status(response.body)
191
191
  @metrics_reporter.add_to_counter('otel.otlp_exporter.failure', labels: { 'reason' => response.code })
192
192
  FAILURE
193
193
  when Net::HTTPRedirection
@@ -232,6 +232,17 @@ module OpenTelemetry
232
232
  # TODO: figure out destination and reinitialize @http and @path
233
233
  end
234
234
 
235
+ def log_status(body)
236
+ status = Google::Rpc::Status.decode(body)
237
+ details = status.details.map do |detail|
238
+ klass_or_nil = ::Google::Protobuf::DescriptorPool.generated_pool.lookup(detail.type_name).msgclass
239
+ detail.unpack(klass_or_nil) if klass_or_nil
240
+ end.compact
241
+ OpenTelemetry.handle_error(message: "OTLP exporter received rpc.Status{message=#{status.message}, details=#{details}}")
242
+ rescue StandardError => e
243
+ OpenTelemetry.handle_error(exception: e, message: 'unexpected error decoding rpc.Status in OTLP::Exporter#log_status')
244
+ end
245
+
235
246
  def measure_request_duration
236
247
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
237
248
  begin
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporter
9
9
  module OTLP
10
10
  ## Current OpenTelemetry OTLP exporter version
11
- VERSION = '0.21.0'
11
+ VERSION = '0.21.3'
12
12
  end
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-exporter-otlp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.21.3
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-12-01 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.7'
19
+ version: '3.19'
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: '3.7'
26
+ version: '3.19'
27
+ - !ruby/object:Gem::Dependency
28
+ name: googleapis-common-protos-types
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: opentelemetry-api
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: opentelemetry-semantic_conventions
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: bundler
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +136,20 @@ dependencies:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
138
  version: '5.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: opentelemetry-test-helpers
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
111
153
  - !ruby/object:Gem::Dependency
112
154
  name: pry-byebug
113
155
  requirement: !ruby/object:Gem::Requirement
@@ -238,10 +280,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
238
280
  licenses:
239
281
  - Apache-2.0
240
282
  metadata:
241
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.21.0/file.CHANGELOG.html
283
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.21.3/file.CHANGELOG.html
242
284
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp
243
285
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
244
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.21.0
286
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.21.3
245
287
  post_install_message:
246
288
  rdoc_options: []
247
289
  require_paths:
@@ -250,7 +292,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
292
  requirements:
251
293
  - - ">="
252
294
  - !ruby/object:Gem::Version
253
- version: 2.5.0
295
+ version: 2.6.0
254
296
  required_rubygems_version: !ruby/object:Gem::Requirement
255
297
  requirements:
256
298
  - - ">="