@opentelemetry/exporter-trace-otlp-http 0.28.0 → 0.29.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.
Files changed (56) hide show
  1. package/README.md +44 -12
  2. package/build/esm/index.d.ts +0 -2
  3. package/build/esm/index.js +0 -3
  4. package/build/esm/index.js.map +1 -1
  5. package/build/esm/platform/browser/OTLPTraceExporter.d.ts +4 -5
  6. package/build/esm/platform/browser/OTLPTraceExporter.js +7 -7
  7. package/build/esm/platform/browser/OTLPTraceExporter.js.map +1 -1
  8. package/build/esm/platform/node/OTLPTraceExporter.d.ts +3 -3
  9. package/build/esm/platform/node/OTLPTraceExporter.js +7 -7
  10. package/build/esm/platform/node/OTLPTraceExporter.js.map +1 -1
  11. package/build/esm/version.d.ts +1 -1
  12. package/build/esm/version.js +1 -1
  13. package/build/esm/version.js.map +1 -1
  14. package/build/esnext/index.d.ts +0 -2
  15. package/build/esnext/index.js +0 -2
  16. package/build/esnext/index.js.map +1 -1
  17. package/build/esnext/platform/browser/OTLPTraceExporter.d.ts +4 -5
  18. package/build/esnext/platform/browser/OTLPTraceExporter.js +7 -7
  19. package/build/esnext/platform/browser/OTLPTraceExporter.js.map +1 -1
  20. package/build/esnext/platform/node/OTLPTraceExporter.d.ts +3 -3
  21. package/build/esnext/platform/node/OTLPTraceExporter.js +7 -7
  22. package/build/esnext/platform/node/OTLPTraceExporter.js.map +1 -1
  23. package/build/esnext/version.d.ts +1 -1
  24. package/build/esnext/version.js +1 -1
  25. package/build/esnext/version.js.map +1 -1
  26. package/build/src/index.d.ts +0 -2
  27. package/build/src/index.js +0 -5
  28. package/build/src/index.js.map +1 -1
  29. package/build/src/platform/browser/OTLPTraceExporter.d.ts +4 -5
  30. package/build/src/platform/browser/OTLPTraceExporter.js +7 -7
  31. package/build/src/platform/browser/OTLPTraceExporter.js.map +1 -1
  32. package/build/src/platform/node/OTLPTraceExporter.d.ts +3 -3
  33. package/build/src/platform/node/OTLPTraceExporter.js +6 -6
  34. package/build/src/platform/node/OTLPTraceExporter.js.map +1 -1
  35. package/build/src/version.d.ts +1 -1
  36. package/build/src/version.js +1 -1
  37. package/build/src/version.js.map +1 -1
  38. package/package.json +8 -7
  39. package/build/esm/transform.d.ts +0 -80
  40. package/build/esm/transform.js +0 -287
  41. package/build/esm/transform.js.map +0 -1
  42. package/build/esm/types.d.ts +0 -209
  43. package/build/esm/types.js +0 -146
  44. package/build/esm/types.js.map +0 -1
  45. package/build/esnext/transform.d.ts +0 -80
  46. package/build/esnext/transform.js +0 -266
  47. package/build/esnext/transform.js.map +0 -1
  48. package/build/esnext/types.d.ts +0 -209
  49. package/build/esnext/types.js +0 -145
  50. package/build/esnext/types.js.map +0 -1
  51. package/build/src/transform.d.ts +0 -80
  52. package/build/src/transform.js +0 -282
  53. package/build/src/transform.js.map +0 -1
  54. package/build/src/types.d.ts +0 -209
  55. package/build/src/types.js +0 -148
  56. package/build/src/types.js.map +0 -1
@@ -1,148 +0,0 @@
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.OTLP_SPAN_KIND_MAPPING = exports.opentelemetryProto = void 0;
19
- const api_1 = require("@opentelemetry/api");
20
- /* eslint-disable @typescript-eslint/no-namespace */
21
- /* eslint-disable @typescript-eslint/no-unused-vars */
22
- var opentelemetryProto;
23
- (function (opentelemetryProto) {
24
- let metrics;
25
- (function (metrics) {
26
- let v1;
27
- (function (v1) {
28
- let AggregationTemporality;
29
- (function (AggregationTemporality) {
30
- // UNSPECIFIED is the default AggregationTemporality, it MUST not be used.
31
- AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED";
32
- // DELTA is an AggregationTemporality for a metric aggregator which reports
33
- // changes since last report time. Successive metrics contain aggregation of
34
- // values from continuous and non-overlapping intervals.
35
- //
36
- // The values for a DELTA metric are based only on the time interval
37
- // associated with one measurement cycle. There is no dependency on
38
- // previous measurements like is the case for CUMULATIVE metrics.
39
- //
40
- // For example, consider a system measuring the number of requests that
41
- // it receives and reports the sum of these requests every second as a
42
- // DELTA metric:
43
- //
44
- // 1. The system starts receiving at time=t_0.
45
- // 2. A request is received, the system measures 1 request.
46
- // 3. A request is received, the system measures 1 request.
47
- // 4. A request is received, the system measures 1 request.
48
- // 5. The 1 second collection cycle ends. A metric is exported for the
49
- // number of requests received over the interval of time t_0 to
50
- // t_0+1 with a value of 3.
51
- // 6. A request is received, the system measures 1 request.
52
- // 7. A request is received, the system measures 1 request.
53
- // 8. The 1 second collection cycle ends. A metric is exported for the
54
- // number of requests received over the interval of time t_0+1 to
55
- // t_0+2 with a value of 2.
56
- AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA";
57
- // CUMULATIVE is an AggregationTemporality for a metric aggregator which
58
- // reports changes since a fixed start time. This means that current values
59
- // of a CUMULATIVE metric depend on all previous measurements since the
60
- // start time. Because of this, the sender is required to retain this state
61
- // in some form. If this state is lost or invalidated, the CUMULATIVE metric
62
- // values MUST be reset and a new fixed start time following the last
63
- // reported measurement time sent MUST be used.
64
- //
65
- // For example, consider a system measuring the number of requests that
66
- // it receives and reports the sum of these requests every second as a
67
- // CUMULATIVE metric:
68
- //
69
- // 1. The system starts receiving at time=t_0.
70
- // 2. A request is received, the system measures 1 request.
71
- // 3. A request is received, the system measures 1 request.
72
- // 4. A request is received, the system measures 1 request.
73
- // 5. The 1 second collection cycle ends. A metric is exported for the
74
- // number of requests received over the interval of time t_0 to
75
- // t_0+1 with a value of 3.
76
- // 6. A request is received, the system measures 1 request.
77
- // 7. A request is received, the system measures 1 request.
78
- // 8. The 1 second collection cycle ends. A metric is exported for the
79
- // number of requests received over the interval of time t_0 to
80
- // t_0+2 with a value of 5.
81
- // 9. The system experiences a fault and loses state.
82
- // 10. The system recovers and resumes receiving at time=t_1.
83
- // 11. A request is received, the system measures 1 request.
84
- // 12. The 1 second collection cycle ends. A metric is exported for the
85
- // number of requests received over the interval of time t_1 to
86
- // t_0+1 with a value of 1.
87
- //
88
- // Note: Even though, when reporting changes since last report time, using
89
- // CUMULATIVE is valid, it is not recommended. This may cause problems for
90
- // systems that do not use start_time to determine when the aggregation
91
- // value was reset (e.g. Prometheus).
92
- AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE";
93
- })(AggregationTemporality = v1.AggregationTemporality || (v1.AggregationTemporality = {}));
94
- })(v1 = metrics.v1 || (metrics.v1 = {}));
95
- })(metrics = opentelemetryProto.metrics || (opentelemetryProto.metrics = {}));
96
- let trace;
97
- (function (trace) {
98
- let v1;
99
- (function (v1) {
100
- let ConstantSampler;
101
- (function (ConstantSampler) {
102
- let ConstantDecision;
103
- (function (ConstantDecision) {
104
- ConstantDecision[ConstantDecision["ALWAYS_OFF"] = 0] = "ALWAYS_OFF";
105
- ConstantDecision[ConstantDecision["ALWAYS_ON"] = 1] = "ALWAYS_ON";
106
- ConstantDecision[ConstantDecision["ALWAYS_PARENT"] = 2] = "ALWAYS_PARENT";
107
- })(ConstantDecision = ConstantSampler.ConstantDecision || (ConstantSampler.ConstantDecision = {}));
108
- })(ConstantSampler = v1.ConstantSampler || (v1.ConstantSampler = {}));
109
- let Span;
110
- (function (Span) {
111
- // eslint-disable-next-line @typescript-eslint/no-shadow
112
- let SpanKind;
113
- (function (SpanKind) {
114
- SpanKind[SpanKind["SPAN_KIND_UNSPECIFIED"] = 0] = "SPAN_KIND_UNSPECIFIED";
115
- SpanKind[SpanKind["SPAN_KIND_INTERNAL"] = 1] = "SPAN_KIND_INTERNAL";
116
- SpanKind[SpanKind["SPAN_KIND_SERVER"] = 2] = "SPAN_KIND_SERVER";
117
- SpanKind[SpanKind["SPAN_KIND_CLIENT"] = 3] = "SPAN_KIND_CLIENT";
118
- SpanKind[SpanKind["SPAN_KIND_PRODUCER"] = 4] = "SPAN_KIND_PRODUCER";
119
- SpanKind[SpanKind["SPAN_KIND_CONSUMER"] = 5] = "SPAN_KIND_CONSUMER";
120
- })(SpanKind = Span.SpanKind || (Span.SpanKind = {}));
121
- })(Span = v1.Span || (v1.Span = {}));
122
- })(v1 = trace.v1 || (trace.v1 = {}));
123
- })(trace = opentelemetryProto.trace || (opentelemetryProto.trace = {}));
124
- let common;
125
- (function (common) {
126
- let v1;
127
- (function (v1) {
128
- let ValueType;
129
- (function (ValueType) {
130
- ValueType[ValueType["STRING"] = 0] = "STRING";
131
- ValueType[ValueType["INT"] = 1] = "INT";
132
- ValueType[ValueType["DOUBLE"] = 2] = "DOUBLE";
133
- ValueType[ValueType["BOOL"] = 3] = "BOOL";
134
- })(ValueType = v1.ValueType || (v1.ValueType = {}));
135
- })(v1 = common.v1 || (common.v1 = {}));
136
- })(common = opentelemetryProto.common || (opentelemetryProto.common = {}));
137
- })(opentelemetryProto = exports.opentelemetryProto || (exports.opentelemetryProto = {}));
138
- /**
139
- * Mapping between api SpanKind and proto SpanKind
140
- */
141
- exports.OTLP_SPAN_KIND_MAPPING = {
142
- [api_1.SpanKind.INTERNAL]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL,
143
- [api_1.SpanKind.SERVER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_SERVER,
144
- [api_1.SpanKind.CLIENT]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CLIENT,
145
- [api_1.SpanKind.PRODUCER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_PRODUCER,
146
- [api_1.SpanKind.CONSUMER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CONSUMER,
147
- };
148
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA8D;AAE9D,oDAAoD;AACpD,sDAAsD;AAEtD,IAAiB,kBAAkB,CAkSlC;AAlSD,WAAiB,kBAAkB;IAyBjC,IAAiB,OAAO,CAqIvB;IArID,WAAiB,OAAO;QAAC,IAAA,EAAE,CAqI1B;QArIwB,WAAA,EAAE;YAkEzB,IAAY,sBAkEX;YAlED,WAAY,sBAAsB;gBAChC,0EAA0E;gBAC1E,iIAAuC,CAAA;gBAEvC,2EAA2E;gBAC3E,4EAA4E;gBAC5E,wDAAwD;gBACxD,EAAE;gBACF,oEAAoE;gBACpE,mEAAmE;gBACnE,iEAAiE;gBACjE,EAAE;gBACF,uEAAuE;gBACvE,sEAAsE;gBACtE,gBAAgB;gBAChB,EAAE;gBACF,gDAAgD;gBAChD,6DAA6D;gBAC7D,6DAA6D;gBAC7D,6DAA6D;gBAC7D,wEAAwE;gBACxE,oEAAoE;gBACpE,gCAAgC;gBAChC,6DAA6D;gBAC7D,6DAA6D;gBAC7D,wEAAwE;gBACxE,sEAAsE;gBACtE,gCAAgC;gBAChC,qHAAiC,CAAA;gBAEjC,wEAAwE;gBACxE,2EAA2E;gBAC3E,uEAAuE;gBACvE,2EAA2E;gBAC3E,4EAA4E;gBAC5E,qEAAqE;gBACrE,+CAA+C;gBAC/C,EAAE;gBACF,uEAAuE;gBACvE,sEAAsE;gBACtE,qBAAqB;gBACrB,EAAE;gBACF,gDAAgD;gBAChD,6DAA6D;gBAC7D,6DAA6D;gBAC7D,6DAA6D;gBAC7D,wEAAwE;gBACx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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"]}