opentelemetry-exporter-jaeger 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: 48eb17dede3682deb82d4d8156074468a58cc9e6cd237c7494b9d037c4d01d50
4
- data.tar.gz: c965382a4bc8bdb7be2970d639422b8c319a315e126d454227c2fea123f6d666
3
+ metadata.gz: f89ac4b784e32860c8bc11bbfc96cbd40684d8b32a3ee9b187a7632e93286d15
4
+ data.tar.gz: d9953776e3c537296d8704bdfc486871b818c01f125d4b9d7368c1fc04887674
5
5
  SHA512:
6
- metadata.gz: e2de52035860293e34621c93b73ec46eccfa4277ab721502526ffa42cb0d65c8e11aeb42df89ad70f8c06c19c7e93d6f62e0bc164fd52858f38952fea641f3f2
7
- data.tar.gz: e0e6da6dbf841643251009e6e64d67d81c65b3946a079fdc00b61ac0b6e9b87923e49dc6d4d1fc36ee123bf7f0337ddf6fc1d48b2fff123d8af300abf6878553
6
+ metadata.gz: 8d61264052748362dc0c4b02f085017176a22eb4436cb1a415fb45328190c3b8a0d2fe7eeb22368ecd72c09da3f0ea04db7f8cb1b7395a94d5d9631223fdb8f1
7
+ data.tar.gz: 9679139b3932b3283021cdc4e0620bba094ffdef05b024060804d22cdcfa0e0002f2f78fb1e56f02bc0b9ad72b0dafaed3a1693cbad502cb83784f1e1de59709
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History: opentelemetry-exporter-jaeger
2
2
 
3
+ ### v0.22.0 / 2022-09-14
4
+
5
+ * ADDED: Add dropped events/attributes/links counts to zipkin + jaeger exporters
6
+ * ADDED: Metrics reporter for Jaeger collector exporter
7
+ * ADDED: Support InstrumentationScope, and update OTLP proto to 0.18.0
8
+
3
9
  ### v0.21.0 / 2022-06-09
4
10
 
5
11
  * (No significant changes)
@@ -29,7 +29,8 @@ module OpenTelemetry
29
29
  username: ENV['OTEL_EXPORTER_JAEGER_USER'],
30
30
  password: ENV['OTEL_EXPORTER_JAEGER_PASSWORD'],
31
31
  timeout: ENV.fetch('OTEL_EXPORTER_JAEGER_TIMEOUT', 10),
32
- ssl_verify_mode: CollectorExporter.ssl_verify_mode)
32
+ ssl_verify_mode: CollectorExporter.ssl_verify_mode,
33
+ metrics_reporter: nil)
33
34
  raise ArgumentError, "invalid url for Jaeger::CollectorExporter #{endpoint}" unless OpenTelemetry::Common::Utilities.valid_url?(endpoint)
34
35
  raise ArgumentError, 'username and password should either both be nil or both be set' if username.nil? != password.nil?
35
36
 
@@ -41,6 +42,7 @@ module OpenTelemetry
41
42
  @transport.add_headers(auth_header)
42
43
  end
43
44
  @serializer = ::Thrift::Serializer.new
45
+ @metrics_reporter = metrics_reporter || OpenTelemetry::SDK::Trace::Export::MetricsReporter
44
46
  @shutdown = false
45
47
  end
46
48
 
@@ -59,10 +61,13 @@ module OpenTelemetry
59
61
  end
60
62
 
61
63
  OpenTelemetry::Common::Utilities.untraced do
62
- @transport.flush
64
+ measure_request_duration do
65
+ @transport.flush
66
+ end
63
67
  end
64
68
  SUCCESS
65
69
  rescue StandardError => e
70
+ @metrics_reporter.add_to_counter('otel.jaeger_exporter.failure', labels: { 'reason' => e.class.to_s })
66
71
  OpenTelemetry.handle_error(exception: e, message: 'unexpected error in Jaeger::CollectorExporter#export')
67
72
  FAILURE
68
73
  end
@@ -95,6 +100,15 @@ module OpenTelemetry
95
100
  Thrift::Batch.new('process' => process, 'spans' => spans)
96
101
  end
97
102
  end
103
+
104
+ def measure_request_duration
105
+ start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
106
+ yield
107
+ ensure
108
+ stop = Process.clock_gettime(Process::CLOCK_MONOTONIC)
109
+ duration_ms = 1000.0 * (stop - start)
110
+ @metrics_reporter.record_value('otel.jaeger_exporter.request_duration', value: duration_ms)
111
+ end
98
112
  end
99
113
  end
100
114
  end
@@ -64,10 +64,23 @@ module OpenTelemetry
64
64
  )
65
65
  end
66
66
 
67
- def encoded_span(span_data) # rubocop:disable Metrics/AbcSize
67
+ def encoded_span(span_data) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity
68
68
  start_time = span_data.start_timestamp / 1_000
69
69
  duration = span_data.end_timestamp / 1_000 - start_time
70
70
 
71
+ tags = encoded_tags(span_data.attributes) +
72
+ encoded_status(span_data.status) +
73
+ encoded_kind(span_data.kind) +
74
+ encoded_instrumentation_scope(span_data.instrumentation_scope)
75
+
76
+ dropped_attributes_count = span_data.total_recorded_attributes - span_data.attributes&.size.to_i
77
+ dropped_events_count = span_data.total_recorded_events - span_data.events&.size.to_i
78
+ dropped_links_count = span_data.total_recorded_links - span_data.links&.size.to_i
79
+
80
+ tags << encoded_tag('otel.dropped_attributes_count', dropped_attributes_count) if dropped_attributes_count.positive?
81
+ tags << encoded_tag('otel.dropped_events_count', dropped_events_count) if dropped_events_count.positive?
82
+ tags << encoded_tag('otel.dropped_links_count', dropped_links_count) if dropped_links_count.positive?
83
+
71
84
  Thrift::Span.new(
72
85
  'traceIdLow' => int64(span_data.trace_id[8, 8]),
73
86
  'traceIdHigh' => int64(span_data.trace_id[0, 8]),
@@ -78,10 +91,7 @@ module OpenTelemetry
78
91
  'flags' => span_data.trace_flags.sampled? ? 1 : 0,
79
92
  'startTime' => start_time,
80
93
  'duration' => duration,
81
- 'tags' => encoded_tags(span_data.attributes) +
82
- encoded_status(span_data.status) +
83
- encoded_kind(span_data.kind) +
84
- encoded_instrumentation_library(span_data.instrumentation_library),
94
+ 'tags' => tags,
85
95
  'logs' => encoded_logs(span_data.events)
86
96
  )
87
97
  end
@@ -131,12 +141,20 @@ module OpenTelemetry
131
141
  )
132
142
  end
133
143
 
134
- def encoded_instrumentation_library(instrumentation_library)
135
- return EMPTY_ARRAY unless instrumentation_library
144
+ def encoded_instrumentation_scope(instrumentation_scope)
145
+ return EMPTY_ARRAY unless instrumentation_scope
136
146
 
137
147
  tags = []
138
- tags << encoded_tag('otel.library.name', instrumentation_library.name) if instrumentation_library.name
139
- tags << encoded_tag('otel.library.version', instrumentation_library.version) if instrumentation_library.version
148
+ if instrumentation_scope.name
149
+ tags << encoded_tag('otel.scope.name', instrumentation_scope.name)
150
+ tags << encoded_tag('otel.library.name', instrumentation_scope.name)
151
+ end
152
+
153
+ if instrumentation_scope.version
154
+ tags << encoded_tag('otel.scope.version', instrumentation_scope.version)
155
+ tags << encoded_tag('otel.library.version', instrumentation_scope.version)
156
+ end
157
+
140
158
  tags
141
159
  end
142
160
 
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporter
9
9
  module Jaeger
10
10
  ## Current OpenTelemetry Jaeger exporter version
11
- VERSION = '0.21.0'
11
+ VERSION = '0.22.0'
12
12
  end
13
13
  end
14
14
  end
@@ -18,7 +18,7 @@ module OpenTelemetry
18
18
  end
19
19
  end
20
20
 
21
- $LOAD_PATH.push(File.dirname(__FILE__) + '/../../../thrift/gen-rb')
21
+ $LOAD_PATH.push("#{File.dirname(__FILE__)}/../../../thrift/gen-rb")
22
22
 
23
23
  require 'agent'
24
24
  require 'collector'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-exporter-jaeger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.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: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: opentelemetry-common
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: '1.2'
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: '1.0'
54
+ version: '1.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: opentelemetry-semantic_conventions
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -150,20 +150,34 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '12.0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rspec-mocks
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rubocop
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
171
  - - "~>"
158
172
  - !ruby/object:Gem::Version
159
- version: 0.73.0
173
+ version: '1.3'
160
174
  type: :development
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
178
  - - "~>"
165
179
  - !ruby/object:Gem::Version
166
- version: 0.73.0
180
+ version: '1.3'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: simplecov
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -251,10 +265,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
251
265
  licenses:
252
266
  - Apache-2.0
253
267
  metadata:
254
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.21.0/file.CHANGELOG.html
268
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.22.0/file.CHANGELOG.html
255
269
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/jaeger
256
270
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
257
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.21.0
271
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.22.0
258
272
  post_install_message:
259
273
  rdoc_options: []
260
274
  require_paths: