opentelemetry-exporter-otlp 0.15.0 → 0.20.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: f159226c741682d13922c5341f78022583975977c78702972867445edefcc2d6
4
- data.tar.gz: 4adc231af3cf396b9208d9de07830c3ea618dbbbc3dbf623c42a83e0fd180158
3
+ metadata.gz: a47b849e776e7b540e9f6cbc9ef084d477e36afcb5b3a14c59266982118760d5
4
+ data.tar.gz: 30eec237cdd6289b7fba2cdfe29fc081638e70fe3a4dfa548e1b33caaa3ee1c9
5
5
  SHA512:
6
- metadata.gz: de253bbeb04969193f98f92eeef816d986f2a0af7a979d0c542e16269dc5b2257eecd57cbfacf452d88eba93853e03afccc08221759e2ff275430730c7204d03
7
- data.tar.gz: 30f0442ec56900a463c3a83958560e4aa3ebf068e96ea7aef5825a9d6ed358c4a081966e83a17dc9569494764e1e34b27a6b0f31b5f7b713caf5b27ab2685660
6
+ metadata.gz: 6a921db90201deec6715ec76d99d4c1fc06a746a2cc25a891824e9716a17452017a0e9f82dbcec492745573a6ae4ec943aab536d871fc67d9177d249c50fe03a
7
+ data.tar.gz: b7d7708e915bdcb782047b560ab4b9a553d13f02faa25230ac805f8556287f435eb6597ef6ccfa30d26848522aa8a8cdc7fca98508bf239204fc0aa8f3a42133
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Release History: opentelemetry-exporter-otlp
2
2
 
3
+ ### v0.20.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.19.0 / 2021-06-03
10
+
11
+ * ADDED: Add a SSL verify mode option for the OTLP exporter
12
+ * FIXED: Handle OTLP exporter encoding exceptions
13
+ * DOCS: Remove the OTLP receiver legacy gRPC port(55680) references
14
+
15
+ ### v0.18.0 / 2021-05-21
16
+
17
+ * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
18
+
19
+ * FIXED: Replace Time.now with Process.clock_gettime
20
+ * FIXED: Rescue missed otlp exporter network errors
21
+
22
+ ### v0.17.0 / 2021-04-22
23
+
24
+ * ADDED: Add zipkin exporter
25
+
26
+ ### v0.16.0 / 2021-03-17
27
+
28
+ * BREAKING CHANGE: Implement Exporter#force_flush
29
+
30
+ * ADDED: Implement Exporter#force_flush
31
+ * FIXED: Rescue socket err in otlp exporter to prevent failures unable to connect
32
+ * DOCS: Replace Gitter with GitHub Discussions
33
+
3
34
  ### v0.15.0 / 2021-02-18
4
35
 
5
36
  * BREAKING CHANGE: Streamline processor pipeline
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,11 +65,27 @@ 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`.
71
87
 
72
- 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].
88
+ 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].
73
89
 
74
90
  ## License
75
91
 
@@ -84,4 +100,4 @@ The `opentelemetry-exporter-otlp` gem is distributed under the Apache 2.0 licens
84
100
  [examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/examples
85
101
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
86
102
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
87
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
103
+ [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -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
 
@@ -76,14 +88,24 @@ module OpenTelemetry
76
88
  send_bytes(encode(span_data), timeout: timeout)
77
89
  end
78
90
 
79
- # Called when {OpenTelemetry::SDK::Trace::Tracer#shutdown} is called, if
80
- # this exporter is registered to a {OpenTelemetry::SDK::Trace::Tracer}
91
+ # Called when {OpenTelemetry::SDK::Trace::TracerProvider#force_flush} is called, if
92
+ # this exporter is registered to a {OpenTelemetry::SDK::Trace::TracerProvider}
93
+ # object.
94
+ #
95
+ # @param [optional Numeric] timeout An optional timeout in seconds.
96
+ def force_flush(timeout: nil)
97
+ SUCCESS
98
+ end
99
+
100
+ # Called when {OpenTelemetry::SDK::Trace::TracerProvider#shutdown} is called, if
101
+ # this exporter is registered to a {OpenTelemetry::SDK::Trace::TracerProvider}
81
102
  # object.
82
103
  #
83
104
  # @param [optional Numeric] timeout An optional timeout in seconds.
84
105
  def shutdown(timeout: nil)
85
106
  @shutdown = true
86
107
  @http.finish if @http.started?
108
+ SUCCESS
87
109
  end
88
110
 
89
111
  private
@@ -129,7 +151,7 @@ module OpenTelemetry
129
151
  def send_bytes(bytes, timeout:) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
130
152
  retry_count = 0
131
153
  timeout ||= @timeout
132
- start_time = Time.now
154
+ start_time = OpenTelemetry::Common::Utilities.timeout_timestamp
133
155
  around_request do # rubocop:disable Metrics/BlockLength
134
156
  request = Net::HTTP::Post.new(@path)
135
157
  request.body = if @compression == 'gzip'
@@ -177,6 +199,15 @@ module OpenTelemetry
177
199
  rescue Net::OpenTimeout, Net::ReadTimeout
178
200
  retry if backoff?(retry_count: retry_count += 1, reason: 'timeout')
179
201
  return FAILURE
202
+ rescue SocketError
203
+ retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')
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
180
211
  end
181
212
  ensure
182
213
  # Reset timeouts to defaults for the next call.
@@ -264,13 +295,13 @@ module OpenTelemetry
264
295
  parent_span_id: span_data.parent_span_id == OpenTelemetry::Trace::INVALID_SPAN_ID ? nil : span_data.parent_span_id,
265
296
  name: span_data.name,
266
297
  kind: as_otlp_span_kind(span_data.kind),
267
- start_time_unix_nano: as_otlp_timestamp(span_data.start_timestamp),
268
- 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,
269
300
  attributes: span_data.attributes&.map { |k, v| as_otlp_key_value(k, v) },
270
301
  dropped_attributes_count: span_data.total_recorded_attributes - span_data.attributes&.size.to_i,
271
302
  events: span_data.events&.map do |event|
272
303
  Opentelemetry::Proto::Trace::V1::Span::Event.new(
273
- time_unix_nano: as_otlp_timestamp(event.timestamp),
304
+ time_unix_nano: event.timestamp,
274
305
  name: event.name,
275
306
  attributes: event.attributes&.map { |k, v| as_otlp_key_value(k, v) }
276
307
  # TODO: track dropped_attributes_count in Span#append_event
@@ -297,10 +328,6 @@ module OpenTelemetry
297
328
  )
298
329
  end
299
330
 
300
- def as_otlp_timestamp(timestamp)
301
- (timestamp.to_r * 1_000_000_000).to_i
302
- end
303
-
304
331
  def as_otlp_span_kind(kind)
305
332
  case kind
306
333
  when :internal then Opentelemetry::Proto::Trace::V1::Span::SpanKind::INTERNAL
@@ -314,6 +341,9 @@ module OpenTelemetry
314
341
 
315
342
  def as_otlp_key_value(key, value)
316
343
  Opentelemetry::Proto::Common::V1::KeyValue.new(key: key, value: as_otlp_any_value(value))
344
+ rescue Encoding::UndefinedConversionError => e
345
+ OpenTelemetry.handle_error(exception: e, message: "encoding error for key #{key} and value #{value}")
346
+ Opentelemetry::Proto::Common::V1::KeyValue.new(key: key, value: as_otlp_any_value('Encoding Error'))
317
347
  end
318
348
 
319
349
  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.15.0'
11
+ VERSION = '0.20.0'
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.15.0
4
+ version: 0.20.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-18 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: google-protobuf
@@ -30,28 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.15.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.15.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.15.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.15.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.15.0/file.CHANGELOG.html
218
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.20.0/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.15.0
221
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.20.0
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