opentelemetry-exporter-zipkin 0.17.0 → 0.19.2

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: b054daf336264f3c07792dc5231cac95857f7d7d25224483d569877bb201b0a8
4
- data.tar.gz: c4dedf69e631a7350079f0afb3a8a195d20aaf000d6193e484bc39eabae2c29b
3
+ metadata.gz: bc1da69b1c635664ff0e4ada80bc9f4cb9bcc95b3dc00c3742bc83c0a71a59f5
4
+ data.tar.gz: 3f3858152593f4f064bba502b407cd6ed7dd4c9b203df8191245bfc891f11286
5
5
  SHA512:
6
- metadata.gz: 4dee5dd0142667689954e0edd3b3b849c1473e7ebb5e272979fb55b81477842f230bc48cc94d430bdf43d8203b1951cc749b88426b7149224ea237dadd76bee7
7
- data.tar.gz: 704ec44365187bd4a8f8d44efefd0778f422e561edf2c720936c9c72515ce12af22a170793d7b4a5bf471a27eaf61aa287b430d2aad4c1fec42e9aa3b2623689
6
+ metadata.gz: 2abf30f17439f4051637e2ccefd133d3a5303e82ba7fede98f7e5a5fe7554f3b0efe06ba22753b769c7976b0de5cfa21cbcb53495cc5c6bb243af05a4d0c5f28
7
+ data.tar.gz: 9d8d7233738a5bed0708e9f895e105cfeb109e43c7a2845aeee69e3c1714a75ae08135b093e004379f28f8062892b83d84222fb583614c1cb68eb848ee37e797
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Release History: opentelemetry-exporter-zipkin
2
2
 
3
+ ### v0.19.2 / 2021-09-29
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.19.1 / 2021-08-12
8
+
9
+ * DOCS: Update docs to rely more on environment variable configuration
10
+
11
+ ### v0.19.0 / 2021-06-23
12
+
13
+ * BREAKING CHANGE: Total order constraint on span.status=
14
+
15
+ * FIXED: Total order constraint on span.status=
16
+
17
+ ### v0.18.0 / 2021-05-21
18
+
19
+ * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
20
+
21
+ * FIXED: Replace Time.now with Process.clock_gettime
22
+
3
23
  ### v0.17.0 / 2021-04-22
4
24
 
5
25
  * Initial release.
data/README.md CHANGED
@@ -31,16 +31,14 @@ Then, configure the SDK to use a zipkin exporter as a span processor, and use th
31
31
  require 'opentelemetry/sdk'
32
32
  require 'opentelemetry/exporter/zipkin'
33
33
 
34
- # Configure the sdk with custom export
35
- OpenTelemetry::SDK.configure do |c|
36
- c.add_span_processor(
37
- OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
38
- OpenTelemetry::Exporter::Zipkin::Exporter.new(endpoint: 'http://192.168.0.1:9411/api/v2/spans' )
39
- )
40
- )
41
- c.service_name = 'zipkin-example'
42
- c.service_version = '0.15.0'
43
- end
34
+ # Select the zipkin exporter via environmental variables
35
+ ENV['OTEL_TRACES_EXPORTER'] = 'zipkin'
36
+
37
+ ENV['OTEL_SERVICE_NAME'] = 'zipkin-example'
38
+ ENV['OTEL_SERVICE_VERSION'] = '0.15.0'
39
+
40
+ # The zipkin expects an exporter running on localhost:9411 - you may override this if needed:
41
+ # ENV['OTEL_EXPORTER_ZIPKIN_ENDPOINT'] = 'http://some.other.host:12345'
44
42
 
45
43
  # To start a trace you need to get a Tracer from the TracerProvider
46
44
  tracer = OpenTelemetry.tracer_provider.tracer('my_app_or_gem', '0.1.0')
@@ -63,7 +61,7 @@ For additional examples, see the [examples on github][examples-github].
63
61
 
64
62
  ## How can I configure the Zipkin exporter?
65
63
 
66
- The collector exporter can be configured explicitly in code, as shown above, or via environment variables. The configuration parameters, environment variables, and defaults are shown below.
64
+ The collector exporter can be configured explicitly in code, or via environment variables as shown above. The configuration parameters, environment variables, and defaults are shown below.
67
65
 
68
66
  | Parameter | Environment variable | Default |
69
67
  | ----------- | --------------------------------------| -------------------------- |
@@ -132,7 +132,7 @@ module OpenTelemetry
132
132
  def send_spans(zipkin_spans, timeout: nil) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
133
133
  retry_count = 0
134
134
  timeout ||= @timeout
135
- start_time = Time.now
135
+ start_time = OpenTelemetry::Common::Utilities.timeout_timestamp
136
136
  around_request do # rubocop:disable Metrics/BlockLength
137
137
  request = Net::HTTP::Post.new(@path)
138
138
  request.body = JSON.generate(zipkin_spans)
@@ -38,8 +38,8 @@ module OpenTelemetry
38
38
  private_constant(:KIND_MAP, :DEFAULT_SERVICE_NAME, :SERVICE_NAME_ATTRIBUTE_KEY, :ERROR_TAG_KEY, :STATUS_CODE_NAME, :STATUS_ERROR, :STATUS_OK, :ATTRIBUTE_PEER_SERVICE, :ATTRIBUTE_NET_PEER_IP, :ATTRIBUTE_NET_PEER_PORT, :ATTRIBUTE_NET_HOST_IP, :ATTRIBUTE_NET_HOST_PORT)
39
39
 
40
40
  def to_zipkin_span(span_d, resource)
41
- start_time = (span_d.start_timestamp.to_f * 1_000_000).to_i
42
- duration = (span_d.end_timestamp.to_f * 1_000_000).to_i - start_time
41
+ start_time = span_d.start_timestamp / 1_000
42
+ duration = span_d.end_timestamp / 1_000 - start_time
43
43
  tags = {}
44
44
  service_name = DEFAULT_SERVICE_NAME
45
45
  resource.attribute_enumerator.select do |key, value|
@@ -91,7 +91,7 @@ module OpenTelemetry
91
91
  def add_conditional_tags(zipkin_span, span_data, tags, service_name)
92
92
  zipkin_span['tags'] = tags unless tags.empty?
93
93
  zipkin_span['kind'] = KIND_MAP[span_data.kind] unless span_data.kind.nil?
94
- zipkin_span['parentId'] = span_data.parent_span_id.unpack1('H*') unless span_data.parent_span_id.nil?
94
+ zipkin_span['parentId'] = span_data.hex_parent_span_id unless span_data.parent_span_id == OpenTelemetry::Trace::INVALID_SPAN_ID
95
95
  zipkin_span['localEndpoint'] = endpoint_from_tags(tags, (span_data.attributes && span_data.attributes[SERVICE_NAME_ATTRIBUTE_KEY]) || service_name)
96
96
  # remote endpoint logic https://github.com/open-telemetry/opentelemetry-collector/blob/347cfa9ab21d47240128c58c9bafcc0014bc729d/translator/trace/zipkin/traces_to_zipkinv2.go#L284
97
97
  zipkin_span['remoteEndpoint'] = endpoint_from_tags(tags, nil)
@@ -107,12 +107,12 @@ module OpenTelemetry
107
107
  events = span_data.events.map do |event|
108
108
  if event.attributes.keys.length.zero?
109
109
  {
110
- timestamp: (event.timestamp.to_f * 1_000_000).to_s,
110
+ timestamp: (event.timestamp / 1_000).to_s,
111
111
  value: event.name
112
112
  }
113
113
  else
114
114
  {
115
- timestamp: (event.timestamp.to_f * 1_000_000).to_s,
115
+ timestamp: (event.timestamp / 1_000).to_s,
116
116
  value: { event.name => event.attributes.transform_values(&:to_s) }.to_json
117
117
  }
118
118
  end
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporter
9
9
  module Zipkin
10
10
  ## Current OpenTelemetry Zipkin exporter version
11
- VERSION = '0.17.0'
11
+ VERSION = '0.19.2'
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.17.0
4
+ version: 0.19.2
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-04-23 00:00:00.000000000 Z
11
+ date: 2021-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.17.0
19
+ version: '1.0'
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: 0.17.0
26
+ version: '1.0'
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.17.0
33
+ version: 0.19.2
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.17.0
40
+ version: 0.19.2
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: 0.17.0
47
+ version: '1.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.17.0
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -198,10 +198,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
198
198
  licenses:
199
199
  - Apache-2.0
200
200
  metadata:
201
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.17.0/file.CHANGELOG.html
201
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.19.2/file.CHANGELOG.html
202
202
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/zipkin
203
203
  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.17.0
204
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-zipkin/v0.19.2
205
205
  post_install_message:
206
206
  rdoc_options: []
207
207
  require_paths: