opentelemetry-exporter-otlp 0.11.0 → 0.15.0

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: d07dd6897e62a261598a0ca5319d678e6d996b800f3fc73f2467bcc0c6fa899b
4
- data.tar.gz: b0dbee8a937d627bc025c650dfe8013cac4e92a78a382523cc796ca996b20676
3
+ metadata.gz: f159226c741682d13922c5341f78022583975977c78702972867445edefcc2d6
4
+ data.tar.gz: 4adc231af3cf396b9208d9de07830c3ea618dbbbc3dbf623c42a83e0fd180158
5
5
  SHA512:
6
- metadata.gz: b847b754f84f5c488b9cf0dde660f4f4fc8c14938f07ae0eadc420b95691a4c7fe304cfb7cc43e56a57c496882167cb1b53136ea64b203bfbb7ed072a9e8ad24
7
- data.tar.gz: 67654cd2493a263bf804a30ff4edba3834ba312d27c003baa93e630b59f004b355668af65d687849ff395380183af0b70c918e628789eec3e80f290fe2fbd9ae
6
+ metadata.gz: de253bbeb04969193f98f92eeef816d986f2a0af7a979d0c542e16269dc5b2257eecd57cbfacf452d88eba93853e03afccc08221759e2ff275430730c7204d03
7
+ data.tar.gz: 30f0442ec56900a463c3a83958560e4aa3ebf068e96ea7aef5825a9d6ed358c4a081966e83a17dc9569494764e1e34b27a6b0f31b5f7b713caf5b27ab2685660
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Release History: opentelemetry-exporter-otlp
2
2
 
3
+ ### v0.15.0 / 2021-02-18
4
+
5
+ * BREAKING CHANGE: Streamline processor pipeline
6
+
7
+ * ADDED: Add otlp exporter hooks
8
+ * FIXED: Streamline processor pipeline
9
+
10
+ ### v0.14.0 / 2021-02-03
11
+
12
+ * (No significant changes)
13
+
14
+ ### v0.13.0 / 2021-01-29
15
+
16
+ * BREAKING CHANGE: Spec compliance for OTLP exporter
17
+
18
+ * ADDED: Add untraced wrapper to common utils
19
+ * FIXED: Spec compliance for OTLP exporter
20
+ * FIXED: Conditionally append path to collector endpoint
21
+ * FIXED: OTLP path should be /v1/traces
22
+ * FIXED: Rename OTLP env vars SPAN -> TRACES
23
+
24
+ ### v0.12.1 / 2021-01-13
25
+
26
+ * FIXED: Updated protobuf version dependency
27
+
28
+ ### v0.12.0 / 2020-12-24
29
+
30
+ * (No significant changes)
31
+
3
32
  ### v0.11.0 / 2020-12-11
4
33
 
5
34
  * BREAKING CHANGE: Implement tracestate
data/README.md CHANGED
@@ -39,8 +39,8 @@ require 'opentelemetry/exporter/otlp'
39
39
  OpenTelemetry::SDK.configure do |c|
40
40
  c.add_span_processor(
41
41
  OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
42
- exporter: OpenTelemetry::Exporter::OTLP::Exporter.new(
43
- host: 'localhost', port: 55680
42
+ OpenTelemetry::Exporter::OTLP::Exporter.new(
43
+ endpoint: 'http://localhost:55680'
44
44
  )
45
45
  )
46
46
  )
@@ -80,8 +80,8 @@ The `opentelemetry-exporter-otlp` gem is distributed under the Apache 2.0 licens
80
80
  [opentelemetry-home]: https://opentelemetry.io
81
81
  [bundler-home]: https://bundler.io
82
82
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
83
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
84
- [examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/examples
83
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
84
+ [examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/examples
85
85
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
86
86
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
87
87
  [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
@@ -31,32 +31,35 @@ 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_SPAN_ENDPOINT', 'OTEL_EXPORTER_OTLP_ENDPOINT', default: 'localhost:55681/v1/trace'), # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
35
- insecure: config_opt('OTEL_EXPORTER_OTLP_SPAN_INSECURE', 'OTEL_EXPORTER_OTLP_INSECURE', default: false),
36
- certificate_file: config_opt('OTEL_EXPORTER_OTLP_SPAN_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'),
37
- headers: config_opt('OTEL_EXPORTER_OTLP_SPAN_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS'), # TODO: what format is expected here?
38
- compression: config_opt('OTEL_EXPORTER_OTLP_SPAN_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION'),
39
- timeout: config_opt('OTEL_EXPORTER_OTLP_SPAN_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10),
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
35
+ certificate_file: config_opt('OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE', 'OTEL_EXPORTER_OTLP_CERTIFICATE'),
36
+ headers: config_opt('OTEL_EXPORTER_OTLP_TRACES_HEADERS', 'OTEL_EXPORTER_OTLP_HEADERS'),
37
+ compression: config_opt('OTEL_EXPORTER_OTLP_TRACES_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION'),
38
+ timeout: config_opt('OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10),
40
39
  metrics_reporter: nil)
41
- raise ArgumentError, "invalid url for OTLP::Exporter #{endpoint}" if invalid_url?("http://#{endpoint}")
40
+ raise ArgumentError, "invalid url for OTLP::Exporter #{endpoint}" if invalid_url?(endpoint)
42
41
  raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil? || compression == 'gzip'
43
- raise ArgumentError, 'headers must be comma-separated k:v pairs or a Hash' unless valid_headers?(headers)
42
+ raise ArgumentError, 'headers must be comma-separated k=v pairs or a Hash' unless valid_headers?(headers)
44
43
 
45
- uri = URI "http://#{endpoint}"
46
- @http = Net::HTTP.new(uri.host, uri.port)
47
- @http.use_ssl = insecure.to_s.downcase == 'false'
44
+ @uri = if endpoint == ENV['OTEL_EXPORTER_OTLP_ENDPOINT']
45
+ URI("#{endpoint}/v1/traces")
46
+ else
47
+ URI(endpoint)
48
+ end
49
+
50
+ @http = Net::HTTP.new(@uri.host, @uri.port)
51
+ @http.use_ssl = @uri.scheme == 'https'
48
52
  @http.ca_file = certificate_file unless certificate_file.nil?
49
53
  @http.keep_alive_timeout = KEEP_ALIVE_TIMEOUT
50
54
 
51
- @path = uri.path
55
+ @path = @uri.path
52
56
  @headers = case headers
53
- when String then CSV.parse(headers, col_sep: ':', row_sep: ',').to_h
57
+ when String then CSV.parse(headers, col_sep: '=', row_sep: ',').to_h
54
58
  when Hash then headers
55
59
  end
56
- @timeout = timeout.to_f # TODO: use this as a default timeout when we implement timeouts in https://github.com/open-telemetry/opentelemetry-ruby/pull/341
60
+ @timeout = timeout.to_f
57
61
  @compression = compression
58
62
  @metrics_reporter = metrics_reporter || OpenTelemetry::SDK::Trace::Export::MetricsReporter
59
-
60
63
  @shutdown = false
61
64
  end
62
65
 
@@ -97,7 +100,7 @@ module OpenTelemetry
97
100
  return true if headers.nil? || headers.is_a?(Hash)
98
101
  return false unless headers.is_a?(String)
99
102
 
100
- CSV.parse(headers, col_sep: ':', row_sep: ',').to_h
103
+ CSV.parse(headers, col_sep: '=', row_sep: ',').to_h
101
104
  true
102
105
  rescue ArgumentError
103
106
  false
@@ -106,17 +109,28 @@ module OpenTelemetry
106
109
  def invalid_url?(url)
107
110
  return true if url.nil? || url.strip.empty?
108
111
 
109
- uri = URI(url)
110
- uri.path.nil? || uri.path.empty?
112
+ URI(url)
113
+ false
111
114
  rescue URI::InvalidURIError
112
115
  true
113
116
  end
114
117
 
118
+ # The around_request is a private method that provides an extension
119
+ # point for the exporters network calls. The default behaviour
120
+ # is to not trace these operations.
121
+ #
122
+ # An example use case would be to prepend a patch, or extend this class
123
+ # and override this method's behaviour to explicitly trace the HTTP request.
124
+ # This would allow you to trace your export pipeline.
125
+ def around_request
126
+ OpenTelemetry::Common::Utilities.untraced { yield }
127
+ end
128
+
115
129
  def send_bytes(bytes, timeout:) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
116
130
  retry_count = 0
117
131
  timeout ||= @timeout
118
132
  start_time = Time.now
119
- untraced do # rubocop:disable Metrics/BlockLength
133
+ around_request do # rubocop:disable Metrics/BlockLength
120
134
  request = Net::HTTP::Post.new(@path)
121
135
  request.body = if @compression == 'gzip'
122
136
  request.add_field('Content-Encoding', 'gzip')
@@ -175,10 +189,6 @@ module OpenTelemetry
175
189
  # TODO: figure out destination and reinitialize @http and @path
176
190
  end
177
191
 
178
- def untraced
179
- OpenTelemetry::Trace.with_span(OpenTelemetry::Trace::Span.new) { yield }
180
- end
181
-
182
192
  def measure_request_duration
183
193
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
184
194
  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.11.0'
11
+ VERSION = '0.15.0'
12
12
  end
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,63 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-exporter-otlp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.15.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: 2020-12-11 00:00:00.000000000 Z
11
+ date: 2021-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 3.4.1.1
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '4'
19
+ version: '3.7'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 3.4.1.1
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: '4'
26
+ version: '3.7'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: opentelemetry-api
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: 0.11.0
33
+ version: 0.15.0
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
38
  - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: 0.11.0
40
+ version: 0.15.0
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: opentelemetry-common
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: 0.11.0
47
+ version: 0.15.0
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: 0.11.0
54
+ version: 0.15.0
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: bundler
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -207,10 +201,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
207
201
  licenses:
208
202
  - Apache-2.0
209
203
  metadata:
210
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.11.0/file.CHANGELOG.html
211
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/exporter/otlp
204
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.15.0/file.CHANGELOG.html
205
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp
212
206
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
213
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.11.0
207
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.15.0
214
208
  post_install_message:
215
209
  rdoc_options: []
216
210
  require_paths: