opentelemetry-exporter-otlp 0.7.0 → 0.8.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: 41bcdac16475886dcce6be45e8e1489055086ed69149a1e87aea46a5961ec770
4
- data.tar.gz: 8d89e00696585b6488d1180bb43d1bdf4afbef664d7bf8e39c3d8aa46d632d93
3
+ metadata.gz: ce3f4d8c613bf9c9d54c562aed35d26602363974fc101c161d33dd3f4241da95
4
+ data.tar.gz: 9ebdf5eab072b7854da5f722d3ae9dde312a025c67ac16ffd809f408e3a2cf90
5
5
  SHA512:
6
- metadata.gz: 31e7c1e7a89ff6a8e6e73f846948cb497e6c7b392bfbbf934b989de7c5182007e3e5fd8a6ecc64bb0b48ece3c2bad96eb899e7f9bcedc5b8a04c1eba941d10ee
7
- data.tar.gz: e2a31561c78ee17d87102b79e1cbe45646caae5c220f527e12bb2900a2d9afde80226e437e79a4329e7e582a2983bad8d79ce2dd18db8cabc609dc2ac3f66890
6
+ metadata.gz: c584f93fbf7059a26991b44a51767f49c08f192f45b6328d68fc44531939d4a2cd3286885a62cd325ea5274e1c50341bb6c26a8ea89da87fb8cb4b0c9ef851ca
7
+ data.tar.gz: 2777bbadf94ca8e325ca3466b291f6d9c0e4ece9807963a4adc4d8328d059c783ae5d54a9f4fb81ce99a122c2f8931ad8ffea8dbd996f3b58aba64f966b3efb0
@@ -1,5 +1,16 @@
1
1
  # Release History: opentelemetry-exporter-otlp
2
2
 
3
+ ### v0.8.0 / 2020-10-27
4
+
5
+ * BREAKING CHANGE: Move context/span methods to Trace module
6
+ * BREAKING CHANGE: Remove 'canonical' from status codes
7
+ * BREAKING CHANGE: Assorted SpanContext fixes
8
+
9
+ * FIXED: Move context/span methods to Trace module
10
+ * FIXED: Remove 'canonical' from status codes
11
+ * FIXED: Add gzip support to OTLP exporter
12
+ * FIXED: Assorted SpanContext fixes
13
+
3
14
  ### v0.7.0 / 2020-10-07
4
15
 
5
16
  * FIXED: OTLP parent_span_id should be nil for root
@@ -7,6 +7,7 @@
7
7
  require 'opentelemetry/sdk'
8
8
  require 'net/http'
9
9
  require 'csv'
10
+ require 'zlib'
10
11
 
11
12
  require 'opentelemetry/proto/common/v1/common_pb'
12
13
  require 'opentelemetry/proto/resource/v1/resource_pb'
@@ -36,7 +37,7 @@ module OpenTelemetry
36
37
  compression: config_opt('OTEL_EXPORTER_OTLP_SPAN_COMPRESSION', 'OTEL_EXPORTER_OTLP_COMPRESSION'),
37
38
  timeout: config_opt('OTEL_EXPORTER_OTLP_SPAN_TIMEOUT', 'OTEL_EXPORTER_OTLP_TIMEOUT', default: 10))
38
39
  raise ArgumentError, "invalid url for OTLP::Exporter #{endpoint}" if invalid_url?("http://#{endpoint}")
39
- raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil?
40
+ raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil? || compression == 'gzip'
40
41
  raise ArgumentError, 'headers must be comma-separated k:v pairs or a Hash' unless valid_headers?(headers)
41
42
 
42
43
  uri = URI "http://#{endpoint}"
@@ -53,7 +54,7 @@ module OpenTelemetry
53
54
  when Hash then headers
54
55
  end
55
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
56
- @tracer = OpenTelemetry.tracer_provider.tracer
57
+ @compression = compression
57
58
 
58
59
  @shutdown = false
59
60
  end
@@ -111,11 +112,14 @@ module OpenTelemetry
111
112
  retry_count = 0
112
113
  untraced do # rubocop:disable Metrics/BlockLength
113
114
  request = Net::HTTP::Post.new(@path)
114
- request.body = bytes
115
+ request.body = if @compression == 'gzip'
116
+ request.add_field('Content-Encoding', 'gzip')
117
+ Zlib.gzip(bytes)
118
+ else
119
+ bytes
120
+ end
115
121
  request.add_field('Content-Type', 'application/x-protobuf')
116
122
  @headers&.each { |key, value| request.add_field(key, value) }
117
- # TODO: enable gzip when https://github.com/open-telemetry/opentelemetry-collector/issues/1344 is fixed.
118
- # request.add_field('Content-Encoding', 'gzip')
119
123
 
120
124
  @http.start unless @http.started?
121
125
  response = @http.request(request)
@@ -155,7 +159,7 @@ module OpenTelemetry
155
159
  end
156
160
 
157
161
  def untraced
158
- @tracer.with_span(OpenTelemetry::Trace::Span.new) { yield }
162
+ OpenTelemetry::Trace.with_span(OpenTelemetry::Trace::Span.new) { yield }
159
163
  end
160
164
 
161
165
  def backoff?(retry_after: nil, retry_count:, reason:)
@@ -233,9 +237,9 @@ module OpenTelemetry
233
237
  dropped_events_count: span_data.total_recorded_events - span_data.events&.size.to_i,
234
238
  links: span_data.links&.map do |link|
235
239
  Opentelemetry::Proto::Trace::V1::Span::Link.new(
236
- trace_id: link.context.trace_id,
237
- span_id: link.context.span_id,
238
- trace_state: link.context.tracestate,
240
+ trace_id: link.span_context.trace_id,
241
+ span_id: link.span_context.span_id,
242
+ trace_state: link.span_context.tracestate,
239
243
  attributes: link.attributes&.map { |k, v| as_otlp_key_value(k, v) }
240
244
  # TODO: track dropped_attributes_count in Span#trim_links
241
245
  )
@@ -244,7 +248,7 @@ module OpenTelemetry
244
248
  status: span_data.status&.yield_self do |status|
245
249
  # TODO: fix this based on spec update.
246
250
  Opentelemetry::Proto::Trace::V1::Status.new(
247
- code: status.canonical_code == OpenTelemetry::Trace::Status::ERROR ? Opentelemetry::Proto::Trace::V1::Status::StatusCode::UnknownError : Opentelemetry::Proto::Trace::V1::Status::StatusCode::Ok,
251
+ code: status.code == OpenTelemetry::Trace::Status::ERROR ? Opentelemetry::Proto::Trace::V1::Status::StatusCode::UnknownError : Opentelemetry::Proto::Trace::V1::Status::StatusCode::Ok,
248
252
  message: status.description
249
253
  )
250
254
  end
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporter
9
9
  module OTLP
10
10
  ## Current OpenTelemetry OTLP exporter version
11
- VERSION = '0.7.0'
11
+ VERSION = '0.8.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.7.0
4
+ version: 0.8.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-10-08 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.7.0
39
+ version: 0.8.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.7.0
46
+ version: 0.8.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -192,7 +192,11 @@ files:
192
192
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
193
193
  licenses:
194
194
  - Apache-2.0
195
- metadata: {}
195
+ metadata:
196
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.8.0/file.CHANGELOG.html
197
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/exporter/otlp
198
+ bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
199
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.8.0
196
200
  post_install_message:
197
201
  rdoc_options: []
198
202
  require_paths: