opentelemetry-exporters-jaeger 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e97444ecaef844da8cfdf45cc5c31eb4054cb696a38332ad069708af5a8dfb0
4
- data.tar.gz: 5e27bf072d310f0c6e9960cd1dbe916942517d9fceede6cf5e395ebdabdc153d
3
+ metadata.gz: 6b8094122a7c87fb99806bea6e65ee9709d02eb72423beb628188aa48c6150cc
4
+ data.tar.gz: 8dd6169c58acdd219046376d7b587b9cdf0e288f07ecae968b60226e26b730fb
5
5
  SHA512:
6
- metadata.gz: dbb79b1b786555de5aabdc3b175dce070d2eb0192020908980e08f02b8160f2a30527c92c8d2bdb474d6f51121389a3d0e4becdf657979fb19897a88752d0c43
7
- data.tar.gz: 4cb66565b0d27f6ad6be6726cd9bd6a38e1e65e1b2f1c55b685c0c986e2b4aad3dea2112f83b9553c0c890bbd68d1d4faafe8b802826e6b983d14d5acc38efde
6
+ metadata.gz: dc45983a382a8e7ff1b69bb9b9d97fd07e27c45fd87e336862d8dd4cd36f87f99d031bd7efd0aa81978809900e45944f784eef3b3c55a052774f3bca42a9512c
7
+ data.tar.gz: 1a54265581ea1bf68932cb4f03b770361d99ced6a6b161585eac9a2abf915bbf9d99ca34273d1a7662461137a1f437264d02bd54dc31da05f129336e968fca49
data/.yardopts ADDED
@@ -0,0 +1,9 @@
1
+ --no-private
2
+ --title=OpenTelemetry Jaeger Exporter
3
+ --markup=markdown
4
+ --main=OVERVIEW.md
5
+ ./lib/opentelemetry/exporters/jaeger/**/*.rb
6
+ ./lib/opentelemetry/exporters/jaeger.rb
7
+ -
8
+ OVERVIEW.md
9
+ CHANGELOG.md
data/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # opentelemetry-exporters-jaeger
2
+
3
+ The `opentelemetry-exporters-jaeger` gem provides a Jaeger exporter for OpenTelemetry for Ruby. Using `opentelemetry-exporters-jaeger`, an application can configure OpenTelemetry to export collected tracing data to [Jaeger][jaeger-home].
4
+
5
+ ## What is OpenTelemetry?
6
+
7
+ [OpenTelemetry][opentelemetry-home] is an open source observability framework, providing a general-purpose API, SDK, and related tools required for the instrumentation of cloud-native software, frameworks, and libraries.
8
+
9
+ OpenTelemetry provides a single set of APIs, libraries, agents, and collector services to capture distributed traces and metrics from your application. You can analyze them using Prometheus, Jaeger, and other observability tools.
10
+
11
+ ## How does this gem fit in?
12
+
13
+ The `opentelemetry-exporters-jaeger` gem is a plugin that provides Jaeger Tracing export. To export to Jaeger, an application can include this gem along with `opentelemetry-sdk`, and configure the `SDK` to use the provided Jaeger exporter as a span processor.
14
+
15
+ Generally, *libraries* that produce telemetry data should avoid depending directly on specific exporters, deferring that choice to the application developer.
16
+
17
+ ## How do I get started?
18
+
19
+ Install the gem using:
20
+
21
+ ```
22
+ gem install opentelemetry-sdk
23
+ gem install opentelemetry-exporters-jaeger
24
+ ```
25
+
26
+ Or, if you use [bundler][bundler-home], include `opentelemetry-sdk` in your `Gemfile`.
27
+
28
+ Then, configure the SDK to use the Jaeger exporter as a span processor, and use the OpenTelemetry interfaces to produces traces and other information. Following is a basic example.
29
+
30
+ ```ruby
31
+ require 'opentelemetry/sdk'
32
+ require 'opentelemetry/exporters/jaeger'
33
+
34
+ # Configure the sdk with custom export
35
+ OpenTelemetry::SDK.configure do |c|
36
+ c.add_span_processor(
37
+ OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
38
+ OpenTelemetry::Exporters::Jaeger::Exporter.new(
39
+ service_name: 'my-service', host: 'localhost', port: 6831
40
+ )
41
+ )
42
+ )
43
+ end
44
+
45
+ # To start a trace you need to get a Tracer from the TracerProvider
46
+ tracer = OpenTelemetry.tracer_provider.tracer('my_app_or_gem', '0.1.0')
47
+
48
+ # create a span
49
+ tracer.in_span('foo') do |span|
50
+ # set an attribute
51
+ span.set_attribute('platform', 'osx')
52
+ # add an event
53
+ span.add_event(name: 'event in bar')
54
+ # create bar as child of foo
55
+ tracer.in_span('bar') do |child_span|
56
+ # inspect the span
57
+ pp child_span
58
+ end
59
+ end
60
+ ```
61
+
62
+ For additional examples, see the [examples on github][examples-github].
63
+
64
+ ## How can I get involved?
65
+
66
+ The `opentelemetry-exporters-jaeger` gem source is [on github][repo-github], along with related gems including `opentelemetry-sdk`.
67
+
68
+ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us on our [gitter channel][ruby-gitter] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
69
+
70
+ ## License
71
+
72
+ The `opentelemetry-exporters-jaeger` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
73
+
74
+
75
+ [jaeger-home]: https://www.jaegertracing.io
76
+ [opentelemetry-home]: https://opentelemetry.io
77
+ [bundler-home]: https://bundler.io
78
+ [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
79
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
80
+ [examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/examples
81
+ [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
82
+ [community-meetings]: https://github.com/open-telemetry/community#community-meetings
83
+ [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019 OpenTelemetry Authors
4
+ #
5
+ # SPDX-License-Identifier: Apache-2.0
6
+
7
+ require 'opentelemetry/exporters/jaeger'
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019 OpenTelemetry Authors
4
+ #
5
+ # SPDX-License-Identifier: Apache-2.0
6
+
7
+ require 'opentelemetry/exporters/jaeger/exporter'
8
+ require 'opentelemetry/exporters/jaeger/transport'
9
+ require 'opentelemetry/exporters/jaeger/version'
10
+
11
+ # OpenTelemetry is an open source observability framework, providing a
12
+ # general-purpose API, SDK, and related tools required for the instrumentation
13
+ # of cloud-native software, frameworks, and libraries.
14
+ #
15
+ # The OpenTelemetry module provides global accessors for telemetry objects.
16
+ # See the documentation for the `opentelemetry-api` gem for details.
17
+ module OpenTelemetry
18
+ end
@@ -9,13 +9,13 @@ $LOAD_PATH.push(File.dirname(__FILE__) + '/../../../../thrift/gen-rb')
9
9
  require 'agent'
10
10
  require 'opentelemetry/sdk'
11
11
  require 'socket'
12
- require_relative 'transport'
12
+ require 'opentelemetry/exporters/jaeger/exporter/span_encoder'
13
13
 
14
14
  module OpenTelemetry
15
15
  module Exporters
16
16
  module Jaeger
17
17
  # An OpenTelemetry trace exporter that sends spans over UDP as Thrift Compact encoded Jaeger spans.
18
- class Exporter # rubocop:disable Metrics/ClassLength
18
+ class Exporter
19
19
  SUCCESS = OpenTelemetry::SDK::Trace::Export::SUCCESS
20
20
  FAILED_RETRYABLE = OpenTelemetry::SDK::Trace::Export::FAILED_RETRYABLE
21
21
  FAILED_NOT_RETRYABLE = OpenTelemetry::SDK::Trace::Export::FAILED_NOT_RETRYABLE
@@ -28,6 +28,7 @@ module OpenTelemetry
28
28
  @max_packet_size = max_packet_size
29
29
  @shutdown = false
30
30
  @service_name = service_name
31
+ @span_encoder = SpanEncoder.new
31
32
  end
32
33
 
33
34
  # Called to export sampled {OpenTelemetry::SDK::Trace::SpanData} structs.
@@ -80,43 +81,8 @@ module OpenTelemetry
80
81
  SUCCESS
81
82
  end
82
83
 
83
- def encoded_span(span_data) # rubocop:disable Metrics/AbcSize
84
- start_time = (span_data.start_timestamp.to_f * 1_000_000).to_i
85
- duration = (span_data.end_timestamp.to_f * 1_000_000).to_i - start_time
86
-
87
- Thrift::Span.new(
88
- 'traceIdLow' => int64(span_data.trace_id[16, 16]),
89
- 'traceIdHigh' => int64(span_data.trace_id[0, 16]),
90
- 'spanId' => int64(span_data.span_id),
91
- 'parentSpanId' => int64(span_data.parent_span_id),
92
- 'operationName' => span_data.name,
93
- 'references' => encoded_references(span_data.links),
94
- 'flags' => span_data.trace_flags.sampled? ? 1 : 0,
95
- 'startTime' => start_time,
96
- 'duration' => duration,
97
- 'tags' => encoded_tags(span_data.attributes) + encoded_status(span_data.status) + encoded_kind(span_data.kind),
98
- 'logs' => encoded_logs(span_data.events)
99
- )
100
- end
101
-
102
- def encoded_logs(events)
103
- events&.map do |event|
104
- Thrift::Log.new(
105
- 'timestamp' => (event.timestamp.to_f * 1_000_000).to_i,
106
- 'fields' => encoded_tags(event.attributes) + encoded_tags('name' => event.name)
107
- )
108
- end
109
- end
110
-
111
- def encoded_references(links)
112
- links&.map do |link|
113
- Thrift::SpanRef.new(
114
- 'refType' => Thrift::SpanRefType::CHILD_OF,
115
- 'traceIdLow' => int64(link.context.trace_id[16, 16]),
116
- 'traceIdHigh' => int64(link.context.trace_id[0, 16]),
117
- 'spanId' => int64(link.context.span_id)
118
- )
119
- end
84
+ def encoded_span(span_data)
85
+ @span_encoder.encoded_span(span_data)
120
86
  end
121
87
 
122
88
  EMPTY_ARRAY = [].freeze
@@ -128,61 +94,6 @@ module OpenTelemetry
128
94
  TYPE = Thrift::Tag::FIELDS[Thrift::Tag::VTYPE][:name]
129
95
  private_constant(:EMPTY_ARRAY, :LONG, :DOUBLE, :STRING, :BOOL, :KEY, :TYPE)
130
96
 
131
- def encoded_tags(attributes)
132
- @type_map ||= {
133
- LONG => Thrift::TagType::LONG,
134
- DOUBLE => Thrift::TagType::DOUBLE,
135
- STRING => Thrift::TagType::STRING,
136
- BOOL => Thrift::TagType::BOOL
137
- }.freeze
138
-
139
- attributes&.map do |key, value|
140
- value_key = case value
141
- when Integer then LONG
142
- when Float then DOUBLE
143
- when String then STRING
144
- when false, true then BOOL
145
- end
146
- Thrift::Tag.new(
147
- KEY => key,
148
- TYPE => @type_map[value_key],
149
- value_key => value
150
- )
151
- end || EMPTY_ARRAY
152
- end
153
-
154
- def encoded_status(status)
155
- # TODO: OpenTracing doesn't specify how to report non-HTTP (i.e. generic) status.
156
- EMPTY_ARRAY
157
- end
158
-
159
- def encoded_kind(kind)
160
- @kind_map ||= {
161
- OpenTelemetry::Trace::SpanKind::SERVER => 'server',
162
- OpenTelemetry::Trace::SpanKind::CLIENT => 'client',
163
- OpenTelemetry::Trace::SpanKind::PRODUCER => 'producer',
164
- OpenTelemetry::Trace::SpanKind::CONSUMER => 'consumer'
165
- }.freeze
166
-
167
- value = @kind_map[kind]
168
- if value
169
- Array(
170
- Thrift::Tag.new(
171
- KEY => 'span.kind',
172
- TYPE => Thrift::TagType::STRING,
173
- STRING => value
174
- )
175
- )
176
- else
177
- EMPTY_ARRAY
178
- end
179
- end
180
-
181
- def int64(hex_string)
182
- int = hex_string.to_i(16)
183
- int < (1 << 63) ? int : int - (1 << 64)
184
- end
185
-
186
97
  # @api private
187
98
  class SizingTransport
188
99
  attr_accessor :size
@@ -0,0 +1,117 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2019 OpenTelemetry Authors
4
+ #
5
+ # SPDX-License-Identifier: Apache-2.0
6
+
7
+ module OpenTelemetry
8
+ module Exporters
9
+ module Jaeger
10
+ class Exporter
11
+ # @api private
12
+ class SpanEncoder
13
+ def encoded_span(span_data) # rubocop:disable Metrics/AbcSize
14
+ start_time = (span_data.start_timestamp.to_f * 1_000_000).to_i
15
+ duration = (span_data.end_timestamp.to_f * 1_000_000).to_i - start_time
16
+
17
+ Thrift::Span.new(
18
+ 'traceIdLow' => int64(span_data.trace_id[16, 16]),
19
+ 'traceIdHigh' => int64(span_data.trace_id[0, 16]),
20
+ 'spanId' => int64(span_data.span_id),
21
+ 'parentSpanId' => int64(span_data.parent_span_id),
22
+ 'operationName' => span_data.name,
23
+ 'references' => encoded_references(span_data.links),
24
+ 'flags' => span_data.trace_flags.sampled? ? 1 : 0,
25
+ 'startTime' => start_time,
26
+ 'duration' => duration,
27
+ 'tags' => encoded_tags(span_data.attributes) + encoded_status(span_data.status) + encoded_kind(span_data.kind),
28
+ 'logs' => encoded_logs(span_data.events)
29
+ )
30
+ end
31
+
32
+ private
33
+
34
+ def encoded_kind(kind)
35
+ @kind_map ||= {
36
+ OpenTelemetry::Trace::SpanKind::SERVER => 'server',
37
+ OpenTelemetry::Trace::SpanKind::CLIENT => 'client',
38
+ OpenTelemetry::Trace::SpanKind::PRODUCER => 'producer',
39
+ OpenTelemetry::Trace::SpanKind::CONSUMER => 'consumer'
40
+ }.freeze
41
+
42
+ value = @kind_map[kind]
43
+ if value
44
+ Array(
45
+ Thrift::Tag.new(
46
+ KEY => 'span.kind',
47
+ TYPE => Thrift::TagType::STRING,
48
+ STRING => value
49
+ )
50
+ )
51
+ else
52
+ EMPTY_ARRAY
53
+ end
54
+ end
55
+
56
+ def encoded_logs(events)
57
+ events&.map do |event|
58
+ Thrift::Log.new(
59
+ 'timestamp' => (event.timestamp.to_f * 1_000_000).to_i,
60
+ 'fields' => encoded_tags(event.attributes) + encoded_tags('name' => event.name)
61
+ )
62
+ end
63
+ end
64
+
65
+ def encoded_references(links)
66
+ links&.map do |link|
67
+ Thrift::SpanRef.new(
68
+ 'refType' => Thrift::SpanRefType::CHILD_OF,
69
+ 'traceIdLow' => int64(link.context.trace_id[16, 16]),
70
+ 'traceIdHigh' => int64(link.context.trace_id[0, 16]),
71
+ 'spanId' => int64(link.context.span_id)
72
+ )
73
+ end
74
+ end
75
+
76
+ def encoded_status(status)
77
+ # TODO: OpenTracing doesn't specify how to report non-HTTP (i.e. generic) status.
78
+ EMPTY_ARRAY
79
+ end
80
+
81
+ def encoded_tags(attributes)
82
+ attributes&.map do |key, value|
83
+ encoded_tag(key, value)
84
+ end || EMPTY_ARRAY
85
+ end
86
+
87
+ def encoded_tag(key, value)
88
+ @type_map ||= {
89
+ LONG => Thrift::TagType::LONG,
90
+ DOUBLE => Thrift::TagType::DOUBLE,
91
+ STRING => Thrift::TagType::STRING,
92
+ BOOL => Thrift::TagType::BOOL
93
+ }.freeze
94
+
95
+ value_key = case value
96
+ when Integer then LONG
97
+ when Float then DOUBLE
98
+ when String, Array then STRING
99
+ when false, true then BOOL
100
+ end
101
+ value = value.to_json if value.is_a?(Array)
102
+ Thrift::Tag.new(
103
+ KEY => key,
104
+ TYPE => @type_map[value_key],
105
+ value_key => value
106
+ )
107
+ end
108
+
109
+ def int64(hex_string)
110
+ int = hex_string.to_i(16)
111
+ int < (1 << 63) ? int : int - (1 << 64)
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module Exporters
9
9
  module Jaeger
10
10
  ## Current OpenTelemetry Jaeger exporter version
11
- VERSION = '0.2.0'
11
+ VERSION = '0.3.0'
12
12
  end
13
13
  end
14
14
  end
@@ -0,0 +1,120 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'agent_types'
9
+
10
+ module OpenTelemetry
11
+ module Exporters
12
+ module Jaeger
13
+ module Thrift
14
+ module Agent
15
+ class Client
16
+ include ::Thrift::Client
17
+
18
+ def emitZipkinBatch(spans)
19
+ send_emitZipkinBatch(spans)
20
+ end
21
+
22
+ def send_emitZipkinBatch(spans)
23
+ send_oneway_message('emitZipkinBatch', EmitZipkinBatch_args, :spans => spans)
24
+ end
25
+ def emitBatch(batch)
26
+ send_emitBatch(batch)
27
+ end
28
+
29
+ def send_emitBatch(batch)
30
+ send_oneway_message('emitBatch', EmitBatch_args, :batch => batch)
31
+ end
32
+ end
33
+
34
+ class Processor
35
+ include ::Thrift::Processor
36
+
37
+ def process_emitZipkinBatch(seqid, iprot, oprot)
38
+ args = read_args(iprot, EmitZipkinBatch_args)
39
+ @handler.emitZipkinBatch(args.spans)
40
+ return
41
+ end
42
+
43
+ def process_emitBatch(seqid, iprot, oprot)
44
+ args = read_args(iprot, EmitBatch_args)
45
+ @handler.emitBatch(args.batch)
46
+ return
47
+ end
48
+
49
+ end
50
+
51
+ # HELPER FUNCTIONS AND STRUCTURES
52
+
53
+ class EmitZipkinBatch_args
54
+ include ::Thrift::Struct, ::Thrift::Struct_Union
55
+ SPANS = 1
56
+
57
+ FIELDS = {
58
+ SPANS => {:type => ::Thrift::Types::LIST, :name => 'spans', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::Span}}
59
+ }
60
+
61
+ def struct_fields; FIELDS; end
62
+
63
+ def validate
64
+ end
65
+
66
+ ::Thrift::Struct.generate_accessors self
67
+ end
68
+
69
+ class EmitZipkinBatch_result
70
+ include ::Thrift::Struct, ::Thrift::Struct_Union
71
+
72
+ FIELDS = {
73
+
74
+ }
75
+
76
+ def struct_fields; FIELDS; end
77
+
78
+ def validate
79
+ end
80
+
81
+ ::Thrift::Struct.generate_accessors self
82
+ end
83
+
84
+ class EmitBatch_args
85
+ include ::Thrift::Struct, ::Thrift::Struct_Union
86
+ BATCH = 1
87
+
88
+ FIELDS = {
89
+ BATCH => {:type => ::Thrift::Types::STRUCT, :name => 'batch', :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Batch}
90
+ }
91
+
92
+ def struct_fields; FIELDS; end
93
+
94
+ def validate
95
+ end
96
+
97
+ ::Thrift::Struct.generate_accessors self
98
+ end
99
+
100
+ class EmitBatch_result
101
+ include ::Thrift::Struct, ::Thrift::Struct_Union
102
+
103
+ FIELDS = {
104
+
105
+ }
106
+
107
+ def struct_fields; FIELDS; end
108
+
109
+ def validate
110
+ end
111
+
112
+ ::Thrift::Struct.generate_accessors self
113
+ end
114
+
115
+ end
116
+
117
+ end
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,17 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'agent_types'
9
+
10
+ module OpenTelemetry
11
+ module Exporters
12
+ module Jaeger
13
+ module Thrift
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'jaeger_types'
9
+ require 'zipkincore_types'
10
+
11
+
12
+ module OpenTelemetry
13
+ module Exporters
14
+ module Jaeger
15
+ module Thrift
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,86 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'jaeger_types'
9
+
10
+ module OpenTelemetry
11
+ module Exporters
12
+ module Jaeger
13
+ module Thrift
14
+ module Collector
15
+ class Client
16
+ include ::Thrift::Client
17
+
18
+ def submitBatches(batches)
19
+ send_submitBatches(batches)
20
+ return recv_submitBatches()
21
+ end
22
+
23
+ def send_submitBatches(batches)
24
+ send_message('submitBatches', SubmitBatches_args, :batches => batches)
25
+ end
26
+
27
+ def recv_submitBatches()
28
+ result = receive_message(SubmitBatches_result)
29
+ return result.success unless result.success.nil?
30
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'submitBatches failed: unknown result')
31
+ end
32
+
33
+ end
34
+
35
+ class Processor
36
+ include ::Thrift::Processor
37
+
38
+ def process_submitBatches(seqid, iprot, oprot)
39
+ args = read_args(iprot, SubmitBatches_args)
40
+ result = SubmitBatches_result.new()
41
+ result.success = @handler.submitBatches(args.batches)
42
+ write_result(result, oprot, 'submitBatches', seqid)
43
+ end
44
+
45
+ end
46
+
47
+ # HELPER FUNCTIONS AND STRUCTURES
48
+
49
+ class SubmitBatches_args
50
+ include ::Thrift::Struct, ::Thrift::Struct_Union
51
+ BATCHES = 1
52
+
53
+ FIELDS = {
54
+ BATCHES => {:type => ::Thrift::Types::LIST, :name => 'batches', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Batch}}
55
+ }
56
+
57
+ def struct_fields; FIELDS; end
58
+
59
+ def validate
60
+ end
61
+
62
+ ::Thrift::Struct.generate_accessors self
63
+ end
64
+
65
+ class SubmitBatches_result
66
+ include ::Thrift::Struct, ::Thrift::Struct_Union
67
+ SUCCESS = 0
68
+
69
+ FIELDS = {
70
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::BatchSubmitResponse}}
71
+ }
72
+
73
+ def struct_fields; FIELDS; end
74
+
75
+ def validate
76
+ end
77
+
78
+ ::Thrift::Struct.generate_accessors self
79
+ end
80
+
81
+ end
82
+
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,17 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'jaeger_types'
9
+
10
+ module OpenTelemetry
11
+ module Exporters
12
+ module Jaeger
13
+ module Thrift
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,229 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+
9
+ module OpenTelemetry
10
+ module Exporters
11
+ module Jaeger
12
+ module Thrift
13
+ module TagType
14
+ STRING = 0
15
+ DOUBLE = 1
16
+ BOOL = 2
17
+ LONG = 3
18
+ BINARY = 4
19
+ VALUE_MAP = {0 => "STRING", 1 => "DOUBLE", 2 => "BOOL", 3 => "LONG", 4 => "BINARY"}
20
+ VALID_VALUES = Set.new([STRING, DOUBLE, BOOL, LONG, BINARY]).freeze
21
+ end
22
+
23
+ module SpanRefType
24
+ CHILD_OF = 0
25
+ FOLLOWS_FROM = 1
26
+ VALUE_MAP = {0 => "CHILD_OF", 1 => "FOLLOWS_FROM"}
27
+ VALID_VALUES = Set.new([CHILD_OF, FOLLOWS_FROM]).freeze
28
+ end
29
+
30
+ class Tag; end
31
+
32
+ class Log; end
33
+
34
+ class SpanRef; end
35
+
36
+ class Span; end
37
+
38
+ class Process; end
39
+
40
+ class Batch; end
41
+
42
+ class BatchSubmitResponse; end
43
+
44
+ class Tag
45
+ include ::Thrift::Struct, ::Thrift::Struct_Union
46
+ KEY = 1
47
+ VTYPE = 2
48
+ VSTR = 3
49
+ VDOUBLE = 4
50
+ VBOOL = 5
51
+ VLONG = 6
52
+ VBINARY = 7
53
+
54
+ FIELDS = {
55
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
56
+ VTYPE => {:type => ::Thrift::Types::I32, :name => 'vType', :enum_class => ::OpenTelemetry::Exporters::Jaeger::Thrift::TagType},
57
+ VSTR => {:type => ::Thrift::Types::STRING, :name => 'vStr', :optional => true},
58
+ VDOUBLE => {:type => ::Thrift::Types::DOUBLE, :name => 'vDouble', :optional => true},
59
+ VBOOL => {:type => ::Thrift::Types::BOOL, :name => 'vBool', :optional => true},
60
+ VLONG => {:type => ::Thrift::Types::I64, :name => 'vLong', :optional => true},
61
+ VBINARY => {:type => ::Thrift::Types::STRING, :name => 'vBinary', :binary => true, :optional => true}
62
+ }
63
+
64
+ def struct_fields; FIELDS; end
65
+
66
+ def validate
67
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
68
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field vType is unset!') unless @vType
69
+ unless @vType.nil? || ::OpenTelemetry::Exporters::Jaeger::Thrift::TagType::VALID_VALUES.include?(@vType)
70
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field vType!')
71
+ end
72
+ end
73
+
74
+ ::Thrift::Struct.generate_accessors self
75
+ end
76
+
77
+ class Log
78
+ include ::Thrift::Struct, ::Thrift::Struct_Union
79
+ TIMESTAMP = 1
80
+ FIELDS = 2
81
+
82
+ FIELDS = {
83
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
84
+ FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Tag}}
85
+ }
86
+
87
+ def struct_fields; FIELDS; end
88
+
89
+ def validate
90
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
91
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field fields is unset!') unless @fields
92
+ end
93
+
94
+ ::Thrift::Struct.generate_accessors self
95
+ end
96
+
97
+ class SpanRef
98
+ include ::Thrift::Struct, ::Thrift::Struct_Union
99
+ REFTYPE = 1
100
+ TRACEIDLOW = 2
101
+ TRACEIDHIGH = 3
102
+ SPANID = 4
103
+
104
+ FIELDS = {
105
+ REFTYPE => {:type => ::Thrift::Types::I32, :name => 'refType', :enum_class => ::OpenTelemetry::Exporters::Jaeger::Thrift::SpanRefType},
106
+ TRACEIDLOW => {:type => ::Thrift::Types::I64, :name => 'traceIdLow'},
107
+ TRACEIDHIGH => {:type => ::Thrift::Types::I64, :name => 'traceIdHigh'},
108
+ SPANID => {:type => ::Thrift::Types::I64, :name => 'spanId'}
109
+ }
110
+
111
+ def struct_fields; FIELDS; end
112
+
113
+ def validate
114
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field refType is unset!') unless @refType
115
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field traceIdLow is unset!') unless @traceIdLow
116
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field traceIdHigh is unset!') unless @traceIdHigh
117
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field spanId is unset!') unless @spanId
118
+ unless @refType.nil? || ::OpenTelemetry::Exporters::Jaeger::Thrift::SpanRefType::VALID_VALUES.include?(@refType)
119
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field refType!')
120
+ end
121
+ end
122
+
123
+ ::Thrift::Struct.generate_accessors self
124
+ end
125
+
126
+ class Span
127
+ include ::Thrift::Struct, ::Thrift::Struct_Union
128
+ TRACEIDLOW = 1
129
+ TRACEIDHIGH = 2
130
+ SPANID = 3
131
+ PARENTSPANID = 4
132
+ OPERATIONNAME = 5
133
+ REFERENCES = 6
134
+ FLAGS = 7
135
+ STARTTIME = 8
136
+ DURATION = 9
137
+ TAGS = 10
138
+ LOGS = 11
139
+
140
+ FIELDS = {
141
+ TRACEIDLOW => {:type => ::Thrift::Types::I64, :name => 'traceIdLow'},
142
+ TRACEIDHIGH => {:type => ::Thrift::Types::I64, :name => 'traceIdHigh'},
143
+ SPANID => {:type => ::Thrift::Types::I64, :name => 'spanId'},
144
+ PARENTSPANID => {:type => ::Thrift::Types::I64, :name => 'parentSpanId'},
145
+ OPERATIONNAME => {:type => ::Thrift::Types::STRING, :name => 'operationName'},
146
+ REFERENCES => {:type => ::Thrift::Types::LIST, :name => 'references', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::SpanRef}, :optional => true},
147
+ FLAGS => {:type => ::Thrift::Types::I32, :name => 'flags'},
148
+ STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'},
149
+ DURATION => {:type => ::Thrift::Types::I64, :name => 'duration'},
150
+ TAGS => {:type => ::Thrift::Types::LIST, :name => 'tags', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Tag}, :optional => true},
151
+ LOGS => {:type => ::Thrift::Types::LIST, :name => 'logs', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Log}, :optional => true}
152
+ }
153
+
154
+ def struct_fields; FIELDS; end
155
+
156
+ def validate
157
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field traceIdLow is unset!') unless @traceIdLow
158
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field traceIdHigh is unset!') unless @traceIdHigh
159
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field spanId is unset!') unless @spanId
160
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field parentSpanId is unset!') unless @parentSpanId
161
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationName is unset!') unless @operationName
162
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field flags is unset!') unless @flags
163
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startTime is unset!') unless @startTime
164
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field duration is unset!') unless @duration
165
+ end
166
+
167
+ ::Thrift::Struct.generate_accessors self
168
+ end
169
+
170
+ class Process
171
+ include ::Thrift::Struct, ::Thrift::Struct_Union
172
+ SERVICENAME = 1
173
+ TAGS = 2
174
+
175
+ FIELDS = {
176
+ SERVICENAME => {:type => ::Thrift::Types::STRING, :name => 'serviceName'},
177
+ TAGS => {:type => ::Thrift::Types::LIST, :name => 'tags', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Tag}, :optional => true}
178
+ }
179
+
180
+ def struct_fields; FIELDS; end
181
+
182
+ def validate
183
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field serviceName is unset!') unless @serviceName
184
+ end
185
+
186
+ ::Thrift::Struct.generate_accessors self
187
+ end
188
+
189
+ class Batch
190
+ include ::Thrift::Struct, ::Thrift::Struct_Union
191
+ PROCESS = 1
192
+ SPANS = 2
193
+
194
+ FIELDS = {
195
+ PROCESS => {:type => ::Thrift::Types::STRUCT, :name => 'process', :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Process},
196
+ SPANS => {:type => ::Thrift::Types::LIST, :name => 'spans', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Span}}
197
+ }
198
+
199
+ def struct_fields; FIELDS; end
200
+
201
+ def validate
202
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field process is unset!') unless @process
203
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field spans is unset!') unless @spans
204
+ end
205
+
206
+ ::Thrift::Struct.generate_accessors self
207
+ end
208
+
209
+ class BatchSubmitResponse
210
+ include ::Thrift::Struct, ::Thrift::Struct_Union
211
+ OK = 1
212
+
213
+ FIELDS = {
214
+ OK => {:type => ::Thrift::Types::BOOL, :name => 'ok'}
215
+ }
216
+
217
+ def struct_fields; FIELDS; end
218
+
219
+ def validate
220
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ok is unset!') if @ok.nil?
221
+ end
222
+
223
+ ::Thrift::Struct.generate_accessors self
224
+ end
225
+
226
+ end
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,88 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'zipkincore_types'
9
+
10
+ module OpenTelemetry
11
+ module Exporters
12
+ module Jaeger
13
+ module Thrift
14
+ module Zipkin
15
+ module ZipkinCollector
16
+ class Client
17
+ include ::Thrift::Client
18
+
19
+ def submitZipkinBatch(spans)
20
+ send_submitZipkinBatch(spans)
21
+ return recv_submitZipkinBatch()
22
+ end
23
+
24
+ def send_submitZipkinBatch(spans)
25
+ send_message('submitZipkinBatch', SubmitZipkinBatch_args, :spans => spans)
26
+ end
27
+
28
+ def recv_submitZipkinBatch()
29
+ result = receive_message(SubmitZipkinBatch_result)
30
+ return result.success unless result.success.nil?
31
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'submitZipkinBatch failed: unknown result')
32
+ end
33
+
34
+ end
35
+
36
+ class Processor
37
+ include ::Thrift::Processor
38
+
39
+ def process_submitZipkinBatch(seqid, iprot, oprot)
40
+ args = read_args(iprot, SubmitZipkinBatch_args)
41
+ result = SubmitZipkinBatch_result.new()
42
+ result.success = @handler.submitZipkinBatch(args.spans)
43
+ write_result(result, oprot, 'submitZipkinBatch', seqid)
44
+ end
45
+
46
+ end
47
+
48
+ # HELPER FUNCTIONS AND STRUCTURES
49
+
50
+ class SubmitZipkinBatch_args
51
+ include ::Thrift::Struct, ::Thrift::Struct_Union
52
+ SPANS = 1
53
+
54
+ FIELDS = {
55
+ SPANS => {:type => ::Thrift::Types::LIST, :name => 'spans', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::Span}}
56
+ }
57
+
58
+ def struct_fields; FIELDS; end
59
+
60
+ def validate
61
+ end
62
+
63
+ ::Thrift::Struct.generate_accessors self
64
+ end
65
+
66
+ class SubmitZipkinBatch_result
67
+ include ::Thrift::Struct, ::Thrift::Struct_Union
68
+ SUCCESS = 0
69
+
70
+ FIELDS = {
71
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::Response}}
72
+ }
73
+
74
+ def struct_fields; FIELDS; end
75
+
76
+ def validate
77
+ end
78
+
79
+ ::Thrift::Struct.generate_accessors self
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,51 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'zipkincore_types'
9
+
10
+ module OpenTelemetry
11
+ module Exporters
12
+ module Jaeger
13
+ module Thrift
14
+ module Zipkin
15
+ CLIENT_SEND = %q"cs"
16
+
17
+ CLIENT_RECV = %q"cr"
18
+
19
+ SERVER_SEND = %q"ss"
20
+
21
+ SERVER_RECV = %q"sr"
22
+
23
+ MESSAGE_SEND = %q"ms"
24
+
25
+ MESSAGE_RECV = %q"mr"
26
+
27
+ WIRE_SEND = %q"ws"
28
+
29
+ WIRE_RECV = %q"wr"
30
+
31
+ CLIENT_SEND_FRAGMENT = %q"csf"
32
+
33
+ CLIENT_RECV_FRAGMENT = %q"crf"
34
+
35
+ SERVER_SEND_FRAGMENT = %q"ssf"
36
+
37
+ SERVER_RECV_FRAGMENT = %q"srf"
38
+
39
+ LOCAL_COMPONENT = %q"lc"
40
+
41
+ CLIENT_ADDR = %q"ca"
42
+
43
+ SERVER_ADDR = %q"sa"
44
+
45
+ MESSAGE_ADDR = %q"ma"
46
+
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,241 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (0.12.0)
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+
9
+ module OpenTelemetry
10
+ module Exporters
11
+ module Jaeger
12
+ module Thrift
13
+ module Zipkin
14
+ module AnnotationType
15
+ BOOL = 0
16
+ BYTES = 1
17
+ I16 = 2
18
+ I32 = 3
19
+ I64 = 4
20
+ DOUBLE = 5
21
+ STRING = 6
22
+ VALUE_MAP = {0 => "BOOL", 1 => "BYTES", 2 => "I16", 3 => "I32", 4 => "I64", 5 => "DOUBLE", 6 => "STRING"}
23
+ VALID_VALUES = Set.new([BOOL, BYTES, I16, I32, I64, DOUBLE, STRING]).freeze
24
+ end
25
+
26
+ class Endpoint; end
27
+
28
+ class Annotation; end
29
+
30
+ class BinaryAnnotation; end
31
+
32
+ class Span; end
33
+
34
+ class Response; end
35
+
36
+ # Indicates the network context of a service recording an annotation with two
37
+ # exceptions.
38
+ #
39
+ # When a BinaryAnnotation, and key is CLIENT_ADDR or SERVER_ADDR,
40
+ # the endpoint indicates the source or destination of an RPC. This exception
41
+ # allows zipkin to display network context of uninstrumented services, or
42
+ # clients such as web browsers.
43
+ class Endpoint
44
+ include ::Thrift::Struct, ::Thrift::Struct_Union
45
+ IPV4 = 1
46
+ PORT = 2
47
+ SERVICE_NAME = 3
48
+ IPV6 = 4
49
+
50
+ FIELDS = {
51
+ # IPv4 host address packed into 4 bytes.
52
+ #
53
+ # Ex for the ip 1.2.3.4, it would be (1 << 24) | (2 << 16) | (3 << 8) | 4
54
+ IPV4 => {:type => ::Thrift::Types::I32, :name => 'ipv4'},
55
+ # IPv4 port
56
+ #
57
+ # Note: this is to be treated as an unsigned integer, so watch for negatives.
58
+ #
59
+ # Conventionally, when the port isn't known, port = 0.
60
+ PORT => {:type => ::Thrift::Types::I16, :name => 'port'},
61
+ # Service name in lowercase, such as "memcache" or "zipkin-web"
62
+ #
63
+ # Conventionally, when the service name isn't known, service_name = "unknown".
64
+ SERVICE_NAME => {:type => ::Thrift::Types::STRING, :name => 'service_name'},
65
+ # IPv6 host address packed into 16 bytes. Ex Inet6Address.getBytes()
66
+ IPV6 => {:type => ::Thrift::Types::STRING, :name => 'ipv6', :binary => true, :optional => true}
67
+ }
68
+
69
+ def struct_fields; FIELDS; end
70
+
71
+ def validate
72
+ end
73
+
74
+ ::Thrift::Struct.generate_accessors self
75
+ end
76
+
77
+ # An annotation is similar to a log statement. It includes a host field which
78
+ # allows these events to be attributed properly, and also aggregatable.
79
+ class Annotation
80
+ include ::Thrift::Struct, ::Thrift::Struct_Union
81
+ TIMESTAMP = 1
82
+ VALUE = 2
83
+ HOST = 3
84
+
85
+ FIELDS = {
86
+ # Microseconds from epoch.
87
+ #
88
+ # This value should use the most precise value possible. For example,
89
+ # gettimeofday or syncing nanoTime against a tick of currentTimeMillis.
90
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
91
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'},
92
+ # Always the host that recorded the event. By specifying the host you allow
93
+ # rollup of all events (such as client requests to a service) by IP address.
94
+ HOST => {:type => ::Thrift::Types::STRUCT, :name => 'host', :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::Endpoint, :optional => true}
95
+ }
96
+
97
+ def struct_fields; FIELDS; end
98
+
99
+ def validate
100
+ end
101
+
102
+ ::Thrift::Struct.generate_accessors self
103
+ end
104
+
105
+ # Binary annotations are tags applied to a Span to give it context. For
106
+ # example, a binary annotation of "http.uri" could the path to a resource in a
107
+ # RPC call.
108
+ #
109
+ # Binary annotations of type STRING are always queryable, though more a
110
+ # historical implementation detail than a structural concern.
111
+ #
112
+ # Binary annotations can repeat, and vary on the host. Similar to Annotation,
113
+ # the host indicates who logged the event. This allows you to tell the
114
+ # difference between the client and server side of the same key. For example,
115
+ # the key "http.uri" might be different on the client and server side due to
116
+ # rewriting, like "/api/v1/myresource" vs "/myresource. Via the host field,
117
+ # you can see the different points of view, which often help in debugging.
118
+ class BinaryAnnotation
119
+ include ::Thrift::Struct, ::Thrift::Struct_Union
120
+ KEY = 1
121
+ VALUE = 2
122
+ ANNOTATION_TYPE = 3
123
+ HOST = 4
124
+
125
+ FIELDS = {
126
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
127
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true},
128
+ ANNOTATION_TYPE => {:type => ::Thrift::Types::I32, :name => 'annotation_type', :enum_class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::AnnotationType},
129
+ # The host that recorded tag, which allows you to differentiate between
130
+ # multiple tags with the same key. There are two exceptions to this.
131
+ #
132
+ # When the key is CLIENT_ADDR or SERVER_ADDR, host indicates the source or
133
+ # destination of an RPC. This exception allows zipkin to display network
134
+ # context of uninstrumented services, or clients such as web browsers.
135
+ HOST => {:type => ::Thrift::Types::STRUCT, :name => 'host', :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::Endpoint, :optional => true}
136
+ }
137
+
138
+ def struct_fields; FIELDS; end
139
+
140
+ def validate
141
+ unless @annotation_type.nil? || ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::AnnotationType::VALID_VALUES.include?(@annotation_type)
142
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field annotation_type!')
143
+ end
144
+ end
145
+
146
+ ::Thrift::Struct.generate_accessors self
147
+ end
148
+
149
+ # A trace is a series of spans (often RPC calls) which form a latency tree.
150
+ #
151
+ # The root span is where trace_id = id and parent_id = Nil. The root span is
152
+ # usually the longest interval in the trace, starting with a SERVER_RECV
153
+ # annotation and ending with a SERVER_SEND.
154
+ class Span
155
+ include ::Thrift::Struct, ::Thrift::Struct_Union
156
+ TRACE_ID = 1
157
+ NAME = 3
158
+ ID = 4
159
+ PARENT_ID = 5
160
+ ANNOTATIONS = 6
161
+ BINARY_ANNOTATIONS = 8
162
+ DEBUG = 9
163
+ TIMESTAMP = 10
164
+ DURATION = 11
165
+ TRACE_ID_HIGH = 12
166
+
167
+ FIELDS = {
168
+ TRACE_ID => {:type => ::Thrift::Types::I64, :name => 'trace_id'},
169
+ # Span name in lowercase, rpc method for example
170
+ #
171
+ # Conventionally, when the span name isn't known, name = "unknown".
172
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
173
+ ID => {:type => ::Thrift::Types::I64, :name => 'id'},
174
+ PARENT_ID => {:type => ::Thrift::Types::I64, :name => 'parent_id', :optional => true},
175
+ ANNOTATIONS => {:type => ::Thrift::Types::LIST, :name => 'annotations', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::Annotation}},
176
+ BINARY_ANNOTATIONS => {:type => ::Thrift::Types::LIST, :name => 'binary_annotations', :element => {:type => ::Thrift::Types::STRUCT, :class => ::OpenTelemetry::Exporters::Jaeger::Thrift::Zipkin::BinaryAnnotation}},
177
+ DEBUG => {:type => ::Thrift::Types::BOOL, :name => 'debug', :default => false, :optional => true},
178
+ # Microseconds from epoch of the creation of this span.
179
+ #
180
+ # This value should be set directly by instrumentation, using the most
181
+ # precise value possible. For example, gettimeofday or syncing nanoTime
182
+ # against a tick of currentTimeMillis.
183
+ #
184
+ # For compatibilty with instrumentation that precede this field, collectors
185
+ # or span stores can derive this via Annotation.timestamp.
186
+ # For example, SERVER_RECV.timestamp or CLIENT_SEND.timestamp.
187
+ #
188
+ # This field is optional for compatibility with old data: first-party span
189
+ # stores are expected to support this at time of introduction.
190
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp', :optional => true},
191
+ # Measurement of duration in microseconds, used to support queries.
192
+ #
193
+ # This value should be set directly, where possible. Doing so encourages
194
+ # precise measurement decoupled from problems of clocks, such as skew or NTP
195
+ # updates causing time to move backwards.
196
+ #
197
+ # For compatibilty with instrumentation that precede this field, collectors
198
+ # or span stores can derive this by subtracting Annotation.timestamp.
199
+ # For example, SERVER_SEND.timestamp - SERVER_RECV.timestamp.
200
+ #
201
+ # If this field is persisted as unset, zipkin will continue to work, except
202
+ # duration query support will be implementation-specific. Similarly, setting
203
+ # this field non-atomically is implementation-specific.
204
+ #
205
+ # This field is i64 vs i32 to support spans longer than 35 minutes.
206
+ DURATION => {:type => ::Thrift::Types::I64, :name => 'duration', :optional => true},
207
+ # Optional unique 8-byte additional identifier for a trace. If non zero, this
208
+ # means the trace uses 128 bit traceIds instead of 64 bit.
209
+ TRACE_ID_HIGH => {:type => ::Thrift::Types::I64, :name => 'trace_id_high', :optional => true}
210
+ }
211
+
212
+ def struct_fields; FIELDS; end
213
+
214
+ def validate
215
+ end
216
+
217
+ ::Thrift::Struct.generate_accessors self
218
+ end
219
+
220
+ class Response
221
+ include ::Thrift::Struct, ::Thrift::Struct_Union
222
+ OK = 1
223
+
224
+ FIELDS = {
225
+ OK => {:type => ::Thrift::Types::BOOL, :name => 'ok'}
226
+ }
227
+
228
+ def struct_fields; FIELDS; end
229
+
230
+ def validate
231
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field ok is unset!') if @ok.nil?
232
+ end
233
+
234
+ ::Thrift::Struct.generate_accessors self
235
+ end
236
+
237
+ end
238
+ end
239
+ end
240
+ end
241
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-exporters-jaeger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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: 2019-11-13 00:00:00.000000000 Z
11
+ date: 2020-04-03 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: '0.0'
19
+ version: 0.3.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.0'
26
+ version: 0.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thrift
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -157,11 +157,25 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
+ - ".yardopts"
160
161
  - CHANGELOG.md
161
162
  - LICENSE
163
+ - README.md
164
+ - lib/opentelemetry-exporters-jaeger.rb
165
+ - lib/opentelemetry/exporters/jaeger.rb
162
166
  - lib/opentelemetry/exporters/jaeger/exporter.rb
167
+ - lib/opentelemetry/exporters/jaeger/exporter/span_encoder.rb
163
168
  - lib/opentelemetry/exporters/jaeger/transport.rb
164
169
  - lib/opentelemetry/exporters/jaeger/version.rb
170
+ - thrift/gen-rb/agent.rb
171
+ - thrift/gen-rb/agent_constants.rb
172
+ - thrift/gen-rb/agent_types.rb
173
+ - thrift/gen-rb/collector.rb
174
+ - thrift/gen-rb/jaeger_constants.rb
175
+ - thrift/gen-rb/jaeger_types.rb
176
+ - thrift/gen-rb/zipkin_collector.rb
177
+ - thrift/gen-rb/zipkincore_constants.rb
178
+ - thrift/gen-rb/zipkincore_types.rb
165
179
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
166
180
  licenses:
167
181
  - Apache-2.0