@opentelemetry/exporter-trace-otlp-http 0.27.0 → 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/README.md +3 -9
- package/build/esm/index.d.ts +0 -2
- package/build/esm/index.js +0 -2
- package/build/esm/index.js.map +1 -1
- package/build/esm/platform/browser/OTLPTraceExporter.d.ts +2 -2
- package/build/esm/platform/browser/OTLPTraceExporter.js +2 -3
- package/build/esm/platform/browser/OTLPTraceExporter.js.map +1 -1
- package/build/esm/platform/browser/index.d.ts +0 -1
- package/build/esm/platform/browser/index.js +0 -1
- package/build/esm/platform/browser/index.js.map +1 -1
- package/build/esm/platform/index.d.ts +0 -1
- package/build/esm/platform/index.js +0 -1
- package/build/esm/platform/index.js.map +1 -1
- package/build/esm/platform/node/OTLPTraceExporter.d.ts +2 -2
- package/build/esm/platform/node/OTLPTraceExporter.js +3 -3
- package/build/esm/platform/node/OTLPTraceExporter.js.map +1 -1
- package/build/esm/platform/node/index.d.ts +0 -3
- package/build/esm/platform/node/index.js +0 -3
- package/build/esm/platform/node/index.js.map +1 -1
- package/build/esm/transform.d.ts +2 -2
- package/build/esm/transform.js +18 -2
- package/build/esm/transform.js.map +1 -1
- package/build/esm/types.d.ts +1 -33
- package/build/esm/types.js +0 -30
- package/build/esm/types.js.map +1 -1
- package/build/esm/version.d.ts +1 -1
- package/build/esm/version.js +1 -1
- package/build/esm/version.js.map +1 -1
- package/build/esnext/index.d.ts +4 -0
- package/build/esnext/index.js +19 -0
- package/build/esnext/index.js.map +1 -0
- package/build/esnext/platform/browser/OTLPTraceExporter.d.ts +13 -0
- package/build/esnext/platform/browser/OTLPTraceExporter.js +42 -0
- package/build/esnext/platform/browser/OTLPTraceExporter.js.map +1 -0
- package/build/esnext/platform/browser/index.d.ts +2 -0
- package/build/esnext/platform/browser/index.js +17 -0
- package/build/esnext/platform/browser/index.js.map +1 -0
- package/build/esnext/platform/index.d.ts +2 -0
- package/build/esnext/platform/index.js +17 -0
- package/build/esnext/platform/index.js.map +1 -0
- package/build/esnext/platform/node/OTLPTraceExporter.d.ts +13 -0
- package/build/esnext/platform/node/OTLPTraceExporter.js +43 -0
- package/build/esnext/platform/node/OTLPTraceExporter.js.map +1 -0
- package/build/esnext/platform/node/index.d.ts +2 -0
- package/build/esnext/platform/node/index.js +17 -0
- package/build/esnext/platform/node/index.js.map +1 -0
- package/build/esnext/transform.d.ts +80 -0
- package/build/esnext/transform.js +266 -0
- package/build/esnext/transform.js.map +1 -0
- package/build/esnext/types.d.ts +209 -0
- package/build/esnext/types.js +145 -0
- package/build/esnext/types.js.map +1 -0
- package/build/esnext/version.d.ts +2 -0
- package/build/esnext/version.js +18 -0
- package/build/esnext/version.js.map +1 -0
- package/build/src/index.d.ts +0 -2
- package/build/src/index.js +1 -4
- package/build/src/index.js.map +1 -1
- package/build/src/platform/browser/OTLPTraceExporter.d.ts +2 -2
- package/build/src/platform/browser/OTLPTraceExporter.js +9 -10
- package/build/src/platform/browser/OTLPTraceExporter.js.map +1 -1
- package/build/src/platform/browser/index.d.ts +0 -1
- package/build/src/platform/browser/index.js +0 -1
- package/build/src/platform/browser/index.js.map +1 -1
- package/build/src/platform/index.d.ts +0 -1
- package/build/src/platform/index.js +0 -3
- package/build/src/platform/index.js.map +1 -1
- package/build/src/platform/node/OTLPTraceExporter.d.ts +2 -2
- package/build/src/platform/node/OTLPTraceExporter.js +10 -10
- package/build/src/platform/node/OTLPTraceExporter.js.map +1 -1
- package/build/src/platform/node/index.d.ts +0 -3
- package/build/src/platform/node/index.js +0 -3
- package/build/src/platform/node/index.js.map +1 -1
- package/build/src/transform.d.ts +2 -2
- package/build/src/transform.js.map +1 -1
- package/build/src/types.d.ts +1 -33
- package/build/src/types.js +1 -13
- package/build/src/types.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +30 -21
- package/build/esm/OTLPExporterBase.d.ts +0 -36
- package/build/esm/OTLPExporterBase.js +0 -114
- package/build/esm/OTLPExporterBase.js.map +0 -1
- package/build/esm/platform/browser/OTLPExporterBrowserBase.d.ts +0 -18
- package/build/esm/platform/browser/OTLPExporterBrowserBase.js +0 -91
- package/build/esm/platform/browser/OTLPExporterBrowserBase.js.map +0 -1
- package/build/esm/platform/browser/util.d.ts +0 -17
- package/build/esm/platform/browser/util.js +0 -77
- package/build/esm/platform/browser/util.js.map +0 -1
- package/build/esm/platform/node/OTLPExporterNodeBase.d.ts +0 -20
- package/build/esm/platform/node/OTLPExporterNodeBase.js +0 -82
- package/build/esm/platform/node/OTLPExporterNodeBase.js.map +0 -1
- package/build/esm/platform/node/types.d.ts +0 -17
- package/build/esm/platform/node/types.js +0 -6
- package/build/esm/platform/node/types.js.map +0 -1
- package/build/esm/platform/node/util.d.ts +0 -17
- package/build/esm/platform/node/util.js +0 -113
- package/build/esm/platform/node/util.js.map +0 -1
- package/build/esm/util.d.ts +0 -7
- package/build/esm/util.js +0 -40
- package/build/esm/util.js.map +0 -1
- package/build/src/OTLPExporterBase.d.ts +0 -36
- package/build/src/OTLPExporterBase.js +0 -113
- package/build/src/OTLPExporterBase.js.map +0 -1
- package/build/src/platform/browser/OTLPExporterBrowserBase.d.ts +0 -18
- package/build/src/platform/browser/OTLPExporterBrowserBase.js +0 -74
- package/build/src/platform/browser/OTLPExporterBrowserBase.js.map +0 -1
- package/build/src/platform/browser/util.d.ts +0 -17
- package/build/src/platform/browser/util.js +0 -70
- package/build/src/platform/browser/util.js.map +0 -1
- package/build/src/platform/node/OTLPExporterNodeBase.d.ts +0 -20
- package/build/src/platform/node/OTLPExporterNodeBase.js +0 -65
- package/build/src/platform/node/OTLPExporterNodeBase.js.map +0 -1
- package/build/src/platform/node/types.d.ts +0 -17
- package/build/src/platform/node/types.js +0 -9
- package/build/src/platform/node/types.js.map +0 -1
- package/build/src/platform/node/util.d.ts +0 -17
- package/build/src/platform/node/util.js +0 -107
- package/build/src/platform/node/util.js.map +0 -1
- package/build/src/util.d.ts +0 -7
- package/build/src/util.js +0 -43
- package/build/src/util.js.map +0 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { SpanStatusCode } from '@opentelemetry/api';
|
|
2
|
+
export declare namespace opentelemetryProto {
|
|
3
|
+
namespace collector {
|
|
4
|
+
namespace trace.v1 {
|
|
5
|
+
interface TraceService {
|
|
6
|
+
service: opentelemetryProto.collector.trace.v1.TraceService;
|
|
7
|
+
}
|
|
8
|
+
interface ExportTraceServiceRequest {
|
|
9
|
+
resourceSpans: opentelemetryProto.trace.v1.ResourceSpans[];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
namespace metrics.v1 {
|
|
13
|
+
interface ExportMetricsServiceRequest {
|
|
14
|
+
resourceMetrics: opentelemetryProto.metrics.v1.ResourceMetrics[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
namespace resource.v1 {
|
|
19
|
+
interface Resource {
|
|
20
|
+
attributes: opentelemetryProto.common.v1.KeyValue[];
|
|
21
|
+
droppedAttributesCount: number;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
namespace metrics.v1 {
|
|
25
|
+
interface Metric {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
unit: string;
|
|
29
|
+
intGauge?: opentelemetryProto.metrics.v1.Gauge;
|
|
30
|
+
doubleGauge?: opentelemetryProto.metrics.v1.Gauge;
|
|
31
|
+
intSum?: opentelemetryProto.metrics.v1.Sum;
|
|
32
|
+
doubleSum?: opentelemetryProto.metrics.v1.Sum;
|
|
33
|
+
intHistogram?: opentelemetryProto.metrics.v1.Histogram;
|
|
34
|
+
doubleHistogram?: opentelemetryProto.metrics.v1.Histogram;
|
|
35
|
+
}
|
|
36
|
+
interface Gauge {
|
|
37
|
+
dataPoints: opentelemetryProto.metrics.v1.DataPoint[];
|
|
38
|
+
}
|
|
39
|
+
interface Sum {
|
|
40
|
+
dataPoints: opentelemetryProto.metrics.v1.DataPoint[];
|
|
41
|
+
aggregationTemporality: opentelemetryProto.metrics.v1.AggregationTemporality;
|
|
42
|
+
isMonotonic: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface Histogram {
|
|
45
|
+
dataPoints: opentelemetryProto.metrics.v1.HistogramDataPoint[];
|
|
46
|
+
aggregationTemporality: opentelemetryProto.metrics.v1.AggregationTemporality;
|
|
47
|
+
}
|
|
48
|
+
interface DataPoint {
|
|
49
|
+
labels: opentelemetryProto.common.v1.StringKeyValue[];
|
|
50
|
+
startTimeUnixNano: number;
|
|
51
|
+
timeUnixNano: number;
|
|
52
|
+
value: number;
|
|
53
|
+
exemplars?: opentelemetryProto.metrics.v1.Exemplar[];
|
|
54
|
+
}
|
|
55
|
+
interface Exemplar {
|
|
56
|
+
filteredLabels: opentelemetryProto.common.v1.StringKeyValue[];
|
|
57
|
+
timeUnixNano: number;
|
|
58
|
+
value: number;
|
|
59
|
+
spanId: Uint8Array;
|
|
60
|
+
traceId: Uint8Array;
|
|
61
|
+
}
|
|
62
|
+
interface HistogramDataPoint {
|
|
63
|
+
labels: opentelemetryProto.common.v1.StringKeyValue[];
|
|
64
|
+
startTimeUnixNano: number;
|
|
65
|
+
timeUnixNano: number;
|
|
66
|
+
count: number;
|
|
67
|
+
sum: number;
|
|
68
|
+
bucketCounts?: number[];
|
|
69
|
+
explicitBounds?: number[];
|
|
70
|
+
exemplars?: opentelemetryProto.metrics.v1.Exemplar[][];
|
|
71
|
+
}
|
|
72
|
+
interface InstrumentationLibraryMetrics {
|
|
73
|
+
instrumentationLibrary?: opentelemetryProto.common.v1.InstrumentationLibrary;
|
|
74
|
+
metrics: opentelemetryProto.metrics.v1.Metric[];
|
|
75
|
+
}
|
|
76
|
+
interface ResourceMetrics {
|
|
77
|
+
resource?: opentelemetryProto.resource.v1.Resource;
|
|
78
|
+
instrumentationLibraryMetrics: opentelemetryProto.metrics.v1.InstrumentationLibraryMetrics[];
|
|
79
|
+
}
|
|
80
|
+
enum AggregationTemporality {
|
|
81
|
+
AGGREGATION_TEMPORALITY_UNSPECIFIED = 0,
|
|
82
|
+
AGGREGATION_TEMPORALITY_DELTA = 1,
|
|
83
|
+
AGGREGATION_TEMPORALITY_CUMULATIVE = 2
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
namespace trace.v1 {
|
|
87
|
+
namespace ConstantSampler {
|
|
88
|
+
enum ConstantDecision {
|
|
89
|
+
ALWAYS_OFF = 0,
|
|
90
|
+
ALWAYS_ON = 1,
|
|
91
|
+
ALWAYS_PARENT = 2
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
namespace Span {
|
|
95
|
+
interface Event {
|
|
96
|
+
timeUnixNano: number;
|
|
97
|
+
name: string;
|
|
98
|
+
attributes?: opentelemetryProto.common.v1.KeyValue[];
|
|
99
|
+
droppedAttributesCount: number;
|
|
100
|
+
}
|
|
101
|
+
interface Link {
|
|
102
|
+
traceId: string;
|
|
103
|
+
spanId: string;
|
|
104
|
+
traceState?: opentelemetryProto.trace.v1.Span.TraceState;
|
|
105
|
+
attributes?: opentelemetryProto.common.v1.KeyValue[];
|
|
106
|
+
droppedAttributesCount: number;
|
|
107
|
+
}
|
|
108
|
+
enum SpanKind {
|
|
109
|
+
SPAN_KIND_UNSPECIFIED = 0,
|
|
110
|
+
SPAN_KIND_INTERNAL = 1,
|
|
111
|
+
SPAN_KIND_SERVER = 2,
|
|
112
|
+
SPAN_KIND_CLIENT = 3,
|
|
113
|
+
SPAN_KIND_PRODUCER = 4,
|
|
114
|
+
SPAN_KIND_CONSUMER = 5
|
|
115
|
+
}
|
|
116
|
+
type TraceState = string | undefined;
|
|
117
|
+
}
|
|
118
|
+
interface ConstantSampler {
|
|
119
|
+
decision?: opentelemetryProto.trace.v1.ConstantSampler.ConstantDecision;
|
|
120
|
+
}
|
|
121
|
+
interface InstrumentationLibrarySpans {
|
|
122
|
+
instrumentationLibrary?: opentelemetryProto.common.v1.InstrumentationLibrary;
|
|
123
|
+
spans: opentelemetryProto.trace.v1.Span[];
|
|
124
|
+
}
|
|
125
|
+
interface ProbabilitySampler {
|
|
126
|
+
samplingProbability?: number | null;
|
|
127
|
+
}
|
|
128
|
+
interface RateLimitingSampler {
|
|
129
|
+
qps?: number | null;
|
|
130
|
+
}
|
|
131
|
+
interface ResourceSpans {
|
|
132
|
+
resource?: opentelemetryProto.resource.v1.Resource;
|
|
133
|
+
instrumentationLibrarySpans: opentelemetryProto.trace.v1.InstrumentationLibrarySpans[];
|
|
134
|
+
}
|
|
135
|
+
interface Span {
|
|
136
|
+
traceId: string;
|
|
137
|
+
spanId: string;
|
|
138
|
+
traceState: opentelemetryProto.trace.v1.Span.TraceState;
|
|
139
|
+
parentSpanId?: string;
|
|
140
|
+
name?: string;
|
|
141
|
+
kind?: opentelemetryProto.trace.v1.Span.SpanKind;
|
|
142
|
+
startTimeUnixNano?: number;
|
|
143
|
+
endTimeUnixNano?: number;
|
|
144
|
+
attributes?: opentelemetryProto.common.v1.KeyValue[];
|
|
145
|
+
droppedAttributesCount: number;
|
|
146
|
+
events?: opentelemetryProto.trace.v1.Span.Event[];
|
|
147
|
+
droppedEventsCount: number;
|
|
148
|
+
links?: opentelemetryProto.trace.v1.Span.Link[];
|
|
149
|
+
droppedLinksCount: number;
|
|
150
|
+
status?: SpanStatus;
|
|
151
|
+
}
|
|
152
|
+
interface SpanStatus {
|
|
153
|
+
/** The status code of this message. */
|
|
154
|
+
code: SpanStatusCode;
|
|
155
|
+
/** A developer-facing error message. */
|
|
156
|
+
message?: string;
|
|
157
|
+
}
|
|
158
|
+
interface TraceConfig {
|
|
159
|
+
constantSampler?: ConstantSampler | null;
|
|
160
|
+
probabilitySampler?: ProbabilitySampler | null;
|
|
161
|
+
rateLimitingSampler?: RateLimitingSampler | null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
namespace common.v1 {
|
|
165
|
+
interface KeyValue {
|
|
166
|
+
key: string;
|
|
167
|
+
value: AnyValue;
|
|
168
|
+
}
|
|
169
|
+
type ArrayValue = {
|
|
170
|
+
values: AnyValue[];
|
|
171
|
+
};
|
|
172
|
+
interface KeyValueList {
|
|
173
|
+
values: KeyValue[];
|
|
174
|
+
}
|
|
175
|
+
type AnyValue = {
|
|
176
|
+
stringValue?: string;
|
|
177
|
+
boolValue?: boolean;
|
|
178
|
+
intValue?: number;
|
|
179
|
+
doubleValue?: number;
|
|
180
|
+
arrayValue?: ArrayValue;
|
|
181
|
+
kvlistValue?: KeyValueList;
|
|
182
|
+
};
|
|
183
|
+
interface InstrumentationLibrary {
|
|
184
|
+
name: string;
|
|
185
|
+
version?: string;
|
|
186
|
+
}
|
|
187
|
+
interface StringKeyValue {
|
|
188
|
+
key: string;
|
|
189
|
+
value: string;
|
|
190
|
+
}
|
|
191
|
+
enum ValueType {
|
|
192
|
+
STRING = 0,
|
|
193
|
+
INT = 1,
|
|
194
|
+
DOUBLE = 2,
|
|
195
|
+
BOOL = 3
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Mapping between api SpanKind and proto SpanKind
|
|
201
|
+
*/
|
|
202
|
+
export declare const OTLP_SPAN_KIND_MAPPING: {
|
|
203
|
+
0: opentelemetryProto.trace.v1.Span.SpanKind;
|
|
204
|
+
1: opentelemetryProto.trace.v1.Span.SpanKind;
|
|
205
|
+
2: opentelemetryProto.trace.v1.Span.SpanKind;
|
|
206
|
+
3: opentelemetryProto.trace.v1.Span.SpanKind;
|
|
207
|
+
4: opentelemetryProto.trace.v1.Span.SpanKind;
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SpanKind } from '@opentelemetry/api';
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
19
|
+
export var opentelemetryProto;
|
|
20
|
+
(function (opentelemetryProto) {
|
|
21
|
+
let metrics;
|
|
22
|
+
(function (metrics) {
|
|
23
|
+
let v1;
|
|
24
|
+
(function (v1) {
|
|
25
|
+
let AggregationTemporality;
|
|
26
|
+
(function (AggregationTemporality) {
|
|
27
|
+
// UNSPECIFIED is the default AggregationTemporality, it MUST not be used.
|
|
28
|
+
AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED";
|
|
29
|
+
// DELTA is an AggregationTemporality for a metric aggregator which reports
|
|
30
|
+
// changes since last report time. Successive metrics contain aggregation of
|
|
31
|
+
// values from continuous and non-overlapping intervals.
|
|
32
|
+
//
|
|
33
|
+
// The values for a DELTA metric are based only on the time interval
|
|
34
|
+
// associated with one measurement cycle. There is no dependency on
|
|
35
|
+
// previous measurements like is the case for CUMULATIVE metrics.
|
|
36
|
+
//
|
|
37
|
+
// For example, consider a system measuring the number of requests that
|
|
38
|
+
// it receives and reports the sum of these requests every second as a
|
|
39
|
+
// DELTA metric:
|
|
40
|
+
//
|
|
41
|
+
// 1. The system starts receiving at time=t_0.
|
|
42
|
+
// 2. A request is received, the system measures 1 request.
|
|
43
|
+
// 3. A request is received, the system measures 1 request.
|
|
44
|
+
// 4. A request is received, the system measures 1 request.
|
|
45
|
+
// 5. The 1 second collection cycle ends. A metric is exported for the
|
|
46
|
+
// number of requests received over the interval of time t_0 to
|
|
47
|
+
// t_0+1 with a value of 3.
|
|
48
|
+
// 6. A request is received, the system measures 1 request.
|
|
49
|
+
// 7. A request is received, the system measures 1 request.
|
|
50
|
+
// 8. The 1 second collection cycle ends. A metric is exported for the
|
|
51
|
+
// number of requests received over the interval of time t_0+1 to
|
|
52
|
+
// t_0+2 with a value of 2.
|
|
53
|
+
AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA";
|
|
54
|
+
// CUMULATIVE is an AggregationTemporality for a metric aggregator which
|
|
55
|
+
// reports changes since a fixed start time. This means that current values
|
|
56
|
+
// of a CUMULATIVE metric depend on all previous measurements since the
|
|
57
|
+
// start time. Because of this, the sender is required to retain this state
|
|
58
|
+
// in some form. If this state is lost or invalidated, the CUMULATIVE metric
|
|
59
|
+
// values MUST be reset and a new fixed start time following the last
|
|
60
|
+
// reported measurement time sent MUST be used.
|
|
61
|
+
//
|
|
62
|
+
// For example, consider a system measuring the number of requests that
|
|
63
|
+
// it receives and reports the sum of these requests every second as a
|
|
64
|
+
// CUMULATIVE metric:
|
|
65
|
+
//
|
|
66
|
+
// 1. The system starts receiving at time=t_0.
|
|
67
|
+
// 2. A request is received, the system measures 1 request.
|
|
68
|
+
// 3. A request is received, the system measures 1 request.
|
|
69
|
+
// 4. A request is received, the system measures 1 request.
|
|
70
|
+
// 5. The 1 second collection cycle ends. A metric is exported for the
|
|
71
|
+
// number of requests received over the interval of time t_0 to
|
|
72
|
+
// t_0+1 with a value of 3.
|
|
73
|
+
// 6. A request is received, the system measures 1 request.
|
|
74
|
+
// 7. A request is received, the system measures 1 request.
|
|
75
|
+
// 8. The 1 second collection cycle ends. A metric is exported for the
|
|
76
|
+
// number of requests received over the interval of time t_0 to
|
|
77
|
+
// t_0+2 with a value of 5.
|
|
78
|
+
// 9. The system experiences a fault and loses state.
|
|
79
|
+
// 10. The system recovers and resumes receiving at time=t_1.
|
|
80
|
+
// 11. A request is received, the system measures 1 request.
|
|
81
|
+
// 12. The 1 second collection cycle ends. A metric is exported for the
|
|
82
|
+
// number of requests received over the interval of time t_1 to
|
|
83
|
+
// t_0+1 with a value of 1.
|
|
84
|
+
//
|
|
85
|
+
// Note: Even though, when reporting changes since last report time, using
|
|
86
|
+
// CUMULATIVE is valid, it is not recommended. This may cause problems for
|
|
87
|
+
// systems that do not use start_time to determine when the aggregation
|
|
88
|
+
// value was reset (e.g. Prometheus).
|
|
89
|
+
AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE";
|
|
90
|
+
})(AggregationTemporality = v1.AggregationTemporality || (v1.AggregationTemporality = {}));
|
|
91
|
+
})(v1 = metrics.v1 || (metrics.v1 = {}));
|
|
92
|
+
})(metrics = opentelemetryProto.metrics || (opentelemetryProto.metrics = {}));
|
|
93
|
+
let trace;
|
|
94
|
+
(function (trace) {
|
|
95
|
+
let v1;
|
|
96
|
+
(function (v1) {
|
|
97
|
+
let ConstantSampler;
|
|
98
|
+
(function (ConstantSampler) {
|
|
99
|
+
let ConstantDecision;
|
|
100
|
+
(function (ConstantDecision) {
|
|
101
|
+
ConstantDecision[ConstantDecision["ALWAYS_OFF"] = 0] = "ALWAYS_OFF";
|
|
102
|
+
ConstantDecision[ConstantDecision["ALWAYS_ON"] = 1] = "ALWAYS_ON";
|
|
103
|
+
ConstantDecision[ConstantDecision["ALWAYS_PARENT"] = 2] = "ALWAYS_PARENT";
|
|
104
|
+
})(ConstantDecision = ConstantSampler.ConstantDecision || (ConstantSampler.ConstantDecision = {}));
|
|
105
|
+
})(ConstantSampler = v1.ConstantSampler || (v1.ConstantSampler = {}));
|
|
106
|
+
let Span;
|
|
107
|
+
(function (Span) {
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
109
|
+
let SpanKind;
|
|
110
|
+
(function (SpanKind) {
|
|
111
|
+
SpanKind[SpanKind["SPAN_KIND_UNSPECIFIED"] = 0] = "SPAN_KIND_UNSPECIFIED";
|
|
112
|
+
SpanKind[SpanKind["SPAN_KIND_INTERNAL"] = 1] = "SPAN_KIND_INTERNAL";
|
|
113
|
+
SpanKind[SpanKind["SPAN_KIND_SERVER"] = 2] = "SPAN_KIND_SERVER";
|
|
114
|
+
SpanKind[SpanKind["SPAN_KIND_CLIENT"] = 3] = "SPAN_KIND_CLIENT";
|
|
115
|
+
SpanKind[SpanKind["SPAN_KIND_PRODUCER"] = 4] = "SPAN_KIND_PRODUCER";
|
|
116
|
+
SpanKind[SpanKind["SPAN_KIND_CONSUMER"] = 5] = "SPAN_KIND_CONSUMER";
|
|
117
|
+
})(SpanKind = Span.SpanKind || (Span.SpanKind = {}));
|
|
118
|
+
})(Span = v1.Span || (v1.Span = {}));
|
|
119
|
+
})(v1 = trace.v1 || (trace.v1 = {}));
|
|
120
|
+
})(trace = opentelemetryProto.trace || (opentelemetryProto.trace = {}));
|
|
121
|
+
let common;
|
|
122
|
+
(function (common) {
|
|
123
|
+
let v1;
|
|
124
|
+
(function (v1) {
|
|
125
|
+
let ValueType;
|
|
126
|
+
(function (ValueType) {
|
|
127
|
+
ValueType[ValueType["STRING"] = 0] = "STRING";
|
|
128
|
+
ValueType[ValueType["INT"] = 1] = "INT";
|
|
129
|
+
ValueType[ValueType["DOUBLE"] = 2] = "DOUBLE";
|
|
130
|
+
ValueType[ValueType["BOOL"] = 3] = "BOOL";
|
|
131
|
+
})(ValueType = v1.ValueType || (v1.ValueType = {}));
|
|
132
|
+
})(v1 = common.v1 || (common.v1 = {}));
|
|
133
|
+
})(common = opentelemetryProto.common || (opentelemetryProto.common = {}));
|
|
134
|
+
})(opentelemetryProto || (opentelemetryProto = {}));
|
|
135
|
+
/**
|
|
136
|
+
* Mapping between api SpanKind and proto SpanKind
|
|
137
|
+
*/
|
|
138
|
+
export const OTLP_SPAN_KIND_MAPPING = {
|
|
139
|
+
[SpanKind.INTERNAL]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL,
|
|
140
|
+
[SpanKind.SERVER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_SERVER,
|
|
141
|
+
[SpanKind.CLIENT]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CLIENT,
|
|
142
|
+
[SpanKind.PRODUCER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_PRODUCER,
|
|
143
|
+
[SpanKind.CONSUMER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CONSUMER,
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.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 { SpanKind, SpanStatusCode } from '@opentelemetry/api';\n\n/* eslint-disable @typescript-eslint/no-namespace */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\nexport namespace opentelemetryProto {\n export namespace collector {\n export namespace trace.v1 {\n export interface TraceService {\n service: opentelemetryProto.collector.trace.v1.TraceService;\n }\n\n export interface ExportTraceServiceRequest {\n resourceSpans: opentelemetryProto.trace.v1.ResourceSpans[];\n }\n }\n export namespace metrics.v1 {\n export interface ExportMetricsServiceRequest {\n resourceMetrics: opentelemetryProto.metrics.v1.ResourceMetrics[];\n }\n }\n }\n\n export namespace resource.v1 {\n export interface Resource {\n attributes: opentelemetryProto.common.v1.KeyValue[];\n droppedAttributesCount: number;\n }\n }\n\n export namespace metrics.v1 {\n export interface Metric {\n name: string;\n description: string;\n unit: string;\n // data:\n intGauge?: opentelemetryProto.metrics.v1.Gauge;\n doubleGauge?: opentelemetryProto.metrics.v1.Gauge;\n intSum?: opentelemetryProto.metrics.v1.Sum;\n doubleSum?: opentelemetryProto.metrics.v1.Sum;\n intHistogram?: opentelemetryProto.metrics.v1.Histogram;\n doubleHistogram?: opentelemetryProto.metrics.v1.Histogram;\n }\n\n export interface Gauge {\n dataPoints: opentelemetryProto.metrics.v1.DataPoint[];\n }\n\n export interface Sum {\n dataPoints: opentelemetryProto.metrics.v1.DataPoint[];\n aggregationTemporality: opentelemetryProto.metrics.v1.AggregationTemporality;\n isMonotonic: boolean;\n }\n\n export interface Histogram {\n dataPoints: opentelemetryProto.metrics.v1.HistogramDataPoint[];\n aggregationTemporality: opentelemetryProto.metrics.v1.AggregationTemporality;\n }\n\n export interface DataPoint {\n labels: opentelemetryProto.common.v1.StringKeyValue[];\n startTimeUnixNano: number;\n timeUnixNano: number;\n value: number;\n exemplars?: opentelemetryProto.metrics.v1.Exemplar[];\n }\n\n export interface Exemplar {\n filteredLabels: opentelemetryProto.common.v1.StringKeyValue[];\n timeUnixNano: number;\n value: number;\n spanId: Uint8Array;\n traceId: Uint8Array;\n }\n\n export interface HistogramDataPoint {\n labels: opentelemetryProto.common.v1.StringKeyValue[];\n startTimeUnixNano: number;\n timeUnixNano: number;\n count: number;\n sum: number;\n bucketCounts?: number[];\n explicitBounds?: number[];\n exemplars?: opentelemetryProto.metrics.v1.Exemplar[][];\n }\n\n export interface InstrumentationLibraryMetrics {\n instrumentationLibrary?: opentelemetryProto.common.v1.InstrumentationLibrary;\n metrics: opentelemetryProto.metrics.v1.Metric[];\n }\n\n export interface ResourceMetrics {\n resource?: opentelemetryProto.resource.v1.Resource;\n instrumentationLibraryMetrics: opentelemetryProto.metrics.v1.InstrumentationLibraryMetrics[];\n }\n\n export enum AggregationTemporality {\n // UNSPECIFIED is the default AggregationTemporality, it MUST not be used.\n AGGREGATION_TEMPORALITY_UNSPECIFIED = 0,\n\n // DELTA is an AggregationTemporality for a metric aggregator which reports\n // changes since last report time. Successive metrics contain aggregation of\n // values from continuous and non-overlapping intervals.\n //\n // The values for a DELTA metric are based only on the time interval\n // associated with one measurement cycle. There is no dependency on\n // previous measurements like is the case for CUMULATIVE metrics.\n //\n // For example, consider a system measuring the number of requests that\n // it receives and reports the sum of these requests every second as a\n // DELTA metric:\n //\n // 1. The system starts receiving at time=t_0.\n // 2. A request is received, the system measures 1 request.\n // 3. A request is received, the system measures 1 request.\n // 4. A request is received, the system measures 1 request.\n // 5. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+1 with a value of 3.\n // 6. A request is received, the system measures 1 request.\n // 7. A request is received, the system measures 1 request.\n // 8. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0+1 to\n // t_0+2 with a value of 2.\n AGGREGATION_TEMPORALITY_DELTA = 1,\n\n // CUMULATIVE is an AggregationTemporality for a metric aggregator which\n // reports changes since a fixed start time. This means that current values\n // of a CUMULATIVE metric depend on all previous measurements since the\n // start time. Because of this, the sender is required to retain this state\n // in some form. If this state is lost or invalidated, the CUMULATIVE metric\n // values MUST be reset and a new fixed start time following the last\n // reported measurement time sent MUST be used.\n //\n // For example, consider a system measuring the number of requests that\n // it receives and reports the sum of these requests every second as a\n // CUMULATIVE metric:\n //\n // 1. The system starts receiving at time=t_0.\n // 2. A request is received, the system measures 1 request.\n // 3. A request is received, the system measures 1 request.\n // 4. A request is received, the system measures 1 request.\n // 5. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+1 with a value of 3.\n // 6. A request is received, the system measures 1 request.\n // 7. A request is received, the system measures 1 request.\n // 8. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+2 with a value of 5.\n // 9. The system experiences a fault and loses state.\n // 10. The system recovers and resumes receiving at time=t_1.\n // 11. A request is received, the system measures 1 request.\n // 12. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_1 to\n // t_0+1 with a value of 1.\n //\n // Note: Even though, when reporting changes since last report time, using\n // CUMULATIVE is valid, it is not recommended. This may cause problems for\n // systems that do not use start_time to determine when the aggregation\n // value was reset (e.g. Prometheus).\n AGGREGATION_TEMPORALITY_CUMULATIVE = 2,\n }\n }\n\n export namespace trace.v1 {\n export namespace ConstantSampler {\n export enum ConstantDecision {\n ALWAYS_OFF = 0,\n ALWAYS_ON = 1,\n ALWAYS_PARENT = 2,\n }\n }\n export namespace Span {\n export interface Event {\n timeUnixNano: number;\n name: string;\n attributes?: opentelemetryProto.common.v1.KeyValue[];\n droppedAttributesCount: number;\n }\n\n export interface Link {\n traceId: string;\n spanId: string;\n traceState?: opentelemetryProto.trace.v1.Span.TraceState;\n attributes?: opentelemetryProto.common.v1.KeyValue[];\n droppedAttributesCount: number;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n export enum SpanKind {\n SPAN_KIND_UNSPECIFIED,\n SPAN_KIND_INTERNAL,\n SPAN_KIND_SERVER,\n SPAN_KIND_CLIENT,\n SPAN_KIND_PRODUCER,\n SPAN_KIND_CONSUMER,\n }\n\n export type TraceState = string | undefined;\n }\n\n export interface ConstantSampler {\n decision?: opentelemetryProto.trace.v1.ConstantSampler.ConstantDecision;\n }\n\n export interface InstrumentationLibrarySpans {\n instrumentationLibrary?: opentelemetryProto.common.v1.InstrumentationLibrary;\n spans: opentelemetryProto.trace.v1.Span[];\n }\n\n export interface ProbabilitySampler {\n samplingProbability?: number | null;\n }\n\n export interface RateLimitingSampler {\n qps?: number | null;\n }\n\n export interface ResourceSpans {\n resource?: opentelemetryProto.resource.v1.Resource;\n instrumentationLibrarySpans: opentelemetryProto.trace.v1.InstrumentationLibrarySpans[];\n }\n\n export interface Span {\n traceId: string;\n spanId: string;\n traceState: opentelemetryProto.trace.v1.Span.TraceState;\n parentSpanId?: string;\n name?: string;\n kind?: opentelemetryProto.trace.v1.Span.SpanKind;\n startTimeUnixNano?: number;\n endTimeUnixNano?: number;\n attributes?: opentelemetryProto.common.v1.KeyValue[];\n droppedAttributesCount: number;\n events?: opentelemetryProto.trace.v1.Span.Event[];\n droppedEventsCount: number;\n links?: opentelemetryProto.trace.v1.Span.Link[];\n droppedLinksCount: number;\n status?: SpanStatus;\n }\n\n export interface SpanStatus {\n /** The status code of this message. */\n code: SpanStatusCode;\n /** A developer-facing error message. */\n message?: string;\n }\n\n export interface TraceConfig {\n constantSampler?: ConstantSampler | null;\n probabilitySampler?: ProbabilitySampler | null;\n rateLimitingSampler?: RateLimitingSampler | null;\n }\n }\n export namespace common.v1 {\n export interface KeyValue {\n key: string;\n value: AnyValue;\n }\n\n export type ArrayValue = {\n values: AnyValue[];\n };\n\n export interface KeyValueList {\n values: KeyValue[];\n }\n\n export type AnyValue = {\n stringValue?: string;\n boolValue?: boolean;\n intValue?: number;\n doubleValue?: number;\n arrayValue?: ArrayValue;\n kvlistValue?: KeyValueList;\n };\n\n export interface InstrumentationLibrary {\n name: string;\n version?: string;\n }\n\n export interface StringKeyValue {\n key: string;\n value: string;\n }\n\n export enum ValueType {\n STRING,\n INT,\n DOUBLE,\n BOOL,\n }\n }\n}\n\n/**\n * Mapping between api SpanKind and proto SpanKind\n */\nexport const OTLP_SPAN_KIND_MAPPING = {\n [SpanKind.INTERNAL]:\n opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL,\n [SpanKind.SERVER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_SERVER,\n [SpanKind.CLIENT]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CLIENT,\n [SpanKind.PRODUCER]:\n opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_PRODUCER,\n [SpanKind.CONSUMER]:\n opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CONSUMER,\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
// this is autogenerated file, see scripts/version-update.js
|
|
17
|
+
export const VERSION = '0.28.0';
|
|
18
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","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\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.28.0';\n"]}
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export * from './OTLPExporterBase';
|
|
2
1
|
export * from './platform';
|
|
3
2
|
export * as otlpTypes from './types';
|
|
4
3
|
export { toCollectorResource, toOTLPExportTraceServiceRequest } from './transform';
|
|
5
|
-
export { appendResourcePathToUrlIfNotPresent } from './util';
|
|
6
4
|
//# sourceMappingURL=index.d.ts.map
|
package/build/src/index.js
CHANGED
|
@@ -25,13 +25,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
29
|
-
__exportStar(require("./OTLPExporterBase"), exports);
|
|
28
|
+
exports.toOTLPExportTraceServiceRequest = exports.toCollectorResource = exports.otlpTypes = void 0;
|
|
30
29
|
__exportStar(require("./platform"), exports);
|
|
31
30
|
exports.otlpTypes = require("./types");
|
|
32
31
|
var transform_1 = require("./transform");
|
|
33
32
|
Object.defineProperty(exports, "toCollectorResource", { enumerable: true, get: function () { return transform_1.toCollectorResource; } });
|
|
34
33
|
Object.defineProperty(exports, "toOTLPExportTraceServiceRequest", { enumerable: true, get: function () { return transform_1.toOTLPExportTraceServiceRequest; } });
|
|
35
|
-
var util_1 = require("./util");
|
|
36
|
-
Object.defineProperty(exports, "appendResourcePathToUrlIfNotPresent", { enumerable: true, get: function () { return util_1.appendResourcePathToUrlIfNotPresent; } });
|
|
37
34
|
//# sourceMappingURL=index.js.map
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,uCAAqC;AACrC,yCAAmF;AAA1E,gHAAA,mBAAmB,OAAA;AAAE,4HAAA,+BAA+B,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 './platform';\nexport * as otlpTypes from './types';\nexport { toCollectorResource, toOTLPExportTraceServiceRequest } from './transform';\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OTLPExporterBrowserBase } from './OTLPExporterBrowserBase';
|
|
1
|
+
import { OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';
|
|
3
2
|
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
4
3
|
import * as otlpTypes from '../../types';
|
|
4
|
+
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
5
5
|
/**
|
|
6
6
|
* Collector Trace Exporter for Web
|
|
7
7
|
*/
|
|
@@ -16,30 +16,29 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.OTLPTraceExporter = void 0;
|
|
19
|
-
const
|
|
19
|
+
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
|
|
20
20
|
const transform_1 = require("../../transform");
|
|
21
21
|
const core_1 = require("@opentelemetry/core");
|
|
22
|
-
const util_1 = require("../../util");
|
|
23
22
|
const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';
|
|
24
|
-
const DEFAULT_COLLECTOR_URL = `http://localhost:
|
|
23
|
+
const DEFAULT_COLLECTOR_URL = `http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
25
24
|
/**
|
|
26
25
|
* Collector Trace Exporter for Web
|
|
27
26
|
*/
|
|
28
|
-
class OTLPTraceExporter extends
|
|
27
|
+
class OTLPTraceExporter extends otlp_exporter_base_1.OTLPExporterBrowserBase {
|
|
29
28
|
constructor(config = {}) {
|
|
30
29
|
super(config);
|
|
31
|
-
this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
|
|
30
|
+
this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
|
|
32
31
|
}
|
|
33
32
|
convert(spans) {
|
|
34
|
-
return transform_1.toOTLPExportTraceServiceRequest(spans, this, true);
|
|
33
|
+
return (0, transform_1.toOTLPExportTraceServiceRequest)(spans, this, true);
|
|
35
34
|
}
|
|
36
35
|
getDefaultUrl(config) {
|
|
37
36
|
return typeof config.url === 'string'
|
|
38
37
|
? config.url
|
|
39
|
-
: core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
|
|
40
|
-
? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
41
|
-
: core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
42
|
-
?
|
|
38
|
+
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
|
|
39
|
+
? (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
40
|
+
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
41
|
+
? (0, otlp_exporter_base_1.appendResourcePathToUrlIfNotPresent)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
43
42
|
: DEFAULT_COLLECTOR_URL;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;
|
|
1
|
+
{"version":3,"file":"OTLPTraceExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPTraceExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,0EAAiH;AAEjH,+CAAkE;AAElE,8CAA2D;AAG3D,MAAM,+BAA+B,GAAG,YAAY,CAAC;AACrD,MAAM,qBAAqB,GAAC,wBAAwB,+BAA+B,EAAE,CAAC;AAEtF;;GAEG;AACH,MAAa,iBACX,SAAQ,4CAGP;IAED,YAAY,SAAiC,EAAE;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAC3B,IAAI,CAAC,QAAQ,EACb,mBAAY,CAAC,uBAAuB,CAClC,IAAA,aAAM,GAAE,CAAC,iCAAiC,CAC3C,CACF,CAAC;IACJ,CAAC;IACD,OAAO,CACL,KAAqB;QAErB,OAAO,IAAA,2CAA+B,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,aAAa,CAAC,MAA8B;QAC1C,OAAO,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YACnC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAAC,MAAM,GAAG,CAAC;gBACxD,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC;gBAC7C,CAAC,CAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC;oBACjD,CAAC,CAAC,IAAA,wDAAmC,EAAC,IAAA,aAAM,GAAE,CAAC,2BAA2B,EAAE,+BAA+B,CAAC;oBAC5G,CAAC,CAAC,qBAAqB,CAAC;IAC5B,CAAC;CACF;AA9BD,8CA8BC","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 { appendResourcePathToUrlIfNotPresent, OTLPExporterBrowserBase } from '@opentelemetry/otlp-exporter-base';\nimport { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\nimport { toOTLPExportTraceServiceRequest } from '../../transform';\nimport * as otlpTypes from '../../types';\nimport { getEnv, baggageUtils } from '@opentelemetry/core';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\n\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';\nconst DEFAULT_COLLECTOR_URL=`http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n\n/**\n * Collector Trace Exporter for Web\n */\nexport class OTLPTraceExporter\n extends OTLPExporterBrowserBase<\n ReadableSpan,\n otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest\n >\n implements SpanExporter {\n constructor(config: OTLPExporterConfigBase = {}) {\n super(config);\n this._headers = Object.assign(\n this._headers,\n baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS\n )\n );\n }\n convert(\n spans: ReadableSpan[]\n ): otlpTypes.opentelemetryProto.collector.trace.v1.ExportTraceServiceRequest {\n return toOTLPExportTraceServiceRequest(spans, this, true);\n }\n\n getDefaultUrl(config: OTLPExporterConfigBase): string {\n return typeof config.url === 'string'\n ? config.url\n : getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\n : getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? appendResourcePathToUrlIfNotPresent(getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\n"]}
|
|
@@ -26,5 +26,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
__exportStar(require("./OTLPTraceExporter"), exports);
|
|
29
|
-
__exportStar(require("./OTLPExporterBrowserBase"), exports);
|
|
30
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,sDAAoC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,sDAAoC","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 './OTLPTraceExporter';\n"]}
|
|
@@ -25,8 +25,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.OTLPExporterBrowserBase = void 0;
|
|
29
28
|
__exportStar(require("./node"), exports);
|
|
30
|
-
var browser_1 = require("./browser");
|
|
31
|
-
Object.defineProperty(exports, "OTLPExporterBrowserBase", { enumerable: true, get: function () { return browser_1.OTLPExporterBrowserBase; } });
|
|
32
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,yCAAuB","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 './node';\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
2
|
-
import { OTLPExporterNodeBase } from './OTLPExporterNodeBase';
|
|
3
|
-
import { OTLPExporterNodeConfigBase } from './types';
|
|
4
2
|
import * as otlpTypes from '../../types';
|
|
3
|
+
import { OTLPExporterNodeBase } from '@opentelemetry/otlp-exporter-base';
|
|
4
|
+
import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
|
|
5
5
|
/**
|
|
6
6
|
* Collector Trace Exporter for Node
|
|
7
7
|
*/
|
|
@@ -16,30 +16,30 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.OTLPTraceExporter = void 0;
|
|
19
|
-
const OTLPExporterNodeBase_1 = require("./OTLPExporterNodeBase");
|
|
20
19
|
const transform_1 = require("../../transform");
|
|
21
20
|
const core_1 = require("@opentelemetry/core");
|
|
22
|
-
const
|
|
21
|
+
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
|
|
22
|
+
const otlp_exporter_base_2 = require("@opentelemetry/otlp-exporter-base");
|
|
23
23
|
const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';
|
|
24
|
-
const DEFAULT_COLLECTOR_URL = `http://localhost:
|
|
24
|
+
const DEFAULT_COLLECTOR_URL = `http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
|
|
25
25
|
/**
|
|
26
26
|
* Collector Trace Exporter for Node
|
|
27
27
|
*/
|
|
28
|
-
class OTLPTraceExporter extends
|
|
28
|
+
class OTLPTraceExporter extends otlp_exporter_base_1.OTLPExporterNodeBase {
|
|
29
29
|
constructor(config = {}) {
|
|
30
30
|
super(config);
|
|
31
|
-
this.headers = Object.assign(this.headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
|
|
31
|
+
this.headers = Object.assign(this.headers, core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS));
|
|
32
32
|
}
|
|
33
33
|
convert(spans) {
|
|
34
|
-
return transform_1.toOTLPExportTraceServiceRequest(spans, this, true);
|
|
34
|
+
return (0, transform_1.toOTLPExportTraceServiceRequest)(spans, this, true);
|
|
35
35
|
}
|
|
36
36
|
getDefaultUrl(config) {
|
|
37
37
|
return typeof config.url === 'string'
|
|
38
38
|
? config.url
|
|
39
|
-
: core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
|
|
40
|
-
? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
41
|
-
: core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
42
|
-
?
|
|
39
|
+
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0
|
|
40
|
+
? (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
41
|
+
: (0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0
|
|
42
|
+
? (0, otlp_exporter_base_2.appendResourcePathToUrlIfNotPresent)((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)
|
|
43
43
|
: DEFAULT_COLLECTOR_URL;
|
|
44
44
|
}
|
|
45
45
|
}
|