@opentelemetry/api 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build/esm/api/context.js +25 -5
- package/build/esm/api/context.js.map +1 -1
- package/build/esm/api/diag.d.ts +3 -11
- package/build/esm/api/diag.js +38 -7
- package/build/esm/api/diag.js.map +1 -1
- package/build/esm/api/metrics.d.ts +28 -0
- package/build/esm/api/metrics.js +60 -0
- package/build/esm/api/metrics.js.map +1 -0
- package/build/esm/api/trace.d.ts +2 -1
- package/build/esm/api/trace.js +2 -1
- package/build/esm/api/trace.js.map +1 -1
- package/build/esm/baggage/internal/baggage-impl.js +41 -4
- package/build/esm/baggage/internal/baggage-impl.js.map +1 -1
- package/build/esm/context/NoopContextManager.js +25 -5
- package/build/esm/context/NoopContextManager.js.map +1 -1
- package/build/esm/context-api.d.ts +4 -0
- package/build/esm/context-api.js +21 -0
- package/build/esm/context-api.js.map +1 -0
- package/build/esm/diag/ComponentLogger.js +26 -1
- package/build/esm/diag/ComponentLogger.js.map +1 -1
- package/build/esm/diag/types.d.ts +30 -0
- package/build/esm/diag/types.js.map +1 -1
- package/build/esm/diag-api.d.ts +9 -0
- package/build/esm/diag-api.js +26 -0
- package/build/esm/diag-api.js.map +1 -0
- package/build/esm/index.d.ts +44 -48
- package/build/esm/index.js +29 -43
- package/build/esm/index.js.map +1 -1
- package/build/esm/internal/global-utils.d.ts +3 -1
- package/build/esm/internal/global-utils.js.map +1 -1
- package/build/esm/metrics/Meter.d.ts +104 -0
- package/build/esm/{diag/index.js → metrics/Meter.js} +2 -3
- package/build/esm/metrics/Meter.js.map +1 -0
- package/build/esm/metrics/MeterProvider.d.ts +17 -0
- package/build/esm/metrics/MeterProvider.js +17 -0
- package/build/esm/metrics/MeterProvider.js.map +1 -0
- package/build/esm/metrics/Metric.d.ts +97 -0
- package/build/esm/metrics/Metric.js +22 -0
- package/build/esm/metrics/Metric.js.map +1 -0
- package/build/esm/metrics/NoopMeter.d.ts +74 -0
- package/build/esm/metrics/NoopMeter.js +165 -0
- package/build/esm/metrics/NoopMeter.js.map +1 -0
- package/build/esm/metrics/NoopMeterProvider.d.ts +11 -0
- package/build/esm/metrics/NoopMeterProvider.js +31 -0
- package/build/esm/metrics/NoopMeterProvider.js.map +1 -0
- package/build/esm/metrics/ObservableResult.d.ts +31 -0
- package/build/esm/metrics/ObservableResult.js +17 -0
- package/build/esm/metrics/ObservableResult.js.map +1 -0
- package/build/esm/metrics-api.d.ts +4 -0
- package/build/esm/metrics-api.js +21 -0
- package/build/esm/metrics-api.js.map +1 -0
- package/build/esm/platform/browser/globalThis.js +1 -2
- package/build/esm/platform/browser/globalThis.js.map +1 -1
- package/build/esm/propagation-api.d.ts +4 -0
- package/build/esm/propagation-api.js +21 -0
- package/build/esm/propagation-api.js.map +1 -0
- package/build/esm/trace/NoopTracer.js +3 -3
- package/build/esm/trace/NoopTracer.js.map +1 -1
- package/build/esm/trace/Sampler.d.ts +1 -0
- package/build/esm/trace/Sampler.js.map +1 -1
- package/build/esm/trace/SamplingResult.d.ts +2 -0
- package/build/esm/trace/SamplingResult.js +1 -0
- package/build/esm/trace/SamplingResult.js.map +1 -1
- package/build/esm/trace/context-utils.d.ts +4 -0
- package/build/esm/trace/context-utils.js +7 -0
- package/build/esm/trace/context-utils.js.map +1 -1
- package/build/esm/trace-api.d.ts +4 -0
- package/build/esm/trace-api.js +21 -0
- package/build/esm/trace-api.js.map +1 -0
- 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/src/api/context.js +26 -38
- package/build/src/api/context.js.map +1 -1
- package/build/src/api/diag.d.ts +3 -11
- package/build/src/api/diag.js +33 -33
- package/build/src/api/diag.js.map +1 -1
- package/build/src/api/metrics.d.ts +28 -0
- package/build/src/api/metrics.js +61 -0
- package/build/src/api/metrics.js.map +1 -0
- package/build/src/api/propagation.js +28 -31
- package/build/src/api/propagation.js.map +1 -1
- package/build/src/api/trace.d.ts +2 -1
- package/build/src/api/trace.js +23 -23
- package/build/src/api/trace.js.map +1 -1
- package/build/src/baggage/context-helpers.js +2 -2
- package/build/src/baggage/context-helpers.js.map +1 -1
- package/build/src/baggage/internal/baggage-impl.js +21 -30
- package/build/src/baggage/internal/baggage-impl.js.map +1 -1
- package/build/src/baggage/utils.js +7 -8
- package/build/src/baggage/utils.js.map +1 -1
- package/build/src/context/NoopContextManager.js +14 -26
- package/build/src/context/NoopContextManager.js.map +1 -1
- package/build/src/context/context.js +9 -10
- package/build/src/context/context.js.map +1 -1
- package/build/src/context-api.d.ts +4 -0
- package/build/src/{diag/index.js → context-api.js} +7 -13
- package/build/src/context-api.js.map +1 -0
- package/build/src/diag/ComponentLogger.js +16 -37
- package/build/src/diag/ComponentLogger.js.map +1 -1
- package/build/src/diag/consoleLogger.js +7 -12
- package/build/src/diag/consoleLogger.js.map +1 -1
- package/build/src/diag/internal/logLevelLogger.js +2 -2
- package/build/src/diag/internal/logLevelLogger.js.map +1 -1
- package/build/src/diag/types.d.ts +30 -0
- package/build/src/diag/types.js.map +1 -1
- package/build/src/diag-api.d.ts +9 -0
- package/build/src/diag-api.js +29 -0
- package/build/src/diag-api.js.map +1 -0
- package/build/src/index.d.ts +44 -48
- package/build/src/index.js +49 -56
- package/build/src/index.js.map +1 -1
- package/build/src/internal/global-utils.d.ts +3 -1
- package/build/src/internal/global-utils.js +15 -16
- package/build/src/internal/global-utils.js.map +1 -1
- package/build/src/internal/semver.js +9 -9
- package/build/src/internal/semver.js.map +1 -1
- package/build/src/metrics/Meter.d.ts +104 -0
- package/build/src/metrics/Meter.js +18 -0
- package/build/src/metrics/Meter.js.map +1 -0
- package/build/src/metrics/MeterProvider.d.ts +17 -0
- package/build/src/metrics/MeterProvider.js +18 -0
- package/build/src/metrics/MeterProvider.js.map +1 -0
- package/build/src/metrics/Metric.d.ts +97 -0
- package/build/src/metrics/Metric.js +25 -0
- package/build/src/metrics/Metric.js.map +1 -0
- package/build/src/metrics/NoopMeter.d.ts +74 -0
- package/build/src/metrics/NoopMeter.js +116 -0
- package/build/src/metrics/NoopMeter.js.map +1 -0
- package/build/src/metrics/NoopMeterProvider.d.ts +11 -0
- package/build/src/metrics/NoopMeterProvider.js +31 -0
- package/build/src/metrics/NoopMeterProvider.js.map +1 -0
- package/build/src/metrics/ObservableResult.d.ts +31 -0
- package/build/src/metrics/ObservableResult.js +18 -0
- package/build/src/metrics/ObservableResult.js.map +1 -0
- package/build/src/metrics-api.d.ts +4 -0
- package/build/src/metrics-api.js +24 -0
- package/build/src/metrics-api.js.map +1 -0
- package/build/src/platform/browser/globalThis.js +1 -2
- package/build/src/platform/browser/globalThis.js.map +1 -1
- package/build/src/propagation/NoopTextMapPropagator.js +7 -10
- package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/src/propagation/TextMapPropagator.js +3 -3
- package/build/src/propagation/TextMapPropagator.js.map +1 -1
- package/build/src/propagation-api.d.ts +4 -0
- package/build/src/propagation-api.js +24 -0
- package/build/src/propagation-api.js.map +1 -0
- package/build/src/trace/NonRecordingSpan.js +20 -22
- package/build/src/trace/NonRecordingSpan.js.map +1 -1
- package/build/src/trace/NoopTracer.js +21 -24
- package/build/src/trace/NoopTracer.js.map +1 -1
- package/build/src/trace/NoopTracerProvider.js +5 -8
- package/build/src/trace/NoopTracerProvider.js.map +1 -1
- package/build/src/trace/ProxyTracer.js +13 -14
- package/build/src/trace/ProxyTracer.js.map +1 -1
- package/build/src/trace/ProxyTracerProvider.js +13 -16
- package/build/src/trace/ProxyTracerProvider.js.map +1 -1
- package/build/src/trace/Sampler.d.ts +1 -0
- package/build/src/trace/Sampler.js.map +1 -1
- package/build/src/trace/SamplingResult.d.ts +2 -0
- package/build/src/trace/SamplingResult.js +1 -0
- package/build/src/trace/SamplingResult.js.map +1 -1
- package/build/src/trace/context-utils.d.ts +4 -0
- package/build/src/trace/context-utils.js +12 -4
- package/build/src/trace/context-utils.js.map +1 -1
- package/build/src/trace/internal/tracestate-impl.js +33 -35
- package/build/src/trace/internal/tracestate-impl.js.map +1 -1
- package/build/src/trace/internal/tracestate-validators.js +6 -6
- package/build/src/trace/internal/tracestate-validators.js.map +1 -1
- package/build/src/trace/internal/utils.js +1 -1
- package/build/src/trace/internal/utils.js.map +1 -1
- package/build/src/trace/invalid-span-constants.js +1 -1
- package/build/src/trace/invalid-span-constants.js.map +1 -1
- package/build/src/trace/spancontext-utils.js +4 -4
- package/build/src/trace/spancontext-utils.js.map +1 -1
- package/build/src/trace-api.d.ts +4 -0
- package/build/src/trace-api.js +24 -0
- package/build/src/{diag/index.js.map → trace-api.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 +34 -34
- package/CHANGELOG.md +0 -204
- package/build/esm/diag/index.d.ts +0 -3
- package/build/esm/diag/index.js.map +0 -1
- package/build/src/diag/index.d.ts +0 -3
|
@@ -0,0 +1,116 @@
|
|
|
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.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0;
|
|
19
|
+
/**
|
|
20
|
+
* NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
|
|
21
|
+
* constant NoopMetrics for all of its methods.
|
|
22
|
+
*/
|
|
23
|
+
class NoopMeter {
|
|
24
|
+
constructor() { }
|
|
25
|
+
/**
|
|
26
|
+
* @see {@link Meter.createHistogram}
|
|
27
|
+
*/
|
|
28
|
+
createHistogram(_name, _options) {
|
|
29
|
+
return exports.NOOP_HISTOGRAM_METRIC;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @see {@link Meter.createCounter}
|
|
33
|
+
*/
|
|
34
|
+
createCounter(_name, _options) {
|
|
35
|
+
return exports.NOOP_COUNTER_METRIC;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @see {@link Meter.createUpDownCounter}
|
|
39
|
+
*/
|
|
40
|
+
createUpDownCounter(_name, _options) {
|
|
41
|
+
return exports.NOOP_UP_DOWN_COUNTER_METRIC;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @see {@link Meter.createObservableGauge}
|
|
45
|
+
*/
|
|
46
|
+
createObservableGauge(_name, _options) {
|
|
47
|
+
return exports.NOOP_OBSERVABLE_GAUGE_METRIC;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @see {@link Meter.createObservableCounter}
|
|
51
|
+
*/
|
|
52
|
+
createObservableCounter(_name, _options) {
|
|
53
|
+
return exports.NOOP_OBSERVABLE_COUNTER_METRIC;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @see {@link Meter.createObservableUpDownCounter}
|
|
57
|
+
*/
|
|
58
|
+
createObservableUpDownCounter(_name, _options) {
|
|
59
|
+
return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @see {@link Meter.addBatchObservableCallback}
|
|
63
|
+
*/
|
|
64
|
+
addBatchObservableCallback(_callback, _observables) { }
|
|
65
|
+
/**
|
|
66
|
+
* @see {@link Meter.removeBatchObservableCallback}
|
|
67
|
+
*/
|
|
68
|
+
removeBatchObservableCallback(_callback) { }
|
|
69
|
+
}
|
|
70
|
+
exports.NoopMeter = NoopMeter;
|
|
71
|
+
class NoopMetric {
|
|
72
|
+
}
|
|
73
|
+
exports.NoopMetric = NoopMetric;
|
|
74
|
+
class NoopCounterMetric extends NoopMetric {
|
|
75
|
+
add(_value, _attributes) { }
|
|
76
|
+
}
|
|
77
|
+
exports.NoopCounterMetric = NoopCounterMetric;
|
|
78
|
+
class NoopUpDownCounterMetric extends NoopMetric {
|
|
79
|
+
add(_value, _attributes) { }
|
|
80
|
+
}
|
|
81
|
+
exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
|
|
82
|
+
class NoopHistogramMetric extends NoopMetric {
|
|
83
|
+
record(_value, _attributes) { }
|
|
84
|
+
}
|
|
85
|
+
exports.NoopHistogramMetric = NoopHistogramMetric;
|
|
86
|
+
class NoopObservableMetric {
|
|
87
|
+
addCallback(_callback) { }
|
|
88
|
+
removeCallback(_callback) { }
|
|
89
|
+
}
|
|
90
|
+
exports.NoopObservableMetric = NoopObservableMetric;
|
|
91
|
+
class NoopObservableCounterMetric extends NoopObservableMetric {
|
|
92
|
+
}
|
|
93
|
+
exports.NoopObservableCounterMetric = NoopObservableCounterMetric;
|
|
94
|
+
class NoopObservableGaugeMetric extends NoopObservableMetric {
|
|
95
|
+
}
|
|
96
|
+
exports.NoopObservableGaugeMetric = NoopObservableGaugeMetric;
|
|
97
|
+
class NoopObservableUpDownCounterMetric extends NoopObservableMetric {
|
|
98
|
+
}
|
|
99
|
+
exports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric;
|
|
100
|
+
exports.NOOP_METER = new NoopMeter();
|
|
101
|
+
// Synchronous instruments
|
|
102
|
+
exports.NOOP_COUNTER_METRIC = new NoopCounterMetric();
|
|
103
|
+
exports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
|
|
104
|
+
exports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
|
|
105
|
+
// Asynchronous instruments
|
|
106
|
+
exports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
|
|
107
|
+
exports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
|
|
108
|
+
exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
|
|
109
|
+
/**
|
|
110
|
+
* Create a no-op Meter
|
|
111
|
+
*/
|
|
112
|
+
function createNoopMeter() {
|
|
113
|
+
return exports.NOOP_METER;
|
|
114
|
+
}
|
|
115
|
+
exports.createNoopMeter = createNoopMeter;
|
|
116
|
+
//# sourceMappingURL=NoopMeter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoopMeter.js","sourceRoot":"","sources":["../../../src/metrics/NoopMeter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAiBH;;;GAGG;AACH,MAAa,SAAS;IACpB,gBAAe,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,KAAa,EAAE,QAAwB;QACrD,OAAO,6BAAqB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAa,EAAE,QAAwB;QACnD,OAAO,2BAAmB,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,KAAa,EAAE,QAAwB;QACzD,OAAO,mCAA2B,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,qBAAqB,CACnB,KAAa,EACb,QAAwB;QAExB,OAAO,oCAA4B,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,uBAAuB,CACrB,KAAa,EACb,QAAwB;QAExB,OAAO,sCAA8B,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,6BAA6B,CAC3B,KAAa,EACb,QAAwB;QAExB,OAAO,8CAAsC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,0BAA0B,CAAC,SAAkC,EAAE,YAA0B,IAAS,CAAC;IAEnG;;OAEG;IACH,6BAA6B,CAAC,SAAkC,IAAS,CAAC;CAC3E;AA/DD,8BA+DC;AAED,MAAa,UAAU;CAAG;AAA1B,gCAA0B;AAE1B,MAAa,iBAAkB,SAAQ,UAAU;IAC/C,GAAG,CAAC,MAAc,EAAE,WAA6B,IAAS,CAAC;CAC5D;AAFD,8CAEC;AAED,MAAa,uBAAwB,SAAQ,UAAU;IACrD,GAAG,CAAC,MAAc,EAAE,WAA6B,IAAS,CAAC;CAC5D;AAFD,0DAEC;AAED,MAAa,mBAAoB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAc,EAAE,WAA6B,IAAS,CAAC;CAC/D;AAFD,kDAEC;AAED,MAAa,oBAAoB;IAC/B,WAAW,CAAC,SAA6B,IAAG,CAAC;IAE7C,cAAc,CAAC,SAA6B,IAAG,CAAC;CACjD;AAJD,oDAIC;AAED,MAAa,2BAA4B,SAAQ,oBAAoB;CAAgC;AAArG,kEAAqG;AAErG,MAAa,yBAA0B,SAAQ,oBAAoB;CAA8B;AAAjG,8DAAiG;AAEjG,MAAa,iCAAkC,SAAQ,oBAAoB;CAAsC;AAAjH,8EAAiH;AAEpG,QAAA,UAAU,GAAG,IAAI,SAAS,EAAE,CAAC;AAE1C,0BAA0B;AACb,QAAA,mBAAmB,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAC9C,QAAA,qBAAqB,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAClD,QAAA,2BAA2B,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAEzE,2BAA2B;AACd,QAAA,8BAA8B,GAAG,IAAI,2BAA2B,EAAE,CAAC;AACnE,QAAA,4BAA4B,GAAG,IAAI,yBAAyB,EAAE,CAAC;AAC/D,QAAA,sCAAsC,GAAG,IAAI,iCAAiC,EAAE,CAAC;AAE9F;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO,kBAAU,CAAC;AACpB,CAAC;AAFD,0CAEC","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 { Meter } from './Meter';\nimport {\n BatchObservableCallback,\n Counter,\n Histogram,\n MetricOptions,\n ObservableCallback,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n MetricAttributes,\n Observable,\n} from './Metric';\n\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nexport class NoopMeter implements Meter {\n constructor() {}\n\n /**\n * @see {@link Meter.createHistogram}\n */\n createHistogram(_name: string, _options?: MetricOptions): Histogram {\n return NOOP_HISTOGRAM_METRIC;\n }\n\n /**\n * @see {@link Meter.createCounter}\n */\n createCounter(_name: string, _options?: MetricOptions): Counter {\n return NOOP_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n createUpDownCounter(_name: string, _options?: MetricOptions): UpDownCounter {\n return NOOP_UP_DOWN_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.createObservableGauge}\n */\n createObservableGauge(\n _name: string,\n _options?: MetricOptions,\n ): ObservableGauge {\n return NOOP_OBSERVABLE_GAUGE_METRIC;\n }\n\n /**\n * @see {@link Meter.createObservableCounter}\n */\n createObservableCounter(\n _name: string,\n _options?: MetricOptions,\n ): ObservableCounter {\n return NOOP_OBSERVABLE_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n createObservableUpDownCounter(\n _name: string,\n _options?: MetricOptions,\n ): ObservableUpDownCounter {\n return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n addBatchObservableCallback(_callback: BatchObservableCallback, _observables: Observable[]): void {}\n\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n removeBatchObservableCallback(_callback: BatchObservableCallback): void {}\n}\n\nexport class NoopMetric {}\n\nexport class NoopCounterMetric extends NoopMetric implements Counter {\n add(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopUpDownCounterMetric extends NoopMetric implements UpDownCounter {\n add(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopHistogramMetric extends NoopMetric implements Histogram {\n record(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopObservableMetric {\n addCallback(_callback: ObservableCallback) {}\n\n removeCallback(_callback: ObservableCallback) {}\n}\n\nexport class NoopObservableCounterMetric extends NoopObservableMetric implements ObservableCounter {}\n\nexport class NoopObservableGaugeMetric extends NoopObservableMetric implements ObservableGauge {}\n\nexport class NoopObservableUpDownCounterMetric extends NoopObservableMetric implements ObservableUpDownCounter {}\n\nexport const NOOP_METER = new NoopMeter();\n\n// Synchronous instruments\nexport const NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexport const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexport const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n\n// Asynchronous instruments\nexport const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexport const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexport const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();\n\n/**\n * Create a no-op Meter\n */\nexport function createNoopMeter(): Meter {\n return NOOP_METER;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meter, MeterOptions } from './Meter';
|
|
2
|
+
import { MeterProvider } from './MeterProvider';
|
|
3
|
+
/**
|
|
4
|
+
* An implementation of the {@link MeterProvider} which returns an impotent Meter
|
|
5
|
+
* for all calls to `getMeter`
|
|
6
|
+
*/
|
|
7
|
+
export declare class NoopMeterProvider implements MeterProvider {
|
|
8
|
+
getMeter(_name: string, _version?: string, _options?: MeterOptions): Meter;
|
|
9
|
+
}
|
|
10
|
+
export declare const NOOP_METER_PROVIDER: NoopMeterProvider;
|
|
11
|
+
//# sourceMappingURL=NoopMeterProvider.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
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.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0;
|
|
19
|
+
const NoopMeter_1 = require("./NoopMeter");
|
|
20
|
+
/**
|
|
21
|
+
* An implementation of the {@link MeterProvider} which returns an impotent Meter
|
|
22
|
+
* for all calls to `getMeter`
|
|
23
|
+
*/
|
|
24
|
+
class NoopMeterProvider {
|
|
25
|
+
getMeter(_name, _version, _options) {
|
|
26
|
+
return NoopMeter_1.NOOP_METER;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.NoopMeterProvider = NoopMeterProvider;
|
|
30
|
+
exports.NOOP_METER_PROVIDER = new NoopMeterProvider();
|
|
31
|
+
//# sourceMappingURL=NoopMeterProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoopMeterProvider.js","sourceRoot":"","sources":["../../../src/metrics/NoopMeterProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,2CAAyC;AAEzC;;;GAGG;AACH,MAAa,iBAAiB;IAC5B,QAAQ,CAAC,KAAa,EAAE,QAAiB,EAAE,QAAuB;QAChE,OAAO,sBAAU,CAAC;IACpB,CAAC;CACF;AAJD,8CAIC;AAEY,QAAA,mBAAmB,GAAG,IAAI,iBAAiB,EAAE,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\nimport { Meter, MeterOptions } from './Meter';\nimport { MeterProvider } from './MeterProvider';\nimport { NOOP_METER } from './NoopMeter';\n\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nexport class NoopMeterProvider implements MeterProvider {\n getMeter(_name: string, _version?: string, _options?: MeterOptions): Meter {\n return NOOP_METER;\n }\n}\n\nexport const NOOP_METER_PROVIDER = new NoopMeterProvider();\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MetricAttributes, Observable } from './Metric';
|
|
2
|
+
/**
|
|
3
|
+
* Interface that is being used in callback function for Observable Metric.
|
|
4
|
+
*/
|
|
5
|
+
export interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
|
6
|
+
/**
|
|
7
|
+
* Observe a measurement of the value associated with the given attributes.
|
|
8
|
+
*
|
|
9
|
+
* @param value The value to be observed.
|
|
10
|
+
* @param attributes The attributes associated with the value. If more than
|
|
11
|
+
* one values associated with the same attributes values, SDK may pick the
|
|
12
|
+
* last one or simply drop the entire observable result.
|
|
13
|
+
*/
|
|
14
|
+
observe(value: number, attributes?: AttributesTypes): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Interface that is being used in batch observable callback function.
|
|
18
|
+
*/
|
|
19
|
+
export interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
|
|
20
|
+
/**
|
|
21
|
+
* Observe a measurement of the value associated with the given attributes.
|
|
22
|
+
*
|
|
23
|
+
* @param metric The observable metric to be observed.
|
|
24
|
+
* @param value The value to be observed.
|
|
25
|
+
* @param attributes The attributes associated with the value. If more than
|
|
26
|
+
* one values associated with the same attributes values, SDK may pick the
|
|
27
|
+
* last one or simply drop the entire observable result.
|
|
28
|
+
*/
|
|
29
|
+
observe(metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=ObservableResult.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
//# sourceMappingURL=ObservableResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservableResult.js","sourceRoot":"","sources":["../../../src/metrics/ObservableResult.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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 { MetricAttributes, Observable } from './Metric';\n\n/**\n * Interface that is being used in callback function for Observable Metric.\n */\nexport interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {\n /**\n * Observe a measurement of the value associated with the given attributes.\n *\n * @param value The value to be observed.\n * @param attributes The attributes associated with the value. If more than\n * one values associated with the same attributes values, SDK may pick the\n * last one or simply drop the entire observable result.\n */\n observe(value: number, attributes?: AttributesTypes): void;\n}\n\n/**\n * Interface that is being used in batch observable callback function.\n */\nexport interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {\n /**\n * Observe a measurement of the value associated with the given attributes.\n *\n * @param metric The observable metric to be observed.\n * @param value The value to be observed.\n * @param attributes The attributes associated with the value. If more than\n * one values associated with the same attributes values, SDK may pick the\n * last one or simply drop the entire observable result.\n */\n observe(metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;\n}\n"]}
|
|
@@ -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.metrics = void 0;
|
|
19
|
+
// Split module-level variable definition into separate files to allow
|
|
20
|
+
// tree-shaking on each api instance.
|
|
21
|
+
const metrics_1 = require("./api/metrics");
|
|
22
|
+
/** Entrypoint for metrics API */
|
|
23
|
+
exports.metrics = metrics_1.MetricsAPI.getInstance();
|
|
24
|
+
//# sourceMappingURL=metrics-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics-api.js","sourceRoot":"","sources":["../../src/metrics-api.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,2CAA2C;AAC3C,iCAAiC;AACpB,QAAA,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,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// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { MetricsAPI } from './api/metrics';\n/** Entrypoint for metrics API */\nexport const metrics = MetricsAPI.getInstance();\n"]}
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports._globalThis = void 0;
|
|
19
|
-
// Updates to this file should also be replicated to @opentelemetry/
|
|
20
|
-
// @opentelemetry/core too.
|
|
19
|
+
// Updates to this file should also be replicated to @opentelemetry/core too.
|
|
21
20
|
/**
|
|
22
21
|
* - globalThis (New standard)
|
|
23
22
|
* - self (Will return the current window instance for supported browsers)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/browser/globalThis.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/browser/globalThis.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6EAA6E;AAE7E;;;;;;GAMG;AAEH,gEAAgE;AAChE,8EAA8E;AACjE,QAAA,WAAW,GACtB,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC3C,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/B,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACnC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC3C,EAAuB,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// Updates to this file should also be replicated to @opentelemetry/core too.\n\n/**\n * - globalThis (New standard)\n * - self (Will return the current window instance for supported browsers)\n * - window (fallback for older browser implementations)\n * - global (NodeJS implementation)\n * - <object> (When all else fails)\n */\n\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef\nexport const _globalThis: typeof globalThis =\n typeof globalThis === 'object' ? globalThis :\n typeof self === 'object' ? self :\n typeof window === 'object' ? window :\n typeof global === 'object' ? global :\n {} as typeof globalThis;\n"]}
|
|
@@ -19,19 +19,16 @@ exports.NoopTextMapPropagator = void 0;
|
|
|
19
19
|
/**
|
|
20
20
|
* No-op implementations of {@link TextMapPropagator}.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
function NoopTextMapPropagator() {
|
|
24
|
-
}
|
|
22
|
+
class NoopTextMapPropagator {
|
|
25
23
|
/** Noop inject function does nothing */
|
|
26
|
-
|
|
24
|
+
inject(_context, _carrier) { }
|
|
27
25
|
/** Noop extract function does nothing and returns the input context */
|
|
28
|
-
|
|
26
|
+
extract(context, _carrier) {
|
|
29
27
|
return context;
|
|
30
|
-
}
|
|
31
|
-
|
|
28
|
+
}
|
|
29
|
+
fields() {
|
|
32
30
|
return [];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
}());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
36
33
|
exports.NoopTextMapPropagator = NoopTextMapPropagator;
|
|
37
34
|
//# sourceMappingURL=NoopTextMapPropagator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopTextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/NoopTextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"NoopTextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/NoopTextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH;;GAEG;AACH,MAAa,qBAAqB;IAChC,wCAAwC;IACxC,MAAM,CAAC,QAAiB,EAAE,QAAiB,IAAS,CAAC;IACrD,uEAAuE;IACvE,OAAO,CAAC,OAAgB,EAAE,QAAiB;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM;QACJ,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAVD,sDAUC","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 { Context } from '../context/types';\nimport { TextMapPropagator } from './TextMapPropagator';\n\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nexport class NoopTextMapPropagator implements TextMapPropagator {\n /** Noop inject function does nothing */\n inject(_context: Context, _carrier: unknown): void {}\n /** Noop extract function does nothing and returns the input context */\n extract(context: Context, _carrier: unknown): Context {\n return context;\n }\n fields(): string[] {\n return [];\n }\n}\n"]}
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0;
|
|
19
19
|
exports.defaultTextMapGetter = {
|
|
20
|
-
get
|
|
20
|
+
get(carrier, key) {
|
|
21
21
|
if (carrier == null) {
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
24
24
|
return carrier[key];
|
|
25
25
|
},
|
|
26
|
-
keys
|
|
26
|
+
keys(carrier) {
|
|
27
27
|
if (carrier == null) {
|
|
28
28
|
return [];
|
|
29
29
|
}
|
|
@@ -31,7 +31,7 @@ exports.defaultTextMapGetter = {
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
exports.defaultTextMapSetter = {
|
|
34
|
-
set
|
|
34
|
+
set(carrier, key, value) {
|
|
35
35
|
if (carrier == null) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/TextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAkGU,QAAA,oBAAoB,GAAkB;IACjD,GAAG,
|
|
1
|
+
{"version":3,"file":"TextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/TextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAkGU,QAAA,oBAAoB,GAAkB;IACjD,GAAG,CAAC,OAAO,EAAE,GAAG;QACd,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,OAAO;QACV,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC;AAEW,QAAA,oBAAoB,GAAkB;IACjD,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK;QACrB,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACvB,CAAC;CACF,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\nimport { Context } from '../context/types';\n\n/**\n * Injects `Context` into and extracts it from carriers that travel\n * in-band across process boundaries. Encoding is expected to conform to the\n * HTTP Header Field semantics. Values are often encoded as RPC/HTTP request\n * headers.\n *\n * The carrier of propagated data on both the client (injector) and server\n * (extractor) side is usually an object such as http headers. Propagation is\n * usually implemented via library-specific request interceptors, where the\n * client-side injects values and the server-side extracts them.\n */\nexport interface TextMapPropagator<Carrier = any> {\n /**\n * Injects values from a given `Context` into a carrier.\n *\n * OpenTelemetry defines a common set of format values (TextMapPropagator),\n * and each has an expected `carrier` type.\n *\n * @param context the Context from which to extract values to transmit over\n * the wire.\n * @param carrier the carrier of propagation fields, such as http request\n * headers.\n * @param setter an optional {@link TextMapSetter}. If undefined, values will be\n * set by direct object assignment.\n */\n inject(\n context: Context,\n carrier: Carrier,\n setter: TextMapSetter<Carrier>\n ): void;\n\n /**\n * Given a `Context` and a carrier, extract context values from a\n * carrier and return a new context, created from the old context, with the\n * extracted values.\n *\n * @param context the Context from which to extract values to transmit over\n * the wire.\n * @param carrier the carrier of propagation fields, such as http request\n * headers.\n * @param getter an optional {@link TextMapGetter}. If undefined, keys will be all\n * own properties, and keys will be accessed by direct object access.\n */\n extract(\n context: Context,\n carrier: Carrier,\n getter: TextMapGetter<Carrier>\n ): Context;\n\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n fields(): string[];\n}\n\n/**\n * A setter is specified by the caller to define a specific method\n * to set key/value pairs on the carrier within a propagator.\n */\nexport interface TextMapSetter<Carrier = any> {\n /**\n * Callback used to set a key/value pair on an object.\n *\n * Should be called by the propagator each time a key/value pair\n * should be set, and should set that key/value pair on the propagator.\n *\n * @param carrier object or class which carries key/value pairs\n * @param key string key to modify\n * @param value value to be set to the key on the carrier\n */\n set(carrier: Carrier, key: string, value: string): void;\n}\n\n/**\n * A getter is specified by the caller to define a specific method\n * to get the value of a key from a carrier.\n */\nexport interface TextMapGetter<Carrier = any> {\n /**\n * Get a list of all keys available on the carrier.\n *\n * @param carrier\n */\n keys(carrier: Carrier): string[];\n\n /**\n * Get the value of a specific key from the carrier.\n *\n * @param carrier\n * @param key\n */\n get(carrier: Carrier, key: string): undefined | string | string[];\n}\n\nexport const defaultTextMapGetter: TextMapGetter = {\n get(carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n\n keys(carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\n\nexport const defaultTextMapSetter: TextMapSetter = {\n set(carrier, key, value) {\n if (carrier == null) {\n return;\n }\n\n carrier[key] = value;\n },\n};\n"]}
|
|
@@ -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.propagation = void 0;
|
|
19
|
+
// Split module-level variable definition into separate files to allow
|
|
20
|
+
// tree-shaking on each api instance.
|
|
21
|
+
const propagation_1 = require("./api/propagation");
|
|
22
|
+
/** Entrypoint for propagation API */
|
|
23
|
+
exports.propagation = propagation_1.PropagationAPI.getInstance();
|
|
24
|
+
//# sourceMappingURL=propagation-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propagation-api.js","sourceRoot":"","sources":["../../src/propagation-api.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,mDAAmD;AACnD,qCAAqC;AACxB,QAAA,WAAW,GAAG,4BAAc,CAAC,WAAW,EAAE,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// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/** Entrypoint for propagation API */\nexport const propagation = PropagationAPI.getInstance();\n"]}
|
|
@@ -16,50 +16,48 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.NonRecordingSpan = void 0;
|
|
19
|
-
|
|
19
|
+
const invalid_span_constants_1 = require("./invalid-span-constants");
|
|
20
20
|
/**
|
|
21
21
|
* The NonRecordingSpan is the default {@link Span} that is used when no Span
|
|
22
22
|
* implementation is available. All operations are no-op including context
|
|
23
23
|
* propagation.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (_spanContext === void 0) { _spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT; }
|
|
25
|
+
class NonRecordingSpan {
|
|
26
|
+
constructor(_spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) {
|
|
28
27
|
this._spanContext = _spanContext;
|
|
29
28
|
}
|
|
30
29
|
// Returns a SpanContext.
|
|
31
|
-
|
|
30
|
+
spanContext() {
|
|
32
31
|
return this._spanContext;
|
|
33
|
-
}
|
|
32
|
+
}
|
|
34
33
|
// By default does nothing
|
|
35
|
-
|
|
34
|
+
setAttribute(_key, _value) {
|
|
36
35
|
return this;
|
|
37
|
-
}
|
|
36
|
+
}
|
|
38
37
|
// By default does nothing
|
|
39
|
-
|
|
38
|
+
setAttributes(_attributes) {
|
|
40
39
|
return this;
|
|
41
|
-
}
|
|
40
|
+
}
|
|
42
41
|
// By default does nothing
|
|
43
|
-
|
|
42
|
+
addEvent(_name, _attributes) {
|
|
44
43
|
return this;
|
|
45
|
-
}
|
|
44
|
+
}
|
|
46
45
|
// By default does nothing
|
|
47
|
-
|
|
46
|
+
setStatus(_status) {
|
|
48
47
|
return this;
|
|
49
|
-
}
|
|
48
|
+
}
|
|
50
49
|
// By default does nothing
|
|
51
|
-
|
|
50
|
+
updateName(_name) {
|
|
52
51
|
return this;
|
|
53
|
-
}
|
|
52
|
+
}
|
|
54
53
|
// By default does nothing
|
|
55
|
-
|
|
54
|
+
end(_endTime) { }
|
|
56
55
|
// isRecording always returns false for NonRecordingSpan.
|
|
57
|
-
|
|
56
|
+
isRecording() {
|
|
58
57
|
return false;
|
|
59
|
-
}
|
|
58
|
+
}
|
|
60
59
|
// By default does nothing
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}());
|
|
60
|
+
recordException(_exception, _time) { }
|
|
61
|
+
}
|
|
64
62
|
exports.NonRecordingSpan = NonRecordingSpan;
|
|
65
63
|
//# sourceMappingURL=NonRecordingSpan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonRecordingSpan.js","sourceRoot":"","sources":["../../../src/trace/NonRecordingSpan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,
|
|
1
|
+
{"version":3,"file":"NonRecordingSpan.js","sourceRoot":"","sources":["../../../src/trace/NonRecordingSpan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,qEAAgE;AAKhE;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B,YACmB,eAA4B,6CAAoB;QAAhD,iBAAY,GAAZ,YAAY,CAAoC;IAChE,CAAC;IAEJ,yBAAyB;IACzB,WAAW;QACT,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,0BAA0B;IAC1B,YAAY,CAAC,IAAY,EAAE,MAAe;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,aAAa,CAAC,WAA2B;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,QAAQ,CAAC,KAAa,EAAE,WAA4B;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,SAAS,CAAC,OAAmB;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,UAAU,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,GAAG,CAAC,QAAoB,IAAS,CAAC;IAElC,yDAAyD;IACzD,WAAW;QACT,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,eAAe,CAAC,UAAqB,EAAE,KAAiB,IAAS,CAAC;CACnE;AA7CD,4CA6CC","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 { Exception } from '../common/Exception';\nimport { TimeInput } from '../common/Time';\nimport { SpanAttributes } from './attributes';\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\nimport { Span } from './span';\nimport { SpanContext } from './span_context';\nimport { SpanStatus } from './status';\n\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nexport class NonRecordingSpan implements Span {\n constructor(\n private readonly _spanContext: SpanContext = INVALID_SPAN_CONTEXT\n ) {}\n\n // Returns a SpanContext.\n spanContext(): SpanContext {\n return this._spanContext;\n }\n\n // By default does nothing\n setAttribute(_key: string, _value: unknown): this {\n return this;\n }\n\n // By default does nothing\n setAttributes(_attributes: SpanAttributes): this {\n return this;\n }\n\n // By default does nothing\n addEvent(_name: string, _attributes?: SpanAttributes): this {\n return this;\n }\n\n // By default does nothing\n setStatus(_status: SpanStatus): this {\n return this;\n }\n\n // By default does nothing\n updateName(_name: string): this {\n return this;\n }\n\n // By default does nothing\n end(_endTime?: TimeInput): void {}\n\n // isRecording always returns false for NonRecordingSpan.\n isRecording(): boolean {\n return false;\n }\n\n // By default does nothing\n recordException(_exception: Exception, _time?: TimeInput): void {}\n}\n"]}
|
|
@@ -16,36 +16,34 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.NoopTracer = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const context_1 = require("../api/context");
|
|
20
|
+
const context_utils_1 = require("../trace/context-utils");
|
|
21
|
+
const NonRecordingSpan_1 = require("./NonRecordingSpan");
|
|
22
|
+
const spancontext_utils_1 = require("./spancontext-utils");
|
|
23
|
+
const contextApi = context_1.ContextAPI.getInstance();
|
|
24
24
|
/**
|
|
25
25
|
* No-op implementations of {@link Tracer}.
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
function NoopTracer() {
|
|
29
|
-
}
|
|
27
|
+
class NoopTracer {
|
|
30
28
|
// startSpan starts a noop span.
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
startSpan(name, options, context) {
|
|
30
|
+
const root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
33
31
|
if (root) {
|
|
34
32
|
return new NonRecordingSpan_1.NonRecordingSpan();
|
|
35
33
|
}
|
|
36
|
-
|
|
34
|
+
const parentFromContext = context && (0, context_utils_1.getSpanContext)(context);
|
|
37
35
|
if (isSpanContext(parentFromContext) &&
|
|
38
|
-
spancontext_utils_1.isSpanContextValid(parentFromContext)) {
|
|
36
|
+
(0, spancontext_utils_1.isSpanContextValid)(parentFromContext)) {
|
|
39
37
|
return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext);
|
|
40
38
|
}
|
|
41
39
|
else {
|
|
42
40
|
return new NonRecordingSpan_1.NonRecordingSpan();
|
|
43
41
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
}
|
|
43
|
+
startActiveSpan(name, arg2, arg3, arg4) {
|
|
44
|
+
let opts;
|
|
45
|
+
let ctx;
|
|
46
|
+
let fn;
|
|
49
47
|
if (arguments.length < 2) {
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
@@ -61,13 +59,12 @@ var NoopTracer = /** @class */ (function () {
|
|
|
61
59
|
ctx = arg3;
|
|
62
60
|
fn = arg4;
|
|
63
61
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}());
|
|
62
|
+
const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
63
|
+
const span = this.startSpan(name, opts, parentContext);
|
|
64
|
+
const contextWithSpanSet = (0, context_utils_1.setSpan)(parentContext, span);
|
|
65
|
+
return contextApi.with(contextWithSpanSet, fn, undefined, span);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
71
68
|
exports.NoopTracer = NoopTracer;
|
|
72
69
|
function isSpanContext(spanContext) {
|
|
73
70
|
return (typeof spanContext === 'object' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopTracer.js","sourceRoot":"","sources":["../../../src/trace/NoopTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"NoopTracer.js","sourceRoot":"","sources":["../../../src/trace/NoopTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA4C;AAE5C,0DAAiE;AACjE,yDAAsD;AAEtD,2DAAyD;AAKzD,MAAM,UAAU,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAa,UAAU;IACrB,gCAAgC;IAChC,SAAS,CAAC,IAAY,EAAE,OAAqB,EAAE,OAAiB;QAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,CAAC;QACpC,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,mCAAgB,EAAE,CAAC;SAC/B;QAED,MAAM,iBAAiB,GAAG,OAAO,IAAI,IAAA,8BAAc,EAAC,OAAO,CAAC,CAAC;QAE7D,IACE,aAAa,CAAC,iBAAiB,CAAC;YAChC,IAAA,sCAAkB,EAAC,iBAAiB,CAAC,EACrC;YACA,OAAO,IAAI,mCAAgB,CAAC,iBAAiB,CAAC,CAAC;SAChD;aAAM;YACL,OAAO,IAAI,mCAAgB,EAAE,CAAC;SAC/B;IACH,CAAC;IAiBD,eAAe,CACb,IAAY,EACZ,IAAsB,EACtB,IAAkB,EAClB,IAAQ;QAER,IAAI,IAA6B,CAAC;QAClC,IAAI,GAAwB,CAAC;QAC7B,IAAI,EAAK,CAAC;QAEV,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,OAAO;SACR;aAAM,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,EAAE,GAAG,IAAS,CAAC;SAChB;aAAM,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,IAAI,GAAG,IAA+B,CAAC;YACvC,EAAE,GAAG,IAAS,CAAC;SAChB;aAAM;YACL,IAAI,GAAG,IAA+B,CAAC;YACvC,GAAG,GAAG,IAA2B,CAAC;YAClC,EAAE,GAAG,IAAS,CAAC;SAChB;QAED,MAAM,aAAa,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACvD,MAAM,kBAAkB,GAAG,IAAA,uBAAO,EAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAExD,OAAO,UAAU,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;CACF;AAhED,gCAgEC;AAED,SAAS,aAAa,CAAC,WAAgB;IACrC,OAAO,CACL,OAAO,WAAW,KAAK,QAAQ;QAC/B,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,QAAQ;QACzC,OAAO,WAAW,CAAC,SAAS,CAAC,KAAK,QAAQ;QAC1C,OAAO,WAAW,CAAC,YAAY,CAAC,KAAK,QAAQ,CAC9C,CAAC;AACJ,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\nimport { ContextAPI } from '../api/context';\nimport { Context } from '../context/types';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { Span } from './span';\nimport { isSpanContextValid } from './spancontext-utils';\nimport { SpanOptions } from './SpanOptions';\nimport { SpanContext } from './span_context';\nimport { Tracer } from './tracer';\n\nconst contextApi = ContextAPI.getInstance();\n\n/**\n * No-op implementations of {@link Tracer}.\n */\nexport class NoopTracer implements Tracer {\n // startSpan starts a noop span.\n startSpan(name: string, options?: SpanOptions, context?: Context): Span {\n const root = Boolean(options?.root);\n if (root) {\n return new NonRecordingSpan();\n }\n\n const parentFromContext = context && getSpanContext(context);\n\n if (\n isSpanContext(parentFromContext) &&\n isSpanContextValid(parentFromContext)\n ) {\n return new NonRecordingSpan(parentFromContext);\n } else {\n return new NonRecordingSpan();\n }\n }\n\n startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n opts: SpanOptions | undefined,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n opts: SpanOptions | undefined,\n ctx: Context | undefined,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n arg2?: F | SpanOptions,\n arg3?: F | Context,\n arg4?: F\n ): ReturnType<F> | undefined {\n let opts: SpanOptions | undefined;\n let ctx: Context | undefined;\n let fn: F;\n\n if (arguments.length < 2) {\n return;\n } else if (arguments.length === 2) {\n fn = arg2 as F;\n } else if (arguments.length === 3) {\n opts = arg2 as SpanOptions | undefined;\n fn = arg3 as F;\n } else {\n opts = arg2 as SpanOptions | undefined;\n ctx = arg3 as Context | undefined;\n fn = arg4 as F;\n }\n\n const parentContext = ctx ?? contextApi.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = setSpan(parentContext, span);\n\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n }\n}\n\nfunction isSpanContext(spanContext: any): spanContext is SpanContext {\n return (\n typeof spanContext === 'object' &&\n typeof spanContext['spanId'] === 'string' &&\n typeof spanContext['traceId'] === 'string' &&\n typeof spanContext['traceFlags'] === 'number'\n );\n}\n"]}
|