opentelemetry-exporter-otlp 0.18.0 → 0.20.2

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: b48dea168895acc1c5cb835efd2b3691265c616b8ca19ccfcbc9f2a3b88048fd
4
- data.tar.gz: 2ba8c745c8572195935ad47a48583e6f0dc669c3d441d5fa2d263a151de0036d
3
+ metadata.gz: eabae53a4290079ccd413e01b67b5a5a6e53b85b8b4ace916e2c57c8c398dd08
4
+ data.tar.gz: 4caeeec6e539984b219fc16c8985358d9d28127340894f39c4dfa06da2035f95
5
5
  SHA512:
6
- metadata.gz: 47053b86edcc9a28e05064ffff4794fd61748c36b184b6afd2f7437ae9ecae2b5bbbe04fcbaaa9834b1f7105a56ee38be5577df232c4c26c6da5d802c48b1763
7
- data.tar.gz: 8341c6ef8db9541612d1ccac7c95cc9f1725224a716a86af045851843ca066ca47591f155460a5d2873236856979125be8faa7cc5b11789a7f692f683ad27da9
6
+ metadata.gz: bc57510d9a199297949b1693ed76fd3b98fd89968a938b941bc694ec8d23b2e3e182ec392ff31ddd55a44470d76a75f7db8531d00caa6c4f7951defb204295fc
7
+ data.tar.gz: 293938d6b178f3582e87a5d60701bef913e3f16b35351d4bfec22f9dd4ff48354034fb6e69b882c326a3f47c360327675430f277e3f080d3a731b2fbea5f9460
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Release History: opentelemetry-exporter-otlp
2
2
 
3
+ ### v0.20.2 / 2021-08-12
4
+
5
+ * FIXED: Add rescue for OpenSSL errors during export
6
+ * DOCS: Update docs to rely more on environment variable configuration
7
+
8
+ ### v0.20.1 / 2021-06-29
9
+
10
+ * FIXED: Otlp encoding exceptions again
11
+
12
+ ### v0.20.0 / 2021-06-23
13
+
14
+ * BREAKING CHANGE: Total order constraint on span.status=
15
+
16
+ * FIXED: Total order constraint on span.status=
17
+
18
+ ### v0.19.0 / 2021-06-03
19
+
20
+ * ADDED: Add a SSL verify mode option for the OTLP exporter
21
+ * FIXED: Handle OTLP exporter encoding exceptions
22
+ * DOCS: Remove the OTLP receiver legacy gRPC port(55680) references
23
+
3
24
  ### v0.18.0 / 2021-05-21
4
25
 
5
26
  * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
data/README.md CHANGED
@@ -35,16 +35,15 @@ Then, configure the SDK to use the OTLP exporter as a span processor, and use th
35
35
  require 'opentelemetry/sdk'
36
36
  require 'opentelemetry/exporter/otlp'
37
37
 
38
- # Configure the sdk with custom export
39
- OpenTelemetry::SDK.configure do |c|
40
- c.add_span_processor(
41
- OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
42
- OpenTelemetry::Exporter::OTLP::Exporter.new(
43
- endpoint: 'http://localhost:55680'
44
- )
45
- )
46
- )
47
- end
38
+ # The OTLP exporter is the default, so no configuration is needed.
39
+ # However, it could be manually selected via an environment variable if required:
40
+ #
41
+ # ENV['OTEL_TRACES_EXPORTER'] = 'otlp'
42
+ #
43
+ # You may also configure various settings via environment variables:
44
+ # ENV['OTEL_EXPORTER_OTLP_COMPRESSION'] = 'gzip'
45
+
46
+ OpenTelemetry::SDK.configure
48
47
 
49
48
  # To start a trace you need to get a Tracer from the TracerProvider
50
49
  tracer = OpenTelemetry.tracer_provider.tracer('my_app_or_gem', '0.1.0')
@@ -65,6 +64,22 @@ end
65
64
 
66
65
  For additional examples, see the [examples on github][examples-github].
67
66
 
67
+ ## How can I configure the OTLP exporter?
68
+
69
+ The collector exporter can be configured explicitly in code, or via environment variables as shown above. The configuration parameters, environment variables, and defaults are shown below.
70
+
71
+ | Parameter | Environment variable | Default |
72
+ | ------------------- | -------------------------------------------- | ----------------------------------- |
73
+ | `endpoint:` | `OTEL_EXPORTER_OTLP_ENDPOINT` | `"http://localhost:4317/v1/traces"` |
74
+ | `certificate_file: `| `OTEL_EXPORTER_OTLP_CERTIFICATE` | |
75
+ | `headers:` | `OTEL_EXPORTER_OTLP_HEADERS` | |
76
+ | `compression:` | `OTEL_EXPORTER_OTLP_COMPRESSION` | |
77
+ | `timeout:` | `OTEL_EXPORTER_OTLP_TIMEOUT` | `10` |
78
+ | `ssl_verify_mode:` | `OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_PEER` or | `OpenSSL::SSL:VERIFY_PEER` |
79
+ | | `OTEL_RUBY_EXPORTER_OTLP_SSL_VERIFY_NONE` | |
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.
82
+
68
83
  ## How can I get involved?
69
84
 
70
85
  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
 
@@ -187,6 +199,9 @@ module OpenTelemetry
187
199
  rescue Net::OpenTimeout, Net::ReadTimeout
188
200
  retry if backoff?(retry_count: retry_count += 1, reason: 'timeout')
189
201
  return FAILURE
202
+ rescue OpenSSL::SSL::SSLError
203
+ retry if backoff?(retry_count: retry_count += 1, reason: 'openssl_error')
204
+ return FAILURE
190
205
  rescue SocketError
191
206
  retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')
192
207
  return FAILURE
@@ -329,6 +344,10 @@ module OpenTelemetry
329
344
 
330
345
  def as_otlp_key_value(key, value)
331
346
  Opentelemetry::Proto::Common::V1::KeyValue.new(key: key, value: as_otlp_any_value(value))
347
+ rescue Encoding::UndefinedConversionError => e
348
+ encoded_value = value.encode('UTF-8', invalid: :replace, undef: :replace, replace: '�')
349
+ OpenTelemetry.handle_error(exception: e, message: "encoding error for key #{key} and value #{encoded_value}")
350
+ Opentelemetry::Proto::Common::V1::KeyValue.new(key: key, value: as_otlp_any_value('Encoding Error'))
332
351
  end
333
352
 
334
353
  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.18.0'
11
+ VERSION = '0.20.2'
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.18.0
4
+ version: 0.20.2
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-05-21 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0.rc1
33
+ version: 1.0.0.rc3
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: 1.0.0.rc1
40
+ version: 1.0.0.rc3
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.18.0
47
+ version: 0.19.1
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.18.0
54
+ version: 0.19.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: opentelemetry-sdk
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0.rc1
61
+ version: 1.0.0.rc2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.0.rc1
68
+ version: 1.0.0.rc2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -215,10 +215,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
215
215
  licenses:
216
216
  - Apache-2.0
217
217
  metadata:
218
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.18.0/file.CHANGELOG.html
218
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.20.2/file.CHANGELOG.html
219
219
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp
220
220
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
221
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.18.0
221
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.20.2
222
222
  post_install_message:
223
223
  rdoc_options: []
224
224
  require_paths: