opentelemetry-exporter-otlp 0.16.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2455db90272d1c7656bf1496b86a9788727cc1130bbbbea5de716dec94f01ee3
4
- data.tar.gz: aaebcfa6905ae078fc8ad21bd08e93ddb435a836904f12bf70db47b9a72a14ea
3
+ metadata.gz: eaad2b71ecee14b25626ab9a081b837972160d1482b7936c7aaa6ae843d05d05
4
+ data.tar.gz: 459cc38c5d021a2b87044a25f5a9d9df2688852f7cb3c2c593b3d7a72d692e46
5
5
  SHA512:
6
- metadata.gz: 2a837ec3d592062abe1893195748a1de091c5381b7612607b8125a046f7699e284e06849e7920708c27e555a63d8b5838e542d96f70cce1b7fbbd9e3d1ce183f
7
- data.tar.gz: 77776d8cd4c9321b7eb92e1e0f2e28c02ccf90869ebd534673713b01ddbe50be4f68664b4fd0f5ebc91aaf483ae0cd7d250fd766d8d164e0bddce897c2b6be10
6
+ metadata.gz: 82b047da9287198aef162b6afe176e37a6d73304ea081efff724d4452aedf931dd1617995ea07181bf09ada22f3db50d41abba03253f44dd1f0a11e207f231de
7
+ data.tar.gz: 38f2fcfd39070808b6a50b0bc3efb891f8910e0898a2a00f2f2a3f481d8e9c98ec563b6269385068426837a8420fe9475a8dcd75d50ffb1fa076d2de223c2d4e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Release History: opentelemetry-exporter-otlp
2
2
 
3
+ ### v0.20.1 / 2021-06-29
4
+
5
+ * FIXED: Otlp encoding exceptions again
6
+
7
+ ### v0.20.0 / 2021-06-23
8
+
9
+ * BREAKING CHANGE: Total order constraint on span.status=
10
+
11
+ * FIXED: Total order constraint on span.status=
12
+
13
+ ### v0.19.0 / 2021-06-03
14
+
15
+ * ADDED: Add a SSL verify mode option for the OTLP exporter
16
+ * FIXED: Handle OTLP exporter encoding exceptions
17
+ * DOCS: Remove the OTLP receiver legacy gRPC port(55680) references
18
+
19
+ ### v0.18.0 / 2021-05-21
20
+
21
+ * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
22
+
23
+ * FIXED: Replace Time.now with Process.clock_gettime
24
+ * FIXED: Rescue missed otlp exporter network errors
25
+
26
+ ### v0.17.0 / 2021-04-22
27
+
28
+ * ADDED: Add zipkin exporter
29
+
3
30
  ### v0.16.0 / 2021-03-17
4
31
 
5
32
  * BREAKING CHANGE: Implement Exporter#force_flush
data/README.md CHANGED
@@ -40,7 +40,7 @@ OpenTelemetry::SDK.configure do |c|
40
40
  c.add_span_processor(
41
41
  OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
42
42
  OpenTelemetry::Exporter::OTLP::Exporter.new(
43
- endpoint: 'http://localhost:55680'
43
+ compression: 'gzip'
44
44
  )
45
45
  )
46
46
  )
@@ -65,6 +65,22 @@ end
65
65
 
66
66
  For additional examples, see the [examples on github][examples-github].
67
67
 
68
+ ## How can I configure the OTLP exporter?
69
+
70
+ The collector exporter can be configured explicitly in code, as shown above, or via environment variables. The configuration parameters, environment variables, and defaults are shown below.
71
+
72
+ | Parameter | Environment variable | Default |
73
+ | ------------------- | -------------------------------------------- | ----------------------------------- |
74
+ | `endpoint:` | `OTEL_EXPORTER_OTLP_ENDPOINT` | `"http://localhost:4317/v1/traces"` |
75
+ | `certificate_file: `| `OTEL_EXPORTER_OTLP_CERTIFICATE` | |
76
+ | `headers:` | `OTEL_EXPORTER_OTLP_HEADERS` | |
77
+ | `compression:` | `OTEL_EXPORTER_OTLP_COMPRESSION` | |
78
+ | `timeout:` | `OTEL_EXPORTER_OTLP_TIMEOUT` | `10` |
79
+ | `ssl_verify_mode:` | `OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_PEER` or | `OpenSSL::SSL:VERIFY_PEER` |
80
+ | | `OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_NONE` | |
81
+
82
+ `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.
83
+
68
84
  ## How can I get involved?
69
85
 
70
86
  The `opentelemetry-exporter-otlp` gem source is [on github][repo-github], along with related gems including `opentelemetry-sdk`.
@@ -31,8 +31,19 @@ module OpenTelemetry
31
31
  WRITE_TIMEOUT_SUPPORTED = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
32
32
  private_constant(:KEEP_ALIVE_TIMEOUT, :RETRY_COUNT, :WRITE_TIMEOUT_SUPPORTED)
33
33
 
34
- def initialize(endpoint: config_opt('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT', 'OTEL_EXPORTER_OTLP_ENDPOINT', default: 'https://localhost:4317/v1/traces'), # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
34
+ def self.ssl_verify_mode
35
+ if ENV.key?('OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_PEER')
36
+ OpenSSL::SSL::VERIFY_PEER
37
+ elsif ENV.key?('OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_NONE')
38
+ OpenSSL::SSL::VERIFY_NONE
39
+ else
40
+ OpenSSL::SSL::VERIFY_PEER
41
+ end
42
+ end
43
+
44
+ def initialize(endpoint: config_opt('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT', 'OTEL_EXPORTER_OTLP_ENDPOINT', default: 'https://localhost:4317/v1/traces'), # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
35
45
  certificate_file: config_opt('OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'),
46
+ ssl_verify_mode: Exporter.ssl_verify_mode,
36
47
  headers: config_opt('OTEL_EXPORTER_OTLP_TRACES_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS'),
37
48
  compression: config_opt('OTEL_EXPORTER_OTLP_TRACES_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION'),
38
49
  timeout: config_opt('OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10),
@@ -49,6 +60,7 @@ module OpenTelemetry
49
60
 
50
61
  @http = Net::HTTP.new(@uri.host, @uri.port)
51
62
  @http.use_ssl = @uri.scheme == 'https'
63
+ @http.verify_mode = ssl_verify_mode
52
64
  @http.ca_file = certificate_file unless certificate_file.nil?
53
65
  @http.keep_alive_timeout = KEEP_ALIVE_TIMEOUT
54
66
 
@@ -139,7 +151,7 @@ module OpenTelemetry
139
151
  def send_bytes(bytes, timeout:) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
140
152
  retry_count = 0
141
153
  timeout ||= @timeout
142
- start_time = Time.now
154
+ start_time = OpenTelemetry::Common::Utilities.timeout_timestamp
143
155
  around_request do # rubocop:disable Metrics/BlockLength
144
156
  request = Net::HTTP::Post.new(@path)
145
157
  request.body = if @compression == 'gzip'
@@ -190,6 +202,12 @@ module OpenTelemetry
190
202
  rescue SocketError
191
203
  retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')
192
204
  return FAILURE
205
+ rescue SystemCallError => e
206
+ retry if backoff?(retry_count: retry_count += 1, reason: e.class.name)
207
+ return FAILURE
208
+ rescue EOFError
209
+ retry if backoff?(retry_count: retry_count += 1, reason: 'eof_error')
210
+ return FAILURE
193
211
  end
194
212
  ensure
195
213
  # Reset timeouts to defaults for the next call.
@@ -277,13 +295,13 @@ module OpenTelemetry
277
295
  parent_span_id: span_data.parent_span_id == OpenTelemetry::Trace::INVALID_SPAN_ID ? nil : span_data.parent_span_id,
278
296
  name: span_data.name,
279
297
  kind: as_otlp_span_kind(span_data.kind),
280
- start_time_unix_nano: as_otlp_timestamp(span_data.start_timestamp),
281
- end_time_unix_nano: as_otlp_timestamp(span_data.end_timestamp),
298
+ start_time_unix_nano: span_data.start_timestamp,
299
+ end_time_unix_nano: span_data.end_timestamp,
282
300
  attributes: span_data.attributes&.map { |k, v| as_otlp_key_value(k, v) },
283
301
  dropped_attributes_count: span_data.total_recorded_attributes - span_data.attributes&.size.to_i,
284
302
  events: span_data.events&.map do |event|
285
303
  Opentelemetry::Proto::Trace::V1::Span::Event.new(
286
- time_unix_nano: as_otlp_timestamp(event.timestamp),
304
+ time_unix_nano: event.timestamp,
287
305
  name: event.name,
288
306
  attributes: event.attributes&.map { |k, v| as_otlp_key_value(k, v) }
289
307
  # TODO: track dropped_attributes_count in Span#append_event
@@ -310,10 +328,6 @@ module OpenTelemetry
310
328
  )
311
329
  end
312
330
 
313
- def as_otlp_timestamp(timestamp)
314
- (timestamp.to_r * 1_000_000_000).to_i
315
- end
316
-
317
331
  def as_otlp_span_kind(kind)
318
332
  case kind
319
333
  when :internal then Opentelemetry::Proto::Trace::V1::Span::SpanKind::INTERNAL
@@ -327,6 +341,10 @@ module OpenTelemetry
327
341
 
328
342
  def as_otlp_key_value(key, value)
329
343
  Opentelemetry::Proto::Common::V1::KeyValue.new(key: key, value: as_otlp_any_value(value))
344
+ rescue Encoding::UndefinedConversionError => e
345
+ encoded_value = value.encode('UTF-8', invalid: :replace, undef: :replace, replace: '�')
346
+ OpenTelemetry.handle_error(exception: e, message: "encoding error for key #{key} and value #{encoded_value}")
347
+ Opentelemetry::Proto::Common::V1::KeyValue.new(key: key, value: as_otlp_any_value('Encoding Error'))
330
348
  end
331
349
 
332
350
  def as_otlp_any_value(value)
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporter
9
9
  module OTLP
10
10
  ## Current OpenTelemetry OTLP exporter version
11
- VERSION = '0.16.0'
11
+ VERSION = '0.20.1'
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.16.0
4
+ version: 0.20.1
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-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -30,28 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.16.0
33
+ version: 1.0.0.rc2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.16.0
40
+ version: 1.0.0.rc2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: opentelemetry-common
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.16.0
47
+ version: 0.19.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.16.0
54
+ version: 0.19.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: opentelemetry-sdk
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0.rc2
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.0.0.rc2
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -201,10 +215,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
201
215
  licenses:
202
216
  - Apache-2.0
203
217
  metadata:
204
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.16.0/file.CHANGELOG.html
218
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.20.1/file.CHANGELOG.html
205
219
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp
206
220
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
207
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.16.0
221
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.20.1
208
222
  post_install_message:
209
223
  rdoc_options: []
210
224
  require_paths:
@@ -220,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
234
  - !ruby/object:Gem::Version
221
235
  version: '0'
222
236
  requirements: []
223
- rubygems_version: 3.1.4
237
+ rubygems_version: 3.1.6
224
238
  signing_key:
225
239
  specification_version: 4
226
240
  summary: OTLP exporter for the OpenTelemetry framework