opentelemetry-sdk 1.3.2 → 1.4.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: 83a673caf48821ecaaebd3bf954cc674b720eee1727eff03b5094ecd4338971c
|
4
|
+
data.tar.gz: 3fb2937947b640cc86e4ae7d56137bf4cf6683e4f11e378002a56ca8c45506d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3f0135a67fffcb1a50c8d7a639dcd9e02a2b7d8abe61ff9beb3553a2ed1e8d93fbbe08904b46fbbebaa0c913ae6acd3a88c93329168cf00be13f205511bc48f
|
7
|
+
data.tar.gz: 7197e47a5a52adabad0f651b3d7b7a9cc3f5b5f4792e64a20790efb69fc20315ab5fef322ff0798eb6e3ee6eb88e8b25429e5412657cc61fcb19496fbbe79de9
|
data/CHANGELOG.md
CHANGED
@@ -110,7 +110,7 @@ module OpenTelemetry
|
|
110
110
|
remaining_timeout = OpenTelemetry::Common::Utilities.maybe_timeout(timeout, start_time)
|
111
111
|
return TIMEOUT if remaining_timeout&.zero?
|
112
112
|
|
113
|
-
batch = snapshot.shift(@batch_size)
|
113
|
+
batch = snapshot.shift(@batch_size)
|
114
114
|
result_code = export_batch(batch, timeout: remaining_timeout)
|
115
115
|
return result_code unless result_code == SUCCESS
|
116
116
|
end
|
@@ -125,7 +125,7 @@ module OpenTelemetry
|
|
125
125
|
dropped_spans = snapshot.shift(n)
|
126
126
|
report_dropped_spans(dropped_spans, reason: 'buffer-full', function: __method__.to_s)
|
127
127
|
end
|
128
|
-
spans.unshift(snapshot) unless snapshot.empty?
|
128
|
+
spans.unshift(*snapshot) unless snapshot.empty?
|
129
129
|
@condition.signal if spans.size > max_queue_size / 2
|
130
130
|
end
|
131
131
|
end
|
@@ -162,7 +162,7 @@ module OpenTelemetry
|
|
162
162
|
@condition.wait(@mutex, @delay_seconds) while spans.empty? && @keep_running
|
163
163
|
return unless @keep_running
|
164
164
|
|
165
|
-
|
165
|
+
spans.shift(@batch_size)
|
166
166
|
end
|
167
167
|
|
168
168
|
@metrics_reporter.observe_value('otel.bsp.buffer_utilization', value: spans.size / max_queue_size.to_f)
|
@@ -183,24 +183,25 @@ module OpenTelemetry
|
|
183
183
|
OpenTelemetry.handle_error(exception: e, message: 'unexpected error in BatchSpanProcessor#reset_on_fork')
|
184
184
|
end
|
185
185
|
|
186
|
-
def export_batch(
|
186
|
+
def export_batch(span_array, timeout: @exporter_timeout_seconds)
|
187
|
+
batch = span_array.map(&:to_span_data)
|
187
188
|
result_code = @export_mutex.synchronize { @exporter.export(batch, timeout: timeout) }
|
188
|
-
report_result(result_code,
|
189
|
+
report_result(result_code, span_array)
|
189
190
|
result_code
|
190
191
|
rescue StandardError => e
|
191
|
-
report_result(FAILURE,
|
192
|
+
report_result(FAILURE, span_array)
|
192
193
|
@metrics_reporter.add_to_counter('otel.bsp.error', labels: { 'reason' => e.class.to_s })
|
193
194
|
FAILURE
|
194
195
|
end
|
195
196
|
|
196
|
-
def report_result(result_code,
|
197
|
+
def report_result(result_code, span_array)
|
197
198
|
if result_code == SUCCESS
|
198
199
|
@metrics_reporter.add_to_counter('otel.bsp.export.success')
|
199
|
-
@metrics_reporter.add_to_counter('otel.bsp.exported_spans', increment:
|
200
|
+
@metrics_reporter.add_to_counter('otel.bsp.exported_spans', increment: span_array.size)
|
200
201
|
else
|
201
|
-
OpenTelemetry.handle_error(exception: ExportError.new(
|
202
|
+
OpenTelemetry.handle_error(exception: ExportError.new(span_array))
|
202
203
|
@metrics_reporter.add_to_counter('otel.bsp.export.failure')
|
203
|
-
report_dropped_spans(
|
204
|
+
report_dropped_spans(span_array, reason: 'export-failure')
|
204
205
|
end
|
205
206
|
end
|
206
207
|
|
@@ -208,10 +209,6 @@ module OpenTelemetry
|
|
208
209
|
@metrics_reporter.add_to_counter('otel.bsp.dropped_spans', increment: dropped_spans.size, labels: { 'reason' => reason, OpenTelemetry::SemanticConventions::Trace::CODE_FUNCTION => function }.compact)
|
209
210
|
end
|
210
211
|
|
211
|
-
def fetch_batch
|
212
|
-
spans.shift(@batch_size).map!(&:to_span_data)
|
213
|
-
end
|
214
|
-
|
215
212
|
def lock
|
216
213
|
@mutex.synchronize do
|
217
214
|
yield
|
@@ -10,7 +10,19 @@ module OpenTelemetry
|
|
10
10
|
# The Export module contains the built-in exporters and span processors for the OpenTelemetry
|
11
11
|
# reference implementation.
|
12
12
|
module Export
|
13
|
-
|
13
|
+
# Raised when an export fails; spans are available via :spans accessor
|
14
|
+
class ExportError < OpenTelemetry::Error
|
15
|
+
# Returns the {Span} array for this exception
|
16
|
+
#
|
17
|
+
# @return [Array<OpenTelemetry::SDK::Trace::Span>]
|
18
|
+
attr_reader :spans
|
19
|
+
|
20
|
+
# @param [Array<OpenTelemetry::SDK::Trace::Span>] spans the array of spans that failed to export
|
21
|
+
def initialize(spans)
|
22
|
+
super("Unable to export #{spans.size} spans")
|
23
|
+
@spans = spans
|
24
|
+
end
|
25
|
+
end
|
14
26
|
|
15
27
|
# Result codes for the SpanExporter#export method and the SpanProcessor#force_flush and SpanProcessor#shutdown methods.
|
16
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.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: 2024-01-
|
11
|
+
date: 2024-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -294,10 +294,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
294
294
|
licenses:
|
295
295
|
- Apache-2.0
|
296
296
|
metadata:
|
297
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.
|
297
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.4.0/file.CHANGELOG.html
|
298
298
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/sdk
|
299
299
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
300
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.
|
300
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.4.0
|
301
301
|
post_install_message:
|
302
302
|
rdoc_options: []
|
303
303
|
require_paths:
|