opentelemetry-exporter-otlp 0.12.1 → 0.13.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: d2e42d5832a5e55dd263643260de2a092d8143b3c575ce1dbb413d6deffefef3
4
- data.tar.gz: 62dca89af13815894f58d9a8732bae13bba9bad76743a53cecd18eaa327a2e55
3
+ metadata.gz: 9fbf898ad6ec63bdad04f4d2d16831be09d77c0b623c68b57db924853c193d3c
4
+ data.tar.gz: 6546ffa54907ff60781d1c4b2e51ceb0e3bf62046e813e820e0de1f807b32a37
5
5
  SHA512:
6
- metadata.gz: 6c6c87c2f2d9c29ac6820724416eb5719069a9d77feb5610b1f35164e1a832163cc5f732434bd9936a44b9c03405fbdcf9e130badb61d4bf2f96ee6fa3404024
7
- data.tar.gz: f8cb8d266ef97c6a7b51c8d08afa93df0632ecbe5f6ca82ec44e27b0904c2a8bfacf213536084ce6fb0ee390ee78012d3915bb685efb5f672f7a7d7ca99e9319
6
+ metadata.gz: fc956ce9f389366057f4dc13bc1de3a66bdde83c2238ee0aa4a87fd362d2834b6e2e6dcf73e95f1218328a49404b4e19fd6aff9b18ef46a2369b9b6db3a3d2af
7
+ data.tar.gz: ff4058399c35eb0092fb707a34c8cf189a135da3a0d7cc038be243413cd8c9a8100203e614b8a31042b461f961b29ab3a7558af9693c488f41606bb27af16895
@@ -1,5 +1,15 @@
1
1
  # Release History: opentelemetry-exporter-otlp
2
2
 
3
+ ### v0.13.0 / 2021-01-29
4
+
5
+ * BREAKING CHANGE: Spec compliance for OTLP exporter
6
+
7
+ * ADDED: Add untraced wrapper to common utils
8
+ * FIXED: Spec compliance for OTLP exporter
9
+ * FIXED: Conditionally append path to collector endpoint
10
+ * FIXED: OTLP path should be /v1/traces
11
+ * FIXED: Rename OTLP env vars SPAN -> TRACES
12
+
3
13
  ### v0.12.1 / 2021-01-13
4
14
 
5
15
  * FIXED: Updated protobuf version dependency
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
  exporter: OpenTelemetry::Exporter::OTLP::Exporter.new(
43
- host: 'localhost', port: 55680
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,29 +31,33 @@ 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)
43
+
44
+ uri = if endpoint == ENV['OTEL_EXPORTER_OTLP_ENDPOINT']
45
+ URI("#{endpoint}/v1/traces")
46
+ else
47
+ URI(endpoint)
48
+ end
44
49
 
45
- uri = URI "http://#{endpoint}"
46
50
  @http = Net::HTTP.new(uri.host, uri.port)
47
- @http.use_ssl = insecure.to_s.downcase == 'false'
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
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
63
 
@@ -97,7 +101,7 @@ module OpenTelemetry
97
101
  return true if headers.nil? || headers.is_a?(Hash)
98
102
  return false unless headers.is_a?(String)
99
103
 
100
- CSV.parse(headers, col_sep: ':', row_sep: ',').to_h
104
+ CSV.parse(headers, col_sep: '=', row_sep: ',').to_h
101
105
  true
102
106
  rescue ArgumentError
103
107
  false
@@ -106,8 +110,8 @@ module OpenTelemetry
106
110
  def invalid_url?(url)
107
111
  return true if url.nil? || url.strip.empty?
108
112
 
109
- uri = URI(url)
110
- uri.path.nil? || uri.path.empty?
113
+ URI(url)
114
+ false
111
115
  rescue URI::InvalidURIError
112
116
  true
113
117
  end
@@ -116,7 +120,7 @@ module OpenTelemetry
116
120
  retry_count = 0
117
121
  timeout ||= @timeout
118
122
  start_time = Time.now
119
- untraced do # rubocop:disable Metrics/BlockLength
123
+ OpenTelemetry::Common::Utilities.untraced do # rubocop:disable Metrics/BlockLength
120
124
  request = Net::HTTP::Post.new(@path)
121
125
  request.body = if @compression == 'gzip'
122
126
  request.add_field('Content-Encoding', 'gzip')
@@ -175,10 +179,6 @@ module OpenTelemetry
175
179
  # TODO: figure out destination and reinitialize @http and @path
176
180
  end
177
181
 
178
- def untraced
179
- OpenTelemetry::Trace.with_span(OpenTelemetry::Trace::Span.new) { yield }
180
- end
181
-
182
182
  def measure_request_duration
183
183
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
184
184
  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.12.1'
11
+ VERSION = '0.13.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.12.1
4
+ version: 0.13.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-01-13 00:00:00.000000000 Z
11
+ date: 2021-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.12.0
33
+ version: 0.13.0
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.12.0
40
+ version: 0.13.0
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.12.0
47
+ version: 0.13.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.12.0
54
+ version: 0.13.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -201,10 +201,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
201
201
  licenses:
202
202
  - Apache-2.0
203
203
  metadata:
204
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.12.1/file.CHANGELOG.html
205
- 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.13.0/file.CHANGELOG.html
205
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp
206
206
  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.12.1
207
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.13.0
208
208
  post_install_message:
209
209
  rdoc_options: []
210
210
  require_paths: