@opentelemetry/otlp-grpc-exporter-base 0.28.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.
- package/LICENSE +201 -0
- package/README.md +31 -0
- package/build/protos/opentelemetry/proto/collector/README.md +9 -0
- package/build/protos/opentelemetry/proto/collector/logs/v1/logs_service.proto +48 -0
- package/build/protos/opentelemetry/proto/collector/metrics/v1/metrics_service.proto +45 -0
- package/build/protos/opentelemetry/proto/collector/trace/v1/trace_service.proto +45 -0
- package/build/protos/opentelemetry/proto/common/v1/common.proto +77 -0
- package/build/protos/opentelemetry/proto/logs/v1/logs.proto +131 -0
- package/build/protos/opentelemetry/proto/metrics/experimental/configservice.proto +102 -0
- package/build/protos/opentelemetry/proto/metrics/v1/metrics.proto +569 -0
- package/build/protos/opentelemetry/proto/resource/v1/resource.proto +34 -0
- package/build/protos/opentelemetry/proto/trace/v1/trace.proto +315 -0
- package/build/protos/opentelemetry/proto/trace/v1/trace_config.proto +78 -0
- package/build/src/OTLPGRPCExporterNodeBase.d.ts +23 -0
- package/build/src/OTLPGRPCExporterNodeBase.js +89 -0
- package/build/src/OTLPGRPCExporterNodeBase.js.map +1 -0
- package/build/src/index.d.ts +4 -0
- package/build/src/index.js +35 -0
- package/build/src/index.js.map +1 -0
- package/build/src/types.d.ts +30 -0
- package/build/src/types.js +24 -0
- package/build/src/types.js.map +1 -0
- package/build/src/util.d.ts +15 -0
- package/build/src/util.js +127 -0
- package/build/src/util.js.map +1 -0
- package/build/src/version.d.ts +2 -0
- package/build/src/version.js +21 -0
- package/build/src/version.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright 2019, OpenTelemetry Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package opentelemetry.proto.resource.v1;
|
|
18
|
+
|
|
19
|
+
import "opentelemetry/proto/common/v1/common.proto";
|
|
20
|
+
|
|
21
|
+
option java_multiple_files = true;
|
|
22
|
+
option java_package = "io.opentelemetry.proto.resource.v1";
|
|
23
|
+
option java_outer_classname = "ResourceProto";
|
|
24
|
+
option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/resource/v1";
|
|
25
|
+
|
|
26
|
+
// Resource information.
|
|
27
|
+
message Resource {
|
|
28
|
+
// Set of labels that describe the resource.
|
|
29
|
+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 1;
|
|
30
|
+
|
|
31
|
+
// dropped_attributes_count is the number of dropped attributes. If the value is 0, then
|
|
32
|
+
// no attributes were dropped.
|
|
33
|
+
uint32 dropped_attributes_count = 2;
|
|
34
|
+
}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
// Copyright 2019, OpenTelemetry Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package opentelemetry.proto.trace.v1;
|
|
18
|
+
|
|
19
|
+
import "opentelemetry/proto/common/v1/common.proto";
|
|
20
|
+
import "opentelemetry/proto/resource/v1/resource.proto";
|
|
21
|
+
|
|
22
|
+
option java_multiple_files = true;
|
|
23
|
+
option java_package = "io.opentelemetry.proto.trace.v1";
|
|
24
|
+
option java_outer_classname = "TraceProto";
|
|
25
|
+
option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/trace/v1";
|
|
26
|
+
|
|
27
|
+
// A collection of InstrumentationLibrarySpans from a Resource.
|
|
28
|
+
message ResourceSpans {
|
|
29
|
+
// The resource for the spans in this message.
|
|
30
|
+
// If this field is not set then no resource info is known.
|
|
31
|
+
opentelemetry.proto.resource.v1.Resource resource = 1;
|
|
32
|
+
|
|
33
|
+
// A list of InstrumentationLibrarySpans that originate from a resource.
|
|
34
|
+
repeated InstrumentationLibrarySpans instrumentation_library_spans = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// A collection of Spans produced by an InstrumentationLibrary.
|
|
38
|
+
message InstrumentationLibrarySpans {
|
|
39
|
+
// The instrumentation library information for the spans in this message.
|
|
40
|
+
// If this field is not set then no library info is known.
|
|
41
|
+
opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;
|
|
42
|
+
|
|
43
|
+
// A list of Spans that originate from an instrumentation library.
|
|
44
|
+
repeated Span spans = 2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Span represents a single operation within a trace. Spans can be
|
|
48
|
+
// nested to form a trace tree. Spans may also be linked to other spans
|
|
49
|
+
// from the same or different trace and form graphs. Often, a trace
|
|
50
|
+
// contains a root span that describes the end-to-end latency, and one
|
|
51
|
+
// or more subspans for its sub-operations. A trace can also contain
|
|
52
|
+
// multiple root spans, or none at all. Spans do not need to be
|
|
53
|
+
// contiguous - there may be gaps or overlaps between spans in a trace.
|
|
54
|
+
//
|
|
55
|
+
// The next available field id is 17.
|
|
56
|
+
message Span {
|
|
57
|
+
// A unique identifier for a trace. All spans from the same trace share
|
|
58
|
+
// the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
|
|
59
|
+
// is considered invalid.
|
|
60
|
+
//
|
|
61
|
+
// This field is semantically required. Receiver should generate new
|
|
62
|
+
// random trace_id if empty or invalid trace_id was received.
|
|
63
|
+
//
|
|
64
|
+
// This field is required.
|
|
65
|
+
bytes trace_id = 1;
|
|
66
|
+
|
|
67
|
+
// A unique identifier for a span within a trace, assigned when the span
|
|
68
|
+
// is created. The ID is an 8-byte array. An ID with all zeroes is considered
|
|
69
|
+
// invalid.
|
|
70
|
+
//
|
|
71
|
+
// This field is semantically required. Receiver should generate new
|
|
72
|
+
// random span_id if empty or invalid span_id was received.
|
|
73
|
+
//
|
|
74
|
+
// This field is required.
|
|
75
|
+
bytes span_id = 2;
|
|
76
|
+
|
|
77
|
+
// trace_state conveys information about request position in multiple distributed tracing graphs.
|
|
78
|
+
// It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header
|
|
79
|
+
// See also https://github.com/w3c/distributed-tracing for more details about this field.
|
|
80
|
+
string trace_state = 3;
|
|
81
|
+
|
|
82
|
+
// The `span_id` of this span's parent span. If this is a root span, then this
|
|
83
|
+
// field must be empty. The ID is an 8-byte array.
|
|
84
|
+
bytes parent_span_id = 4;
|
|
85
|
+
|
|
86
|
+
// A description of the span's operation.
|
|
87
|
+
//
|
|
88
|
+
// For example, the name can be a qualified method name or a file name
|
|
89
|
+
// and a line number where the operation is called. A best practice is to use
|
|
90
|
+
// the same display name at the same call point in an application.
|
|
91
|
+
// This makes it easier to correlate spans in different traces.
|
|
92
|
+
//
|
|
93
|
+
// This field is semantically required to be set to non-empty string.
|
|
94
|
+
// When null or empty string received - receiver may use string "name"
|
|
95
|
+
// as a replacement. There might be smarted algorithms implemented by
|
|
96
|
+
// receiver to fix the empty span name.
|
|
97
|
+
//
|
|
98
|
+
// This field is required.
|
|
99
|
+
string name = 5;
|
|
100
|
+
|
|
101
|
+
// SpanKind is the type of span. Can be used to specify additional relationships between spans
|
|
102
|
+
// in addition to a parent/child relationship.
|
|
103
|
+
enum SpanKind {
|
|
104
|
+
// Unspecified. Do NOT use as default.
|
|
105
|
+
// Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED.
|
|
106
|
+
SPAN_KIND_UNSPECIFIED = 0;
|
|
107
|
+
|
|
108
|
+
// Indicates that the span represents an internal operation within an application,
|
|
109
|
+
// as opposed to an operations happening at the boundaries. Default value.
|
|
110
|
+
SPAN_KIND_INTERNAL = 1;
|
|
111
|
+
|
|
112
|
+
// Indicates that the span covers server-side handling of an RPC or other
|
|
113
|
+
// remote network request.
|
|
114
|
+
SPAN_KIND_SERVER = 2;
|
|
115
|
+
|
|
116
|
+
// Indicates that the span describes a request to some remote service.
|
|
117
|
+
SPAN_KIND_CLIENT = 3;
|
|
118
|
+
|
|
119
|
+
// Indicates that the span describes a producer sending a message to a broker.
|
|
120
|
+
// Unlike CLIENT and SERVER, there is often no direct critical path latency relationship
|
|
121
|
+
// between producer and consumer spans. A PRODUCER span ends when the message was accepted
|
|
122
|
+
// by the broker while the logical processing of the message might span a much longer time.
|
|
123
|
+
SPAN_KIND_PRODUCER = 4;
|
|
124
|
+
|
|
125
|
+
// Indicates that the span describes consumer receiving a message from a broker.
|
|
126
|
+
// Like the PRODUCER kind, there is often no direct critical path latency relationship
|
|
127
|
+
// between producer and consumer spans.
|
|
128
|
+
SPAN_KIND_CONSUMER = 5;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Distinguishes between spans generated in a particular context. For example,
|
|
132
|
+
// two spans with the same name may be distinguished using `CLIENT` (caller)
|
|
133
|
+
// and `SERVER` (callee) to identify queueing latency associated with the span.
|
|
134
|
+
SpanKind kind = 6;
|
|
135
|
+
|
|
136
|
+
// start_time_unix_nano is the start time of the span. On the client side, this is the time
|
|
137
|
+
// kept by the local machine where the span execution starts. On the server side, this
|
|
138
|
+
// is the time when the server's application handler starts running.
|
|
139
|
+
// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
|
|
140
|
+
//
|
|
141
|
+
// This field is semantically required and it is expected that end_time >= start_time.
|
|
142
|
+
fixed64 start_time_unix_nano = 7;
|
|
143
|
+
|
|
144
|
+
// end_time_unix_nano is the end time of the span. On the client side, this is the time
|
|
145
|
+
// kept by the local machine where the span execution ends. On the server side, this
|
|
146
|
+
// is the time when the server application handler stops running.
|
|
147
|
+
// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
|
|
148
|
+
//
|
|
149
|
+
// This field is semantically required and it is expected that end_time >= start_time.
|
|
150
|
+
fixed64 end_time_unix_nano = 8;
|
|
151
|
+
|
|
152
|
+
// attributes is a collection of key/value pairs. The value can be a string,
|
|
153
|
+
// an integer, a double or the Boolean values `true` or `false`. Note, global attributes
|
|
154
|
+
// like server name can be set using the resource API. Examples of attributes:
|
|
155
|
+
//
|
|
156
|
+
// "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
|
|
157
|
+
// "/http/server_latency": 300
|
|
158
|
+
// "abc.com/myattribute": true
|
|
159
|
+
// "abc.com/score": 10.239
|
|
160
|
+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 9;
|
|
161
|
+
|
|
162
|
+
// dropped_attributes_count is the number of attributes that were discarded. Attributes
|
|
163
|
+
// can be discarded because their keys are too long or because there are too many
|
|
164
|
+
// attributes. If this value is 0, then no attributes were dropped.
|
|
165
|
+
uint32 dropped_attributes_count = 10;
|
|
166
|
+
|
|
167
|
+
// Event is a time-stamped annotation of the span, consisting of user-supplied
|
|
168
|
+
// text description and key-value pairs.
|
|
169
|
+
message Event {
|
|
170
|
+
// time_unix_nano is the time the event occurred.
|
|
171
|
+
fixed64 time_unix_nano = 1;
|
|
172
|
+
|
|
173
|
+
// name of the event.
|
|
174
|
+
// This field is semantically required to be set to non-empty string.
|
|
175
|
+
string name = 2;
|
|
176
|
+
|
|
177
|
+
// attributes is a collection of attribute key/value pairs on the event.
|
|
178
|
+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 3;
|
|
179
|
+
|
|
180
|
+
// dropped_attributes_count is the number of dropped attributes. If the value is 0,
|
|
181
|
+
// then no attributes were dropped.
|
|
182
|
+
uint32 dropped_attributes_count = 4;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// events is a collection of Event items.
|
|
186
|
+
repeated Event events = 11;
|
|
187
|
+
|
|
188
|
+
// dropped_events_count is the number of dropped events. If the value is 0, then no
|
|
189
|
+
// events were dropped.
|
|
190
|
+
uint32 dropped_events_count = 12;
|
|
191
|
+
|
|
192
|
+
// A pointer from the current span to another span in the same trace or in a
|
|
193
|
+
// different trace. For example, this can be used in batching operations,
|
|
194
|
+
// where a single batch handler processes multiple requests from different
|
|
195
|
+
// traces or when the handler receives a request from a different project.
|
|
196
|
+
message Link {
|
|
197
|
+
// A unique identifier of a trace that this linked span is part of. The ID is a
|
|
198
|
+
// 16-byte array.
|
|
199
|
+
bytes trace_id = 1;
|
|
200
|
+
|
|
201
|
+
// A unique identifier for the linked span. The ID is an 8-byte array.
|
|
202
|
+
bytes span_id = 2;
|
|
203
|
+
|
|
204
|
+
// The trace_state associated with the link.
|
|
205
|
+
string trace_state = 3;
|
|
206
|
+
|
|
207
|
+
// attributes is a collection of attribute key/value pairs on the link.
|
|
208
|
+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 4;
|
|
209
|
+
|
|
210
|
+
// dropped_attributes_count is the number of dropped attributes. If the value is 0,
|
|
211
|
+
// then no attributes were dropped.
|
|
212
|
+
uint32 dropped_attributes_count = 5;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// links is a collection of Links, which are references from this span to a span
|
|
216
|
+
// in the same or different trace.
|
|
217
|
+
repeated Link links = 13;
|
|
218
|
+
|
|
219
|
+
// dropped_links_count is the number of dropped links after the maximum size was
|
|
220
|
+
// enforced. If this value is 0, then no links were dropped.
|
|
221
|
+
uint32 dropped_links_count = 14;
|
|
222
|
+
|
|
223
|
+
// An optional final status for this span. Semantically when Status isn't set, it means
|
|
224
|
+
// span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0).
|
|
225
|
+
Status status = 15;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// The Status type defines a logical error model that is suitable for different
|
|
229
|
+
// programming environments, including REST APIs and RPC APIs.
|
|
230
|
+
message Status {
|
|
231
|
+
// IMPORTANT: Backward compatibility notes:
|
|
232
|
+
//
|
|
233
|
+
// To ensure any pair of senders and receivers continues to correctly signal and
|
|
234
|
+
// interpret erroneous situations, the senders and receivers MUST follow these rules:
|
|
235
|
+
//
|
|
236
|
+
// 1. Old senders and receivers that are not aware of `code` field will continue using
|
|
237
|
+
// the `deprecated_code` field to signal and interpret erroneous situation.
|
|
238
|
+
//
|
|
239
|
+
// 2. New senders, which are aware of the `code` field MUST set both the
|
|
240
|
+
// `deprecated_code` and `code` fields according to the following rules:
|
|
241
|
+
//
|
|
242
|
+
// if code==STATUS_CODE_UNSET then `deprecated_code` MUST be
|
|
243
|
+
// set to DEPRECATED_STATUS_CODE_OK.
|
|
244
|
+
//
|
|
245
|
+
// if code==STATUS_CODE_OK then `deprecated_code` MUST be
|
|
246
|
+
// set to DEPRECATED_STATUS_CODE_OK.
|
|
247
|
+
//
|
|
248
|
+
// if code==STATUS_CODE_ERROR then `deprecated_code` MUST be
|
|
249
|
+
// set to DEPRECATED_STATUS_CODE_UNKNOWN_ERROR.
|
|
250
|
+
//
|
|
251
|
+
// These rules allow old receivers to correctly interpret data received from new senders.
|
|
252
|
+
//
|
|
253
|
+
// 3. New receivers MUST look at both the `code` and `deprecated_code` fields in order
|
|
254
|
+
// to interpret the overall status:
|
|
255
|
+
//
|
|
256
|
+
// If code==STATUS_CODE_UNSET then the value of `deprecated_code` is the
|
|
257
|
+
// carrier of the overall status according to these rules:
|
|
258
|
+
//
|
|
259
|
+
// if deprecated_code==DEPRECATED_STATUS_CODE_OK then the receiver MUST interpret
|
|
260
|
+
// the overall status to be STATUS_CODE_UNSET.
|
|
261
|
+
//
|
|
262
|
+
// if deprecated_code!=DEPRECATED_STATUS_CODE_OK then the receiver MUST interpret
|
|
263
|
+
// the overall status to be STATUS_CODE_ERROR.
|
|
264
|
+
//
|
|
265
|
+
// If code!=STATUS_CODE_UNSET then the value of `deprecated_code` MUST be
|
|
266
|
+
// ignored, the `code` field is the sole carrier of the status.
|
|
267
|
+
//
|
|
268
|
+
// These rules allow new receivers to correctly interpret data received from old senders.
|
|
269
|
+
|
|
270
|
+
enum DeprecatedStatusCode {
|
|
271
|
+
DEPRECATED_STATUS_CODE_OK = 0;
|
|
272
|
+
DEPRECATED_STATUS_CODE_CANCELLED = 1;
|
|
273
|
+
DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2;
|
|
274
|
+
DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3;
|
|
275
|
+
DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4;
|
|
276
|
+
DEPRECATED_STATUS_CODE_NOT_FOUND = 5;
|
|
277
|
+
DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6;
|
|
278
|
+
DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7;
|
|
279
|
+
DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8;
|
|
280
|
+
DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9;
|
|
281
|
+
DEPRECATED_STATUS_CODE_ABORTED = 10;
|
|
282
|
+
DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11;
|
|
283
|
+
DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12;
|
|
284
|
+
DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13;
|
|
285
|
+
DEPRECATED_STATUS_CODE_UNAVAILABLE = 14;
|
|
286
|
+
DEPRECATED_STATUS_CODE_DATA_LOSS = 15;
|
|
287
|
+
DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
// The deprecated status code. This is an optional field.
|
|
291
|
+
//
|
|
292
|
+
// This field is deprecated and is replaced by the `code` field below. See backward
|
|
293
|
+
// compatibility notes below. According to our stability guarantees this field
|
|
294
|
+
// will be removed in 12 months, on Oct 22, 2021. All usage of old senders and
|
|
295
|
+
// receivers that do not understand the `code` field MUST be phased out by then.
|
|
296
|
+
DeprecatedStatusCode deprecated_code = 1 [deprecated=true];
|
|
297
|
+
|
|
298
|
+
// A developer-facing human readable error message.
|
|
299
|
+
string message = 2;
|
|
300
|
+
|
|
301
|
+
// For the semantics of status codes see
|
|
302
|
+
// https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-status
|
|
303
|
+
enum StatusCode {
|
|
304
|
+
// The default status.
|
|
305
|
+
STATUS_CODE_UNSET = 0;
|
|
306
|
+
// The Span has been validated by an Application developers or Operator to have
|
|
307
|
+
// completed successfully.
|
|
308
|
+
STATUS_CODE_OK = 1;
|
|
309
|
+
// The Span contains an error.
|
|
310
|
+
STATUS_CODE_ERROR = 2;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
// The status code.
|
|
314
|
+
StatusCode code = 3;
|
|
315
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright 2019, OpenTelemetry Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package opentelemetry.proto.trace.v1;
|
|
18
|
+
|
|
19
|
+
option java_multiple_files = true;
|
|
20
|
+
option java_package = "io.opentelemetry.proto.trace.v1";
|
|
21
|
+
option java_outer_classname = "TraceConfigProto";
|
|
22
|
+
option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/collector/trace/v1";
|
|
23
|
+
|
|
24
|
+
// Global configuration of the trace service. All fields must be specified, or
|
|
25
|
+
// the default (zero) values will be used for each type.
|
|
26
|
+
message TraceConfig {
|
|
27
|
+
|
|
28
|
+
// The global default sampler used to make decisions on span sampling.
|
|
29
|
+
oneof sampler {
|
|
30
|
+
ConstantSampler constant_sampler = 1;
|
|
31
|
+
|
|
32
|
+
TraceIdRatioBased trace_id_ratio_based = 2;
|
|
33
|
+
|
|
34
|
+
RateLimitingSampler rate_limiting_sampler = 3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// The global default max number of attributes per span.
|
|
38
|
+
int64 max_number_of_attributes = 4;
|
|
39
|
+
|
|
40
|
+
// The global default max number of annotation events per span.
|
|
41
|
+
int64 max_number_of_timed_events= 5;
|
|
42
|
+
|
|
43
|
+
// The global default max number of attributes per timed event.
|
|
44
|
+
int64 max_number_of_attributes_per_timed_event = 6;
|
|
45
|
+
|
|
46
|
+
// The global default max number of link entries per span.
|
|
47
|
+
int64 max_number_of_links = 7;
|
|
48
|
+
|
|
49
|
+
// The global default max number of attributes per span.
|
|
50
|
+
int64 max_number_of_attributes_per_link = 8;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Sampler that always makes a constant decision on span sampling.
|
|
54
|
+
message ConstantSampler {
|
|
55
|
+
// How spans should be sampled:
|
|
56
|
+
// - Always off
|
|
57
|
+
// - Always on
|
|
58
|
+
// - Always follow the parent Span's decision (off if no parent).
|
|
59
|
+
enum ConstantDecision {
|
|
60
|
+
ALWAYS_OFF = 0;
|
|
61
|
+
ALWAYS_ON = 1;
|
|
62
|
+
ALWAYS_PARENT = 2;
|
|
63
|
+
}
|
|
64
|
+
ConstantDecision decision = 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Sampler that tries to uniformly sample traces with a given ratio.
|
|
68
|
+
// The ratio of sampling a trace is equal to that of the specified ratio.
|
|
69
|
+
message TraceIdRatioBased {
|
|
70
|
+
// The desired ratio of sampling. Must be within [0.0, 1.0].
|
|
71
|
+
double samplingRatio = 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Sampler that tries to sample with a rate per time window.
|
|
75
|
+
message RateLimitingSampler {
|
|
76
|
+
// Rate per second.
|
|
77
|
+
int64 qps = 1;
|
|
78
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { OTLPGRPCExporterConfigNode, GRPCQueueItem, ServiceClientType } from './types';
|
|
3
|
+
import { ServiceClient } from './types';
|
|
4
|
+
import { GrpcCompressionAlgorithm } from './util';
|
|
5
|
+
import { OTLPExporterBase, OTLPExporterError } from '@opentelemetry/otlp-exporter-base';
|
|
6
|
+
/**
|
|
7
|
+
* OTLP Exporter abstract base class
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class OTLPGRPCExporterNodeBase<ExportItem, ServiceRequest> extends OTLPExporterBase<OTLPGRPCExporterConfigNode, ExportItem, ServiceRequest> {
|
|
10
|
+
grpcQueue: GRPCQueueItem<ExportItem>[];
|
|
11
|
+
metadata?: Metadata;
|
|
12
|
+
serviceClient?: ServiceClient;
|
|
13
|
+
private _send;
|
|
14
|
+
compression: GrpcCompressionAlgorithm;
|
|
15
|
+
constructor(config?: OTLPGRPCExporterConfigNode);
|
|
16
|
+
private _sendPromise;
|
|
17
|
+
onInit(config: OTLPGRPCExporterConfigNode): void;
|
|
18
|
+
send(objects: ExportItem[], onSuccess: () => void, onError: (error: OTLPExporterError) => void): void;
|
|
19
|
+
onShutdown(): void;
|
|
20
|
+
abstract getServiceProtoPath(): string;
|
|
21
|
+
abstract getServiceClientType(): ServiceClientType;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=OTLPGRPCExporterNodeBase.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright The OpenTelemetry Authors
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.OTLPGRPCExporterNodeBase = void 0;
|
|
19
|
+
const api_1 = require("@opentelemetry/api");
|
|
20
|
+
const grpc_js_1 = require("@grpc/grpc-js");
|
|
21
|
+
const core_1 = require("@opentelemetry/core");
|
|
22
|
+
const util_1 = require("./util");
|
|
23
|
+
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
|
|
24
|
+
/**
|
|
25
|
+
* OTLP Exporter abstract base class
|
|
26
|
+
*/
|
|
27
|
+
class OTLPGRPCExporterNodeBase extends otlp_exporter_base_1.OTLPExporterBase {
|
|
28
|
+
constructor(config = {}) {
|
|
29
|
+
super(config);
|
|
30
|
+
this.grpcQueue = [];
|
|
31
|
+
this.serviceClient = undefined;
|
|
32
|
+
if (config.headers) {
|
|
33
|
+
api_1.diag.warn('Headers cannot be set when using grpc');
|
|
34
|
+
}
|
|
35
|
+
const headers = core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_HEADERS);
|
|
36
|
+
this.metadata = config.metadata || new grpc_js_1.Metadata();
|
|
37
|
+
for (const [k, v] of Object.entries(headers)) {
|
|
38
|
+
this.metadata.set(k, v);
|
|
39
|
+
}
|
|
40
|
+
this.compression = (0, util_1.configureCompression)(config.compression);
|
|
41
|
+
}
|
|
42
|
+
_sendPromise(objects, onSuccess, onError) {
|
|
43
|
+
const promise = new Promise((resolve, reject) => {
|
|
44
|
+
this._send(this, objects, resolve, reject);
|
|
45
|
+
})
|
|
46
|
+
.then(onSuccess, onError);
|
|
47
|
+
this._sendingPromises.push(promise);
|
|
48
|
+
const popPromise = () => {
|
|
49
|
+
const index = this._sendingPromises.indexOf(promise);
|
|
50
|
+
this._sendingPromises.splice(index, 1);
|
|
51
|
+
};
|
|
52
|
+
promise.then(popPromise, popPromise);
|
|
53
|
+
}
|
|
54
|
+
onInit(config) {
|
|
55
|
+
// defer to next tick and lazy load to avoid loading grpc too early
|
|
56
|
+
// and making this impossible to be instrumented
|
|
57
|
+
setImmediate(() => {
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
59
|
+
const { onInit } = require('./util');
|
|
60
|
+
onInit(this, config);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
send(objects, onSuccess, onError) {
|
|
64
|
+
if (this._shutdownOnce.isCalled) {
|
|
65
|
+
api_1.diag.debug('Shutdown already started. Cannot send objects');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!this._send) {
|
|
69
|
+
// defer to next tick and lazy load to avoid loading grpc too early
|
|
70
|
+
// and making this impossible to be instrumented
|
|
71
|
+
setImmediate(() => {
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
73
|
+
const { send } = require('./util');
|
|
74
|
+
this._send = send;
|
|
75
|
+
this._sendPromise(objects, onSuccess, onError);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this._sendPromise(objects, onSuccess, onError);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
onShutdown() {
|
|
83
|
+
if (this.serviceClient) {
|
|
84
|
+
this.serviceClient.close();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.OTLPGRPCExporterNodeBase = OTLPGRPCExporterNodeBase;
|
|
89
|
+
//# sourceMappingURL=OTLPGRPCExporterNodeBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OTLPGRPCExporterNodeBase.js","sourceRoot":"","sources":["../../src/OTLPGRPCExporterNodeBase.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { diag } from '@opentelemetry/api';\nimport { Metadata } from '@grpc/grpc-js';\nimport {\n OTLPGRPCExporterConfigNode,\n GRPCQueueItem,\n ServiceClientType,\n} from './types';\nimport { ServiceClient } from './types';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { configureCompression, GrpcCompressionAlgorithm } from './util';\nimport { OTLPExporterBase, OTLPExporterError } from '@opentelemetry/otlp-exporter-base';\n\n/**\n * OTLP Exporter abstract base class\n */\nexport abstract class OTLPGRPCExporterNodeBase<\n ExportItem,\n ServiceRequest\n> extends OTLPExporterBase<\n OTLPGRPCExporterConfigNode,\n ExportItem,\n ServiceRequest\n> {\n grpcQueue: GRPCQueueItem<ExportItem>[] = [];\n metadata?: Metadata;\n serviceClient?: ServiceClient = undefined;\n private _send!: Function;\n compression: GrpcCompressionAlgorithm;\n\n constructor(config: OTLPGRPCExporterConfigNode = {}) {\n super(config);\n if (config.headers) {\n diag.warn('Headers cannot be set when using grpc');\n }\n const headers = baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_HEADERS);\n this.metadata = config.metadata || new Metadata();\n for (const [k, v] of Object.entries(headers)) {\n this.metadata.set(k, v);\n }\n this.compression = configureCompression(config.compression);\n }\n\n private _sendPromise(\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n ): void {\n const promise = new Promise<void>((resolve, reject) => {\n this._send(this, objects, resolve, reject);\n })\n .then(onSuccess, onError);\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n onInit(config: OTLPGRPCExporterConfigNode): void {\n // defer to next tick and lazy load to avoid loading grpc too early\n // and making this impossible to be instrumented\n setImmediate(() => {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { onInit } = require('./util');\n onInit(this, config);\n });\n }\n\n send(\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n ): void {\n if (this._shutdownOnce.isCalled) {\n diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n if (!this._send) {\n // defer to next tick and lazy load to avoid loading grpc too early\n // and making this impossible to be instrumented\n setImmediate(() => {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { send } = require('./util');\n this._send = send;\n\n this._sendPromise(objects, onSuccess, onError);\n });\n } else {\n this._sendPromise(objects, onSuccess, onError);\n }\n }\n\n onShutdown(): void {\n if (this.serviceClient) {\n this.serviceClient.close();\n }\n }\n\n abstract getServiceProtoPath(): string;\n abstract getServiceClientType(): ServiceClientType;\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright The OpenTelemetry Authors
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.GrpcCompressionAlgorithm = exports.validateAndNormalizeUrl = exports.ServiceClientType = void 0;
|
|
29
|
+
__exportStar(require("./OTLPGRPCExporterNodeBase"), exports);
|
|
30
|
+
var types_1 = require("./types");
|
|
31
|
+
Object.defineProperty(exports, "ServiceClientType", { enumerable: true, get: function () { return types_1.ServiceClientType; } });
|
|
32
|
+
var util_1 = require("./util");
|
|
33
|
+
Object.defineProperty(exports, "validateAndNormalizeUrl", { enumerable: true, get: function () { return util_1.validateAndNormalizeUrl; } });
|
|
34
|
+
Object.defineProperty(exports, "GrpcCompressionAlgorithm", { enumerable: true, get: function () { return util_1.GrpcCompressionAlgorithm; } });
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,6DAA2C;AAC3C,iCAAwE;AAA/D,0GAAA,iBAAiB,OAAA;AAC1B,+BAA2E;AAAlE,+GAAA,uBAAuB,OAAA;AAAE,gHAAA,wBAAwB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './OTLPGRPCExporterNodeBase';\nexport { ServiceClientType, OTLPGRPCExporterConfigNode } from './types';\nexport { validateAndNormalizeUrl, GrpcCompressionAlgorithm } from './util';\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as grpc from '@grpc/grpc-js';
|
|
2
|
+
import { CompressionAlgorithm, OTLPExporterConfigBase, OTLPExporterError } from '@opentelemetry/otlp-exporter-base';
|
|
3
|
+
/**
|
|
4
|
+
* Queue item to be used to save temporary spans/metrics in case the GRPC service
|
|
5
|
+
* hasn't been fully initialized yet
|
|
6
|
+
*/
|
|
7
|
+
export interface GRPCQueueItem<ExportedItem> {
|
|
8
|
+
objects: ExportedItem[];
|
|
9
|
+
onSuccess: () => void;
|
|
10
|
+
onError: (error: OTLPExporterError) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Service Client for sending spans or metrics
|
|
14
|
+
*/
|
|
15
|
+
export interface ServiceClient extends grpc.Client {
|
|
16
|
+
export: (request: any, metadata: grpc.Metadata, callback: Function) => {};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* OTLP Exporter Config for Node
|
|
20
|
+
*/
|
|
21
|
+
export interface OTLPGRPCExporterConfigNode extends OTLPExporterConfigBase {
|
|
22
|
+
credentials?: grpc.ChannelCredentials;
|
|
23
|
+
metadata?: grpc.Metadata;
|
|
24
|
+
compression?: CompressionAlgorithm;
|
|
25
|
+
}
|
|
26
|
+
export declare enum ServiceClientType {
|
|
27
|
+
SPANS = 0,
|
|
28
|
+
METRICS = 1
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright The OpenTelemetry Authors
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ServiceClientType = void 0;
|
|
19
|
+
var ServiceClientType;
|
|
20
|
+
(function (ServiceClientType) {
|
|
21
|
+
ServiceClientType[ServiceClientType["SPANS"] = 0] = "SPANS";
|
|
22
|
+
ServiceClientType[ServiceClientType["METRICS"] = 1] = "METRICS";
|
|
23
|
+
})(ServiceClientType = exports.ServiceClientType || (exports.ServiceClientType = {}));
|
|
24
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAoCH,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,2DAAK,CAAA;IACL,+DAAO,CAAA;AACT,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as grpc from '@grpc/grpc-js';\nimport { CompressionAlgorithm, OTLPExporterConfigBase, OTLPExporterError } from '@opentelemetry/otlp-exporter-base';\n\n/**\n * Queue item to be used to save temporary spans/metrics in case the GRPC service\n * hasn't been fully initialized yet\n */\nexport interface GRPCQueueItem<ExportedItem> {\n objects: ExportedItem[];\n onSuccess: () => void;\n onError: (error: OTLPExporterError) => void;\n}\n\n/**\n * Service Client for sending spans or metrics\n */\nexport interface ServiceClient extends grpc.Client {\n export: (\n request: any,\n metadata: grpc.Metadata,\n callback: Function\n ) => {};\n}\n\n/**\n * OTLP Exporter Config for Node\n */\nexport interface OTLPGRPCExporterConfigNode\n extends OTLPExporterConfigBase {\n credentials?: grpc.ChannelCredentials;\n metadata?: grpc.Metadata;\n compression?: CompressionAlgorithm;\n}\n\nexport enum ServiceClientType {\n SPANS,\n METRICS,\n}\n"]}
|