opentelemetry-exporter-jaeger 0.16.0 → 0.20.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: 036d3930a2fb775518f76fd5c5ac507e7479753928e135fcb412c0c66c40744b
4
- data.tar.gz: 6b7df47b9e09f7b1f8d89d419579f9ca2aa670c39e17c3a242132b4dce20f022
3
+ metadata.gz: 1297e38450263b39efa8be9272a64e37d4fec57e73ed788c5a397af0c5758605
4
+ data.tar.gz: 9bb1f71939abcbaffcb13ff7c943a1d209c1b8b4d12a34f0bbcf7f94b9f75cb9
5
5
  SHA512:
6
- metadata.gz: 546bfecdf9012825b5caf697070aaa605d2fb4b8513f4e1d0102f2acbeb68ce007284cd3bca3860701169ad40d5d4ba6e2457a3e3503c7e347d940ce2b35857b
7
- data.tar.gz: 5e19582e2fd76d6ae072b20f51ddeda54bb24de2157b9986d64fe5c15e1d911eaf41f694bd5e3975020eed64895e1e7d8bb86caf3f9d67e4d071f1cd27aafe08
6
+ metadata.gz: 16f8faf7f6aa03e6c686401a7e54f114dfd01fc4368c700d90d3c76d0327728eb803e570099d8752aa1a3b18f3615440cab67e48d00b748e74059b8e4ceb476b
7
+ data.tar.gz: 728b78cf62a2f98b91882732cbb9e17f214fcae3268c57e5db7a3966e07ee3c5279147876c18ec22ae2890c18dcf9b1887b9e4281fb61cf29bdd4e9ce5b7c815
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Release History: opentelemetry-exporter-jaeger
2
2
 
3
+ ### v0.20.0 / 2021-08-12
4
+
5
+ * ADDED: OTEL_EXPORTER_JAEGER_TIMEOUT env var
6
+ * DOCS: Update docs to rely more on environment variable configuration
7
+
8
+ ### v0.19.0 / 2021-06-23
9
+
10
+ * BREAKING CHANGE: Total order constraint on span.status=
11
+
12
+ * FIXED: Total order constraint on span.status=
13
+
14
+ ### v0.18.0 / 2021-05-21
15
+
16
+ * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
17
+
18
+ * ADDED: Export to jaeger collectors w/ self-signed certs
19
+ * FIXED: Replace Time.now with Process.clock_gettime
20
+ * FIXED: Rename constant to hide warning message
21
+ * FIXED: Index a link trace_id in middle rather than end
22
+
23
+ ### v0.17.0 / 2021-04-22
24
+
25
+ * ADDED: Add zipkin exporter
26
+
3
27
  ### v0.16.0 / 2021-03-17
4
28
 
5
29
  * BREAKING CHANGE: Implement Exporter#force_flush
data/README.md CHANGED
@@ -31,18 +31,27 @@ Then, configure the SDK to use a Jaeger exporter as a span processor, and use th
31
31
  require 'opentelemetry/sdk'
32
32
  require 'opentelemetry/exporter/jaeger'
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::Jaeger::AgentExporter.new(host: '127.0.0.1', port: 6831)
39
- # Alternatively, for the collector exporter:
40
- # exporter: OpenTelemetry::Exporter::Jaeger::CollectorExporter.new(endpoint: 'http://192.168.0.1:14268/api/traces')
41
- )
42
- )
43
- c.service_name = 'jaeger-example'
44
- c.service_version = '0.6.0'
45
- end
34
+ # Configure the sdk with the Jaeger collector exporter
35
+ ENV['OTEL_TRACES_EXPORTER'] = 'jaeger'
36
+
37
+ ENV['OTEL_SERVICE_NAME'] = 'jaeger-example'
38
+ ENV['OTEL_SERVICE_VERSION'] = '0.6.0'
39
+
40
+ # The exporter will connect to localhost:6381 by default. To change:
41
+ # ENV['OTEL_EXPORTER_JAEGER_AGENT_HOST'] = 'some.other.host'
42
+ # ENV['OTEL_EXPORTER_JAEGER_AGENT_PORT'] = 12345
43
+
44
+ # The SDK reads the environment for configuration, so no additional configuration is needed:
45
+ OpenTelemetry::SDK.configure
46
+
47
+ # If you need to use the Jaeger Agent exporter, you will need to configure many things manually:
48
+ # OpenTelemetry::SDK.configure do |c|
49
+ # c.add_span_processor(
50
+ # OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
51
+ # OpenTelemetry::Exporter::Jaeger::AgentExporter.new(host: '127.0.0.1', port: 6831)
52
+ # )
53
+ # )
54
+ # end
46
55
 
47
56
  # To start a trace you need to get a Tracer from the TracerProvider
48
57
  tracer = OpenTelemetry.tracer_provider.tracer('my_app_or_gem', '0.1.0')
@@ -75,11 +84,15 @@ The agent exporter can be configured explicitly in code, as shown above, or via
75
84
 
76
85
  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.
77
86
 
78
- | Parameter | Environment variable | Default |
79
- | ----------- | ------------------------------- | -------------------------- |
80
- | `endpoint:` | `OTEL_EXPORTER_JAEGER_ENDPOINT` | `"http://localhost:14268"` |
81
- | `username:` | `OTEL_EXPORTER_JAEGER_USER` | `nil` |
82
- | `password:` | `OTEL_EXPORTER_JAEGER_PASSWORD` | `nil` |
87
+ | Parameter | Environment variable | Default |
88
+ | ------------------ | ---------------------------------------------- | -------------------------- |
89
+ | `endpoint:` | `OTEL_EXPORTER_JAEGER_ENDPOINT` | `"http://localhost:14268"` |
90
+ | `username:` | `OTEL_EXPORTER_JAEGER_USER` | `nil` |
91
+ | `password:` | `OTEL_EXPORTER_JAEGER_PASSWORD` | `nil` |
92
+ | `ssl_verify_mode:` | `OTEL_RUBY_EXPORTER_JAEGER_SSL_VERIFY_PEER` or | `OpenSSL::SSL:VERIFY_PEER` |
93
+ | | `OTEL_RUBY_EXPORTER_JAEGER_SSL_VERIFY_NONE` | |
94
+
95
+ `ssl_verify_mode:` parameter values should be flags for server certificate verification: `OpenSSL::SSL:VERIFY_PEER` and `OpenSSL::SSL:VERIFY_NONE` are acceptable. These values can also be set using the appropriately named environment variables as shown where `VERIFY_PEER` will take precedence over `VERIFY_NONE`. Please see [the Net::HTTP docs](https://ruby-doc.org/stdlib-2.5.1/libdoc/net/http/rdoc/Net/HTTP.html#verify_mode) for more information about these flags.
83
96
 
84
97
  ## How can I get involved?
85
98
 
@@ -15,6 +15,7 @@ module OpenTelemetry
15
15
 
16
16
  def initialize(host: ENV.fetch('OTEL_EXPORTER_JAEGER_AGENT_HOST', 'localhost'),
17
17
  port: ENV.fetch('OTEL_EXPORTER_JAEGER_AGENT_PORT', 6831),
18
+ timeout: ENV.fetch('OTEL_EXPORTER_JAEGER_TIMEOUT', 10),
18
19
  max_packet_size: 65_000)
19
20
  transport = Transport.new(host, port)
20
21
  protocol = ::Thrift::CompactProtocol.new(transport)
@@ -23,6 +24,7 @@ module OpenTelemetry
23
24
  @shutdown = false
24
25
  @sizing_transport = SizingTransport.new
25
26
  @sizing_protocol = ::Thrift::CompactProtocol.new(@sizing_transport)
27
+ @timeout = timeout.to_f
26
28
  end
27
29
 
28
30
  # Called to export sampled {OpenTelemetry::SDK::Trace::SpanData} structs.
@@ -35,7 +37,8 @@ module OpenTelemetry
35
37
  def export(span_data, timeout: nil)
36
38
  return FAILURE if @shutdown
37
39
 
38
- start_time = Time.now
40
+ timeout ||= @timeout
41
+ start_time = OpenTelemetry::Common::Utilities.timeout_timestamp
39
42
  encoded_batches(span_data) do |batch|
40
43
  return FAILURE if @shutdown || OpenTelemetry::Common::Utilities.maybe_timeout(timeout, start_time)&.zero?
41
44
 
@@ -15,13 +15,26 @@ module OpenTelemetry
15
15
  FAILURE = OpenTelemetry::SDK::Trace::Export::FAILURE
16
16
  private_constant(:SUCCESS, :FAILURE)
17
17
 
18
+ def self.ssl_verify_mode
19
+ if ENV.key?('OTEL_RUBY_EXPORTER_JAEGER_SSL_VERIFY_PEER')
20
+ OpenSSL::SSL::VERIFY_PEER
21
+ elsif ENV.key?('OTEL_RUBY_EXPORTER_JAEGER_SSL_VERIFY_NONE')
22
+ OpenSSL::SSL::VERIFY_NONE
23
+ else
24
+ OpenSSL::SSL::VERIFY_PEER
25
+ end
26
+ end
27
+
18
28
  def initialize(endpoint: ENV.fetch('OTEL_EXPORTER_JAEGER_ENDPOINT', 'http://localhost:14268/api/traces'),
19
29
  username: ENV['OTEL_EXPORTER_JAEGER_USER'],
20
- password: ENV['OTEL_EXPORTER_JAEGER_PASSWORD'])
30
+ password: ENV['OTEL_EXPORTER_JAEGER_PASSWORD'],
31
+ timeout: ENV.fetch('OTEL_EXPORTER_JAEGER_TIMEOUT', 10),
32
+ ssl_verify_mode: CollectorExporter.ssl_verify_mode)
21
33
  raise ArgumentError, "invalid url for Jaeger::CollectorExporter #{endpoint}" if invalid_url?(endpoint)
22
34
  raise ArgumentError, 'username and password should either both be nil or both be set' if username.nil? != password.nil?
23
35
 
24
- @transport = ::Thrift::HTTPClientTransport.new(endpoint)
36
+ transport_opts = { ssl_verify_mode: Integer(ssl_verify_mode) }
37
+ @transport = ::Thrift::HTTPClientTransport.new(endpoint, transport_opts)
25
38
  unless username.nil? || password.nil?
26
39
  authorization = Base64.strict_encode64("#{username}:#{password}")
27
40
  auth_header = { 'Authorization': "Basic #{authorization}" }
@@ -65,8 +65,8 @@ module OpenTelemetry
65
65
  end
66
66
 
67
67
  def encoded_span(span_data) # rubocop:disable Metrics/AbcSize
68
- start_time = (span_data.start_timestamp.to_f * 1_000_000).to_i
69
- duration = (span_data.end_timestamp.to_f * 1_000_000).to_i - start_time
68
+ start_time = span_data.start_timestamp / 1_000
69
+ duration = span_data.end_timestamp / 1_000 - start_time
70
70
 
71
71
  Thrift::Span.new(
72
72
  'traceIdLow' => int64(span_data.trace_id[8, 8]),
@@ -102,7 +102,7 @@ module OpenTelemetry
102
102
  def encoded_logs(events)
103
103
  events&.map do |event|
104
104
  Thrift::Log.new(
105
- 'timestamp' => (event.timestamp.to_f * 1_000_000).to_i,
105
+ 'timestamp' => event.timestamp / 1_000,
106
106
  'fields' => encoded_tags(event.attributes) + encoded_tags('name' => event.name)
107
107
  )
108
108
  end
@@ -112,8 +112,8 @@ module OpenTelemetry
112
112
  links&.map do |link|
113
113
  Thrift::SpanRef.new(
114
114
  'refType' => Thrift::SpanRefType::FOLLOWS_FROM,
115
- 'traceIdLow' => int64(link.span_context.trace_id[16, 16]),
116
- 'traceIdHigh' => int64(link.span_context.trace_id[0, 16]),
115
+ 'traceIdLow' => int64(link.span_context.trace_id[8, 8]),
116
+ 'traceIdHigh' => int64(link.span_context.trace_id[0, 8]),
117
117
  'spanId' => int64(link.span_context.span_id)
118
118
  )
119
119
  end
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporter
9
9
  module Jaeger
10
10
  ## Current OpenTelemetry Jaeger exporter version
11
- VERSION = '0.16.0'
11
+ VERSION = '0.20.0'
12
12
  end
13
13
  end
14
14
  end
@@ -77,11 +77,11 @@ module OpenTelemetry
77
77
  class Log
78
78
  include ::Thrift::Struct, ::Thrift::Struct_Union
79
79
  TIMESTAMP = 1
80
- FIELDS = 2
80
+ FIELDS_LIST = 2
81
81
 
82
82
  FIELDS = {
83
83
  TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
84
- FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporter::Jaeger::Thrift::Tag}}
84
+ FIELDS_LIST => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporter::Jaeger::Thrift::Tag}}
85
85
  }
86
86
 
87
87
  def struct_fields; FIELDS; end
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.16.0
4
+ version: 0.20.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-03-22 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.16.0
19
+ version: 1.0.0.rc3
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.16.0
26
+ version: 1.0.0.rc3
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.16.0
33
+ version: 0.19.1
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.16.0
40
+ version: 0.19.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: opentelemetry-sdk
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.0.rc2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.0.rc2
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: thrift
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -209,10 +223,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
209
223
  licenses:
210
224
  - Apache-2.0
211
225
  metadata:
212
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.16.0/file.CHANGELOG.html
226
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.20.0/file.CHANGELOG.html
213
227
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/jaeger
214
228
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
215
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.16.0
229
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-exporter-jaeger/v0.20.0
216
230
  post_install_message:
217
231
  rdoc_options: []
218
232
  require_paths:
@@ -228,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
242
  - !ruby/object:Gem::Version
229
243
  version: '0'
230
244
  requirements: []
231
- rubygems_version: 3.1.4
245
+ rubygems_version: 3.1.6
232
246
  signing_key:
233
247
  specification_version: 4
234
248
  summary: Jaeger trace exporter for the OpenTelemetry framework