opentelemetry-exporter-zipkin 0.19.3 → 0.21.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: dd6c519605d46cb039b9c6cfa9e1f4c9ccf77d73e2dd91bdded8c467e0dac017
4
- data.tar.gz: '020927edcf9e16f812cac49890100d9fcd6c43f82cfdcae060d978fd8b863ab2'
3
+ metadata.gz: d572b09f0066b69a3921976bae352633b33bb14ec8fd6b6967a20dd95734e7f8
4
+ data.tar.gz: c94a8173c854214cacdf1c2e890d9f68069fe39633763d9abc0d6ac533629156
5
5
  SHA512:
6
- metadata.gz: 9c52001d51f6571765a40d0d33f9b28eb088b33e4afa8f73196f06f087cee7a0315009ac0cf36ec0c672f08fafc9927c8d4025b47449354673e033574a12bc3b
7
- data.tar.gz: 257ec494bc828593a4605deea420de31043b2ce6ced9eab2f188594980e258050e03096a8347f782321ba0eb49ac421b77be7a44082b182b38d95b4c8beae6e9
6
+ metadata.gz: 6c1c41d3b801f75b9f2d64bf4f53a31ffa369d86b22b1d8a75be84fa917eaa2be6b189ff58f9570fc87fdf49b0666844dea1befc33013bd2721aebca37273890
7
+ data.tar.gz: 33245dc0a3f436071c00f545d1c0974de109fea5d949264d274e3f3812f62065495fd6c6832c186ffdacc35241f84cc079ba727b1fc2cbf578eb864c1950d4a8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Release History: opentelemetry-exporter-zipkin
2
2
 
3
+ ### v0.21.0 / 2022-09-14
4
+
5
+ * ADDED: Add dropped events/attributes/links counts to zipkin + jaeger exporters
6
+ * ADDED: Support InstrumentationScope, and update OTLP proto to 0.18.0
7
+
8
+ ### v0.20.0 / 2022-06-09
9
+
10
+ * (No significant changes)
11
+
3
12
  ### v0.19.3 / 2021-12-01
4
13
 
5
14
  * FIXED: Change net attribute names to match the semantic conventions spec for http
@@ -27,10 +27,10 @@ module OpenTelemetry
27
27
  WRITE_TIMEOUT_SUPPORTED = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
28
28
  private_constant(:KEEP_ALIVE_TIMEOUT, :RETRY_COUNT, :WRITE_TIMEOUT_SUPPORTED)
29
29
 
30
- def initialize(endpoint: config_opt('OTEL_EXPORTER_ZIPKIN_ENDPOINT', default: 'http://localhost:9411/api/v2/spans'),
31
- headers: config_opt('OTEL_EXPORTER_ZIPKIN_TRACES_HEADERS', 'OTEL_EXPORTER_ZIPKIN_HEADERS'),
32
- timeout: config_opt('OTEL_EXPORTER_ZIPKIN_TRACES_TIMEOUT', 'OTEL_EXPORTER_ZIPKIN_TIMEOUT', default: 10))
33
- raise ArgumentError, "invalid url for Zipkin::Exporter #{endpoint}" if invalid_url?(endpoint)
30
+ def initialize(endpoint: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_ENDPOINT', default: 'http://localhost:9411/api/v2/spans'),
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))
33
+ raise ArgumentError, "invalid url for Zipkin::Exporter #{endpoint}" unless OpenTelemetry::Common::Utilities.valid_url?(endpoint)
34
34
  raise ArgumentError, 'headers must be comma-separated k=v pairs or a Hash' unless valid_headers?(headers)
35
35
 
36
36
  @uri = if endpoint == ENV['OTEL_EXPORTER_ZIPKIN_ENDPOINT']
@@ -94,14 +94,6 @@ module OpenTelemetry
94
94
 
95
95
  private
96
96
 
97
- def config_opt(*env_vars, default: nil)
98
- env_vars.each do |env_var|
99
- val = ENV[env_var]
100
- return val unless val.nil?
101
- end
102
- default
103
- end
104
-
105
97
  def encode_spans(span_data)
106
98
  span_data.map! { |span| Transformer.to_zipkin_span(span, span.resource) }
107
99
  end
@@ -110,15 +102,6 @@ module OpenTelemetry
110
102
  OpenTelemetry::Common::Utilities.untraced { yield }
111
103
  end
112
104
 
113
- def invalid_url?(url)
114
- return true if url.nil? || url.strip.empty?
115
-
116
- URI(url)
117
- false
118
- rescue URI::InvalidURIError
119
- true
120
- end
121
-
122
105
  def valid_headers?(headers)
123
106
  return true if headers.nil? || headers.is_a?(Hash)
124
107
  return false unless headers.is_a?(String)
@@ -129,7 +112,7 @@ module OpenTelemetry
129
112
  false
130
113
  end
131
114
 
132
- def send_spans(zipkin_spans, timeout: nil) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
115
+ def send_spans(zipkin_spans, timeout: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
133
116
  retry_count = 0
134
117
  timeout ||= @timeout
135
118
  start_time = OpenTelemetry::Common::Utilities.timeout_timestamp
@@ -46,7 +46,7 @@ module OpenTelemetry
46
46
  service_name = value if key == SERVICE_NAME_ATTRIBUTE_KEY
47
47
  end
48
48
 
49
- add_il_tags(span_d, tags)
49
+ add_scope_tags(span_d, tags)
50
50
  add_status_tags(span_d, tags)
51
51
  tags = aggregate_span_tags(span_d, tags)
52
52
 
@@ -70,9 +70,12 @@ module OpenTelemetry
70
70
  zipkin_span
71
71
  end
72
72
 
73
- def add_il_tags(span_data, tags)
74
- tags['otel.library.name'] = span_data.instrumentation_library.name
75
- tags['otel.library.version'] = span_data.instrumentation_library.version
73
+ def add_scope_tags(span_data, tags)
74
+ tags['otel.scope.name'] = span_data.instrumentation_scope.name
75
+ tags['otel.library.name'] = span_data.instrumentation_scope.name
76
+
77
+ tags['otel.scope.version'] = span_data.instrumentation_scope.version
78
+ tags['otel.library.version'] = span_data.instrumentation_scope.version
76
79
  end
77
80
 
78
81
  def add_status_tags(span_data, tags)
@@ -88,7 +91,14 @@ module OpenTelemetry
88
91
  end
89
92
  end
90
93
 
91
- def add_conditional_tags(zipkin_span, span_data, tags, service_name)
94
+ def add_conditional_tags(zipkin_span, span_data, tags, service_name) # rubocop:disable Metrics/CyclomaticComplexity
95
+ dropped_attributes_count = span_data.total_recorded_attributes - span_data.attributes&.size.to_i
96
+ dropped_events_count = span_data.total_recorded_events - span_data.events&.size.to_i
97
+ dropped_links_count = span_data.total_recorded_links - span_data.links&.size.to_i
98
+ tags['otel.dropped_attributes_count'] = dropped_attributes_count.to_s if dropped_attributes_count.positive?
99
+ tags['otel.dropped_events_count'] = dropped_events_count.to_s if dropped_events_count.positive?
100
+ tags['otel.dropped_links_count'] = dropped_links_count.to_s if dropped_links_count.positive?
101
+
92
102
  zipkin_span['tags'] = tags unless tags.empty?
93
103
  zipkin_span['kind'] = KIND_MAP[span_data.kind] unless span_data.kind.nil?
94
104
  zipkin_span['parentId'] = span_data.hex_parent_span_id unless span_data.parent_span_id == OpenTelemetry::Trace::INVALID_SPAN_ID
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporter
9
9
  module Zipkin
10
10
  ## Current OpenTelemetry Zipkin exporter version
11
- VERSION = '0.19.3'
11
+ VERSION = '0.21.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-zipkin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.3
4
+ version: 0.21.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-12-01 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,42 +16,56 @@ 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
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.19.3
33
+ version: 0.19.6
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.19.3
40
+ version: 0.19.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: opentelemetry-sdk
43
43
  requirement: !ruby/object:Gem::Requirement
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
+ - !ruby/object:Gem::Dependency
56
+ name: opentelemetry-semantic_conventions
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +108,20 @@ dependencies:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
110
  version: '5.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: opentelemetry-test-helpers
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: rake
99
127
  requirement: !ruby/object:Gem::Requirement
@@ -198,10 +226,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
198
226
  licenses:
199
227
  - Apache-2.0
200
228
  metadata:
201
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.19.3/file.CHANGELOG.html
229
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.21.0/file.CHANGELOG.html
202
230
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/zipkin
203
231
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
204
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.19.3
232
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.21.0
205
233
  post_install_message:
206
234
  rdoc_options: []
207
235
  require_paths:
@@ -210,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
238
  requirements:
211
239
  - - ">="
212
240
  - !ruby/object:Gem::Version
213
- version: 2.5.0
241
+ version: 2.6.0
214
242
  required_rubygems_version: !ruby/object:Gem::Requirement
215
243
  requirements:
216
244
  - - ">="