opentelemetry-exporter-otlp 0.13.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +3 -3
- data/lib/opentelemetry/exporter/otlp/exporter.rb +46 -21
- data/lib/opentelemetry/exporter/otlp/version.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b48dea168895acc1c5cb835efd2b3691265c616b8ca19ccfcbc9f2a3b88048fd
|
4
|
+
data.tar.gz: 2ba8c745c8572195935ad47a48583e6f0dc669c3d441d5fa2d263a151de0036d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47053b86edcc9a28e05064ffff4794fd61748c36b184b6afd2f7437ae9ecae2b5bbbe04fcbaaa9834b1f7105a56ee38be5577df232c4c26c6da5d802c48b1763
|
7
|
+
data.tar.gz: 8341c6ef8db9541612d1ccac7c95cc9f1725224a716a86af045851843ca066ca47591f155460a5d2873236856979125be8faa7cc5b11789a7f692f683ad27da9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
# Release History: opentelemetry-exporter-otlp
|
2
2
|
|
3
|
+
### v0.18.0 / 2021-05-21
|
4
|
+
|
5
|
+
* BREAKING CHANGE: Replace Time.now with Process.clock_gettime
|
6
|
+
|
7
|
+
* FIXED: Replace Time.now with Process.clock_gettime
|
8
|
+
* FIXED: Rescue missed otlp exporter network errors
|
9
|
+
|
10
|
+
### v0.17.0 / 2021-04-22
|
11
|
+
|
12
|
+
* ADDED: Add zipkin exporter
|
13
|
+
|
14
|
+
### v0.16.0 / 2021-03-17
|
15
|
+
|
16
|
+
* BREAKING CHANGE: Implement Exporter#force_flush
|
17
|
+
|
18
|
+
* ADDED: Implement Exporter#force_flush
|
19
|
+
* FIXED: Rescue socket err in otlp exporter to prevent failures unable to connect
|
20
|
+
* DOCS: Replace Gitter with GitHub Discussions
|
21
|
+
|
22
|
+
### v0.15.0 / 2021-02-18
|
23
|
+
|
24
|
+
* BREAKING CHANGE: Streamline processor pipeline
|
25
|
+
|
26
|
+
* ADDED: Add otlp exporter hooks
|
27
|
+
* FIXED: Streamline processor pipeline
|
28
|
+
|
29
|
+
### v0.14.0 / 2021-02-03
|
30
|
+
|
31
|
+
* (No significant changes)
|
32
|
+
|
3
33
|
### v0.13.0 / 2021-01-29
|
4
34
|
|
5
35
|
* BREAKING CHANGE: Spec compliance for OTLP exporter
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ 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
|
-
|
42
|
+
OpenTelemetry::Exporter::OTLP::Exporter.new(
|
43
43
|
endpoint: 'http://localhost:55680'
|
44
44
|
)
|
45
45
|
)
|
@@ -69,7 +69,7 @@ For additional examples, see the [examples on github][examples-github].
|
|
69
69
|
|
70
70
|
The `opentelemetry-exporter-otlp` gem source is [on github][repo-github], along with related gems including `opentelemetry-sdk`.
|
71
71
|
|
72
|
-
The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us
|
72
|
+
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
73
|
|
74
74
|
## License
|
75
75
|
|
@@ -84,4 +84,4 @@ The `opentelemetry-exporter-otlp` gem is distributed under the Apache 2.0 licens
|
|
84
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
|
+
[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
|
@@ -41,18 +41,18 @@ module OpenTelemetry
|
|
41
41
|
raise ArgumentError, "unsupported compression key #{compression}" unless compression.nil? || compression == 'gzip'
|
42
42
|
raise ArgumentError, 'headers must be comma-separated k=v pairs or a Hash' unless valid_headers?(headers)
|
43
43
|
|
44
|
-
uri = if endpoint == ENV['OTEL_EXPORTER_OTLP_ENDPOINT']
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
@http = Net::HTTP.new(uri.host, uri.port)
|
51
|
-
@http.use_ssl = uri.scheme == 'https'
|
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'
|
52
52
|
@http.ca_file = certificate_file unless certificate_file.nil?
|
53
53
|
@http.keep_alive_timeout = KEEP_ALIVE_TIMEOUT
|
54
54
|
|
55
|
-
@path = uri.path
|
55
|
+
@path = @uri.path
|
56
56
|
@headers = case headers
|
57
57
|
when String then CSV.parse(headers, col_sep: '=', row_sep: ',').to_h
|
58
58
|
when Hash then headers
|
@@ -60,7 +60,6 @@ module OpenTelemetry
|
|
60
60
|
@timeout = timeout.to_f
|
61
61
|
@compression = compression
|
62
62
|
@metrics_reporter = metrics_reporter || OpenTelemetry::SDK::Trace::Export::MetricsReporter
|
63
|
-
|
64
63
|
@shutdown = false
|
65
64
|
end
|
66
65
|
|
@@ -77,14 +76,24 @@ module OpenTelemetry
|
|
77
76
|
send_bytes(encode(span_data), timeout: timeout)
|
78
77
|
end
|
79
78
|
|
80
|
-
# Called when {OpenTelemetry::SDK::Trace::
|
81
|
-
# this exporter is registered to a {OpenTelemetry::SDK::Trace::
|
79
|
+
# Called when {OpenTelemetry::SDK::Trace::TracerProvider#force_flush} is called, if
|
80
|
+
# this exporter is registered to a {OpenTelemetry::SDK::Trace::TracerProvider}
|
81
|
+
# object.
|
82
|
+
#
|
83
|
+
# @param [optional Numeric] timeout An optional timeout in seconds.
|
84
|
+
def force_flush(timeout: nil)
|
85
|
+
SUCCESS
|
86
|
+
end
|
87
|
+
|
88
|
+
# Called when {OpenTelemetry::SDK::Trace::TracerProvider#shutdown} is called, if
|
89
|
+
# this exporter is registered to a {OpenTelemetry::SDK::Trace::TracerProvider}
|
82
90
|
# object.
|
83
91
|
#
|
84
92
|
# @param [optional Numeric] timeout An optional timeout in seconds.
|
85
93
|
def shutdown(timeout: nil)
|
86
94
|
@shutdown = true
|
87
95
|
@http.finish if @http.started?
|
96
|
+
SUCCESS
|
88
97
|
end
|
89
98
|
|
90
99
|
private
|
@@ -116,11 +125,22 @@ module OpenTelemetry
|
|
116
125
|
true
|
117
126
|
end
|
118
127
|
|
128
|
+
# The around_request is a private method that provides an extension
|
129
|
+
# point for the exporters network calls. The default behaviour
|
130
|
+
# is to not trace these operations.
|
131
|
+
#
|
132
|
+
# An example use case would be to prepend a patch, or extend this class
|
133
|
+
# and override this method's behaviour to explicitly trace the HTTP request.
|
134
|
+
# This would allow you to trace your export pipeline.
|
135
|
+
def around_request
|
136
|
+
OpenTelemetry::Common::Utilities.untraced { yield }
|
137
|
+
end
|
138
|
+
|
119
139
|
def send_bytes(bytes, timeout:) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
120
140
|
retry_count = 0
|
121
141
|
timeout ||= @timeout
|
122
|
-
start_time =
|
123
|
-
|
142
|
+
start_time = OpenTelemetry::Common::Utilities.timeout_timestamp
|
143
|
+
around_request do # rubocop:disable Metrics/BlockLength
|
124
144
|
request = Net::HTTP::Post.new(@path)
|
125
145
|
request.body = if @compression == 'gzip'
|
126
146
|
request.add_field('Content-Encoding', 'gzip')
|
@@ -167,6 +187,15 @@ module OpenTelemetry
|
|
167
187
|
rescue Net::OpenTimeout, Net::ReadTimeout
|
168
188
|
retry if backoff?(retry_count: retry_count += 1, reason: 'timeout')
|
169
189
|
return FAILURE
|
190
|
+
rescue SocketError
|
191
|
+
retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')
|
192
|
+
return FAILURE
|
193
|
+
rescue SystemCallError => e
|
194
|
+
retry if backoff?(retry_count: retry_count += 1, reason: e.class.name)
|
195
|
+
return FAILURE
|
196
|
+
rescue EOFError
|
197
|
+
retry if backoff?(retry_count: retry_count += 1, reason: 'eof_error')
|
198
|
+
return FAILURE
|
170
199
|
end
|
171
200
|
ensure
|
172
201
|
# Reset timeouts to defaults for the next call.
|
@@ -254,13 +283,13 @@ module OpenTelemetry
|
|
254
283
|
parent_span_id: span_data.parent_span_id == OpenTelemetry::Trace::INVALID_SPAN_ID ? nil : span_data.parent_span_id,
|
255
284
|
name: span_data.name,
|
256
285
|
kind: as_otlp_span_kind(span_data.kind),
|
257
|
-
start_time_unix_nano:
|
258
|
-
end_time_unix_nano:
|
286
|
+
start_time_unix_nano: span_data.start_timestamp,
|
287
|
+
end_time_unix_nano: span_data.end_timestamp,
|
259
288
|
attributes: span_data.attributes&.map { |k, v| as_otlp_key_value(k, v) },
|
260
289
|
dropped_attributes_count: span_data.total_recorded_attributes - span_data.attributes&.size.to_i,
|
261
290
|
events: span_data.events&.map do |event|
|
262
291
|
Opentelemetry::Proto::Trace::V1::Span::Event.new(
|
263
|
-
time_unix_nano:
|
292
|
+
time_unix_nano: event.timestamp,
|
264
293
|
name: event.name,
|
265
294
|
attributes: event.attributes&.map { |k, v| as_otlp_key_value(k, v) }
|
266
295
|
# TODO: track dropped_attributes_count in Span#append_event
|
@@ -287,10 +316,6 @@ module OpenTelemetry
|
|
287
316
|
)
|
288
317
|
end
|
289
318
|
|
290
|
-
def as_otlp_timestamp(timestamp)
|
291
|
-
(timestamp.to_r * 1_000_000_000).to_i
|
292
|
-
end
|
293
|
-
|
294
319
|
def as_otlp_span_kind(kind)
|
295
320
|
case kind
|
296
321
|
when :internal then Opentelemetry::Proto::Trace::V1::Span::SpanKind::INTERNAL
|
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.
|
4
|
+
version: 0.18.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-
|
11
|
+
date: 2021-05-21 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.
|
33
|
+
version: 1.0.0.rc1
|
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.
|
40
|
+
version: 1.0.0.rc1
|
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.
|
47
|
+
version: 0.18.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.
|
54
|
+
version: 0.18.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.rc1
|
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.rc1
|
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.
|
218
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.18.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.
|
221
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-otlp/v0.18.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.
|
237
|
+
rubygems_version: 3.1.6
|
224
238
|
signing_key:
|
225
239
|
specification_version: 4
|
226
240
|
summary: OTLP exporter for the OpenTelemetry framework
|