opentelemetry-exporter-zipkin 0.21.0 → 0.22.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce9a72f8ea654dd6f51d8066e93c0cf54833ef7ae7abd5f75420a14be4ff1827
|
4
|
+
data.tar.gz: 95abf49f858e331a719a5f1bd815c67637b8ebacc2ffdd35f432a223fcd42cc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0feb421e2bde5ae20949be3955a155b643efcc438a6355f637cc4afc9cfd9b954a4ca498560f4ef85ddbc5b13df6889b31faa805a8f362e3133ce352bea4026a
|
7
|
+
data.tar.gz: 1ce234a51afb7d73826bf9fb27bd2e6cbc64296ef12bba7d2decabd188e8e1fd79ac9d932ac21fd0323310099286e9143c9f21f3f8e8678f495bb7ff4097bb74
|
data/CHANGELOG.md
CHANGED
@@ -29,7 +29,8 @@ module OpenTelemetry
|
|
29
29
|
|
30
30
|
def initialize(endpoint: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_ENDPOINT', default: 'http://localhost:9411/api/v2/spans'),
|
31
31
|
headers: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_TRACES_HEADERS', 'OTEL_EXPORTER_ZIPKIN_HEADERS'),
|
32
|
-
timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_TRACES_TIMEOUT', 'OTEL_EXPORTER_ZIPKIN_TIMEOUT', default: 10)
|
32
|
+
timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_TRACES_TIMEOUT', 'OTEL_EXPORTER_ZIPKIN_TIMEOUT', default: 10),
|
33
|
+
metrics_reporter: nil)
|
33
34
|
raise ArgumentError, "invalid url for Zipkin::Exporter #{endpoint}" unless OpenTelemetry::Common::Utilities.valid_url?(endpoint)
|
34
35
|
raise ArgumentError, 'headers must be comma-separated k=v pairs or a Hash' unless valid_headers?(headers)
|
35
36
|
|
@@ -50,6 +51,7 @@ module OpenTelemetry
|
|
50
51
|
when Hash then headers
|
51
52
|
end
|
52
53
|
|
54
|
+
@metrics_reporter = metrics_reporter || OpenTelemetry::SDK::Trace::Export::MetricsReporter
|
53
55
|
@shutdown = false
|
54
56
|
end
|
55
57
|
|
@@ -66,6 +68,7 @@ module OpenTelemetry
|
|
66
68
|
zipkin_spans = encode_spans(span_data)
|
67
69
|
send_spans(zipkin_spans, timeout: timeout)
|
68
70
|
rescue StandardError => e
|
71
|
+
@metrics_reporter.add_to_counter('otel.zipkin_exporter.failure', labels: { 'reason' => e.class.to_s })
|
69
72
|
OpenTelemetry.handle_error(exception: e, message: 'unexpected error in Zipkin::Exporter#export')
|
70
73
|
FAILURE
|
71
74
|
end
|
@@ -112,7 +115,7 @@ module OpenTelemetry
|
|
112
115
|
false
|
113
116
|
end
|
114
117
|
|
115
|
-
def send_spans(zipkin_spans, timeout: nil) # rubocop:disable Metrics/
|
118
|
+
def send_spans(zipkin_spans, timeout: nil) # rubocop:disable Metrics/MethodLength
|
116
119
|
retry_count = 0
|
117
120
|
timeout ||= @timeout
|
118
121
|
start_time = OpenTelemetry::Common::Utilities.timeout_timestamp
|
@@ -130,7 +133,7 @@ module OpenTelemetry
|
|
130
133
|
@http.write_timeout = remaining_timeout if WRITE_TIMEOUT_SUPPORTED
|
131
134
|
@http.start unless @http.started?
|
132
135
|
|
133
|
-
response = @http.request(request)
|
136
|
+
response = measure_request_duration { @http.request(request) }
|
134
137
|
response.body # Read and discard body
|
135
138
|
# in opentelemetry-js 200-399 is succcess, in opentelemetry-collector zipkin exporter,200-299 is a success
|
136
139
|
# zipkin api docs list 202 as default success code
|
@@ -171,7 +174,7 @@ module OpenTelemetry
|
|
171
174
|
# TODO: figure out destination and reinitialize @http and @path
|
172
175
|
end
|
173
176
|
|
174
|
-
def backoff?(
|
177
|
+
def backoff?(retry_count:, reason:, retry_after: nil)
|
175
178
|
return false if retry_count > RETRY_COUNT
|
176
179
|
|
177
180
|
# TODO: metric exporter
|
@@ -197,6 +200,19 @@ module OpenTelemetry
|
|
197
200
|
sleep(sleep_interval)
|
198
201
|
true
|
199
202
|
end
|
203
|
+
|
204
|
+
def measure_request_duration
|
205
|
+
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
206
|
+
begin
|
207
|
+
response = yield
|
208
|
+
ensure
|
209
|
+
stop = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
210
|
+
duration_ms = 1000.0 * (stop - start)
|
211
|
+
@metrics_reporter.record_value('otel.zipkin_exporter.request_duration',
|
212
|
+
value: duration_ms,
|
213
|
+
labels: { 'status' => response&.code || 'unknown' })
|
214
|
+
end
|
215
|
+
end
|
200
216
|
end
|
201
217
|
end
|
202
218
|
end
|
@@ -91,7 +91,7 @@ module OpenTelemetry
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
def add_conditional_tags(zipkin_span, span_data, tags, service_name)
|
94
|
+
def add_conditional_tags(zipkin_span, span_data, tags, service_name)
|
95
95
|
dropped_attributes_count = span_data.total_recorded_attributes - span_data.attributes&.size.to_i
|
96
96
|
dropped_events_count = span_data.total_recorded_events - span_data.events&.size.to_i
|
97
97
|
dropped_links_count = span_data.total_recorded_links - span_data.links&.size.to_i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-exporter-zipkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.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:
|
11
|
+
date: 2023-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 1.51.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 1.51.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: simplecov
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,10 +226,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
226
226
|
licenses:
|
227
227
|
- Apache-2.0
|
228
228
|
metadata:
|
229
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.
|
229
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.22.0/file.CHANGELOG.html
|
230
230
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/zipkin
|
231
231
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
232
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.
|
232
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.22.0
|
233
233
|
post_install_message:
|
234
234
|
rdoc_options: []
|
235
235
|
require_paths:
|