@opentelemetry/api 0.21.0 → 1.0.0-rc.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/CHANGELOG.md +0 -73
- package/README.md +5 -46
- package/build/src/api/context.d.ts +4 -6
- package/build/src/api/context.js +14 -12
- package/build/src/api/context.js.map +1 -1
- package/build/src/api/diag.d.ts +3 -7
- package/build/src/api/diag.js +3 -15
- package/build/src/api/diag.js.map +1 -1
- package/build/src/api/propagation.d.ts +2 -10
- package/build/src/api/propagation.js +5 -13
- package/build/src/api/propagation.js.map +1 -1
- package/build/src/api/trace.d.ts +3 -12
- package/build/src/api/trace.js +4 -12
- package/build/src/api/trace.js.map +1 -1
- package/build/{esm/baggage/types.d.ts → src/baggage/Baggage.d.ts} +2 -20
- package/build/{esm/baggage/types.js → src/baggage/Baggage.js} +3 -2
- package/build/src/baggage/Baggage.js.map +1 -0
- package/build/src/baggage/Entry.d.ts +20 -0
- package/build/src/baggage/{types.js → Entry.js} +1 -1
- package/build/src/baggage/Entry.js.map +1 -0
- package/build/src/baggage/{utils.d.ts → index.d.ts} +5 -2
- package/build/src/baggage/{utils.js → index.js} +16 -5
- package/build/src/baggage/index.js.map +1 -0
- package/build/{esm/baggage/internal/baggage-impl.d.ts → src/baggage/internal/baggage.d.ts} +3 -2
- package/build/src/baggage/internal/{baggage-impl.js → baggage.js} +1 -1
- package/build/src/baggage/internal/baggage.js.map +1 -0
- package/build/src/context/NoopContextManager.d.ts +1 -1
- package/build/src/context/NoopContextManager.js +8 -6
- package/build/src/context/NoopContextManager.js.map +1 -1
- package/build/src/context/context.d.ts +59 -0
- package/build/src/context/context.js +101 -7
- package/build/src/context/context.js.map +1 -1
- package/build/src/context/types.d.ts +2 -2
- package/build/src/diag/types.d.ts +0 -6
- package/build/src/index.d.ts +8 -2
- package/build/src/index.js +9 -4
- package/build/src/index.js.map +1 -1
- package/build/src/internal/global-utils.d.ts +1 -1
- package/build/src/internal/global-utils.js +5 -7
- package/build/src/internal/global-utils.js.map +1 -1
- package/build/src/propagation/NoopTextMapPropagator.d.ts +1 -0
- package/build/src/propagation/NoopTextMapPropagator.js +2 -1
- package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/src/trace/Event.d.ts +9 -0
- package/build/{esm/diag/index.js → src/trace/Event.js} +3 -3
- package/build/src/trace/Event.js.map +1 -0
- package/build/{esm/trace/NonRecordingSpan.d.ts → src/trace/NoopSpan.d.ts} +4 -4
- package/build/src/trace/{NonRecordingSpan.js → NoopSpan.js} +17 -17
- package/build/src/trace/NoopSpan.js.map +1 -0
- package/build/src/trace/NoopTracer.d.ts +1 -3
- package/build/src/trace/NoopTracer.js +8 -32
- package/build/src/trace/NoopTracer.js.map +1 -1
- package/build/src/trace/NoopTracerProvider.d.ts +1 -0
- package/build/src/trace/NoopTracerProvider.js +3 -2
- package/build/src/trace/NoopTracerProvider.js.map +1 -1
- package/build/src/trace/ProxyTracer.d.ts +0 -1
- package/build/src/trace/ProxyTracer.js +1 -5
- package/build/src/trace/ProxyTracer.js.map +1 -1
- package/build/src/trace/ProxyTracerProvider.js +1 -2
- package/build/src/trace/ProxyTracerProvider.js.map +1 -1
- package/build/src/trace/TimedEvent.d.ts +10 -0
- package/build/{esm/context/types.js → src/trace/TimedEvent.js} +3 -2
- package/build/src/trace/TimedEvent.js.map +1 -0
- package/build/src/trace/link.d.ts +3 -3
- package/build/src/trace/link_context.d.ts +6 -0
- package/build/src/trace/link_context.js +18 -0
- package/build/src/trace/link_context.js.map +1 -0
- package/build/src/trace/span.d.ts +1 -1
- package/build/src/trace/spancontext-utils.d.ts +0 -8
- package/build/src/trace/spancontext-utils.js +1 -27
- package/build/src/trace/spancontext-utils.js.map +1 -1
- package/build/src/trace/tracer.d.ts +0 -46
- 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 +15 -20
- package/build/esm/api/context.d.ts +0 -41
- package/build/esm/api/context.js +0 -89
- package/build/esm/api/context.js.map +0 -1
- package/build/esm/api/diag.d.ts +0 -38
- package/build/esm/api/diag.js +0 -89
- package/build/esm/api/diag.js.map +0 -1
- package/build/esm/api/propagation.d.ts +0 -48
- package/build/esm/api/propagation.js +0 -87
- package/build/esm/api/propagation.js.map +0 -1
- package/build/esm/api/trace.d.ts +0 -39
- package/build/esm/api/trace.js +0 -72
- package/build/esm/api/trace.js.map +0 -1
- package/build/esm/baggage/context-helpers.d.ts +0 -23
- package/build/esm/baggage/context-helpers.js +0 -47
- package/build/esm/baggage/context-helpers.js.map +0 -1
- package/build/esm/baggage/internal/baggage-impl.js +0 -61
- package/build/esm/baggage/internal/baggage-impl.js.map +0 -1
- package/build/esm/baggage/internal/symbol.d.ts +0 -5
- package/build/esm/baggage/internal/symbol.js +0 -20
- package/build/esm/baggage/internal/symbol.js.map +0 -1
- package/build/esm/baggage/types.js.map +0 -1
- package/build/esm/baggage/utils.d.ts +0 -15
- package/build/esm/baggage/utils.js +0 -46
- package/build/esm/baggage/utils.js.map +0 -1
- package/build/esm/common/Exception.d.ts +0 -26
- package/build/esm/common/Exception.js +0 -17
- package/build/esm/common/Exception.js.map +0 -1
- package/build/esm/common/Time.d.ts +0 -8
- package/build/esm/common/Time.js +0 -2
- package/build/esm/common/Time.js.map +0 -1
- package/build/esm/context/NoopContextManager.d.ts +0 -9
- package/build/esm/context/NoopContextManager.js +0 -47
- package/build/esm/context/NoopContextManager.js.map +0 -1
- package/build/esm/context/context.d.ts +0 -6
- package/build/esm/context/context.js +0 -52
- package/build/esm/context/context.js.map +0 -1
- package/build/esm/context/types.d.ts +0 -52
- package/build/esm/context/types.js.map +0 -1
- package/build/esm/diag/ComponentLogger.d.ts +0 -20
- package/build/esm/diag/ComponentLogger.js +0 -77
- package/build/esm/diag/ComponentLogger.js.map +0 -1
- package/build/esm/diag/consoleLogger.d.ts +0 -38
- package/build/esm/diag/consoleLogger.js +0 -54
- package/build/esm/diag/consoleLogger.js.map +0 -1
- package/build/esm/diag/index.d.ts +0 -3
- package/build/esm/diag/index.js.map +0 -1
- package/build/esm/diag/internal/logLevelLogger.d.ts +0 -3
- package/build/esm/diag/internal/logLevelLogger.js +0 -41
- package/build/esm/diag/internal/logLevelLogger.js.map +0 -1
- package/build/esm/diag/internal/noopLogger.d.ts +0 -8
- package/build/esm/diag/internal/noopLogger.js +0 -31
- package/build/esm/diag/internal/noopLogger.js.map +0 -1
- package/build/esm/diag/types.d.ts +0 -70
- package/build/esm/diag/types.js +0 -41
- package/build/esm/diag/types.js.map +0 -1
- package/build/esm/index.d.ts +0 -53
- package/build/esm/index.js +0 -63
- package/build/esm/index.js.map +0 -1
- package/build/esm/internal/global-utils.d.ts +0 -16
- package/build/esm/internal/global-utils.js +0 -60
- package/build/esm/internal/global-utils.js.map +0 -1
- package/build/esm/internal/semver.d.ts +0 -34
- package/build/esm/internal/semver.js +0 -106
- package/build/esm/internal/semver.js.map +0 -1
- package/build/esm/platform/browser/globalThis.d.ts +0 -3
- package/build/esm/platform/browser/globalThis.js +0 -19
- package/build/esm/platform/browser/globalThis.js.map +0 -1
- package/build/esm/platform/browser/index.d.ts +0 -2
- package/build/esm/platform/browser/index.js +0 -17
- package/build/esm/platform/browser/index.js.map +0 -1
- package/build/esm/platform/index.d.ts +0 -2
- package/build/esm/platform/index.js +0 -17
- package/build/esm/platform/index.js.map +0 -1
- package/build/esm/platform/node/globalThis.d.ts +0 -3
- package/build/esm/platform/node/globalThis.js +0 -19
- package/build/esm/platform/node/globalThis.js.map +0 -1
- package/build/esm/platform/node/index.d.ts +0 -2
- package/build/esm/platform/node/index.js +0 -17
- package/build/esm/platform/node/index.js.map +0 -1
- package/build/esm/propagation/NoopTextMapPropagator.d.ts +0 -13
- package/build/esm/propagation/NoopTextMapPropagator.js +0 -34
- package/build/esm/propagation/NoopTextMapPropagator.js.map +0 -1
- package/build/esm/propagation/TextMapPropagator.d.ts +0 -84
- package/build/esm/propagation/TextMapPropagator.js +0 -38
- package/build/esm/propagation/TextMapPropagator.js.map +0 -1
- package/build/esm/trace/NonRecordingSpan.js +0 -62
- package/build/esm/trace/NonRecordingSpan.js.map +0 -1
- package/build/esm/trace/NoopTracer.d.ts +0 -14
- package/build/esm/trace/NoopTracer.js +0 -74
- package/build/esm/trace/NoopTracer.js.map +0 -1
- package/build/esm/trace/NoopTracerProvider.d.ts +0 -12
- package/build/esm/trace/NoopTracerProvider.js +0 -32
- package/build/esm/trace/NoopTracerProvider.js.map +0 -1
- package/build/esm/trace/ProxyTracer.d.ts +0 -23
- package/build/esm/trace/ProxyTracer.js +0 -51
- package/build/esm/trace/ProxyTracer.js.map +0 -1
- package/build/esm/trace/ProxyTracerProvider.d.ts +0 -24
- package/build/esm/trace/ProxyTracerProvider.js +0 -54
- package/build/esm/trace/ProxyTracerProvider.js.map +0 -1
- package/build/esm/trace/Sampler.d.ts +0 -30
- package/build/esm/trace/Sampler.js +0 -17
- package/build/esm/trace/Sampler.js.map +0 -1
- package/build/esm/trace/SamplingResult.d.ts +0 -39
- package/build/esm/trace/SamplingResult.js +0 -38
- package/build/esm/trace/SamplingResult.js.map +0 -1
- package/build/esm/trace/SpanOptions.d.ts +0 -23
- package/build/esm/trace/SpanOptions.js +0 -17
- package/build/esm/trace/SpanOptions.js.map +0 -1
- package/build/esm/trace/attributes.d.ts +0 -10
- package/build/esm/trace/attributes.js +0 -17
- package/build/esm/trace/attributes.js.map +0 -1
- package/build/esm/trace/context-utils.d.ts +0 -37
- package/build/esm/trace/context-utils.js +0 -66
- package/build/esm/trace/context-utils.js.map +0 -1
- package/build/esm/trace/link.d.ts +0 -24
- package/build/esm/trace/link.js +0 -17
- package/build/esm/trace/link.js.map +0 -1
- package/build/esm/trace/span.d.ts +0 -101
- package/build/esm/trace/span.js +0 -17
- package/build/esm/trace/span.js.map +0 -1
- package/build/esm/trace/span_context.d.ts +0 -53
- package/build/esm/trace/span_context.js +0 -17
- package/build/esm/trace/span_context.js.map +0 -1
- package/build/esm/trace/span_kind.d.ts +0 -27
- package/build/esm/trace/span_kind.js +0 -43
- package/build/esm/trace/span_kind.js.map +0 -1
- package/build/esm/trace/spancontext-utils.d.ts +0 -20
- package/build/esm/trace/spancontext-utils.js +0 -49
- package/build/esm/trace/spancontext-utils.js.map +0 -1
- package/build/esm/trace/status.d.ts +0 -25
- package/build/esm/trace/status.js +0 -20
- package/build/esm/trace/status.js.map +0 -1
- package/build/esm/trace/trace_flags.d.ts +0 -7
- package/build/esm/trace/trace_flags.js +0 -23
- package/build/esm/trace/trace_flags.js.map +0 -1
- package/build/esm/trace/trace_state.d.ts +0 -38
- package/build/esm/trace/trace_state.js +0 -17
- package/build/esm/trace/trace_state.js.map +0 -1
- package/build/esm/trace/tracer.d.ts +0 -70
- package/build/esm/trace/tracer.js +0 -17
- package/build/esm/trace/tracer.js.map +0 -1
- package/build/esm/trace/tracer_provider.d.ts +0 -19
- package/build/esm/trace/tracer_provider.js +0 -17
- package/build/esm/trace/tracer_provider.js.map +0 -1
- package/build/esm/version.d.ts +0 -2
- package/build/esm/version.js +0 -18
- package/build/esm/version.js.map +0 -1
- package/build/src/baggage/context-helpers.d.ts +0 -23
- package/build/src/baggage/context-helpers.js +0 -53
- package/build/src/baggage/context-helpers.js.map +0 -1
- package/build/src/baggage/internal/baggage-impl.d.ts +0 -12
- package/build/src/baggage/internal/baggage-impl.js.map +0 -1
- package/build/src/baggage/types.d.ts +0 -60
- package/build/src/baggage/types.js.map +0 -1
- package/build/src/baggage/utils.js.map +0 -1
- package/build/src/diag/ComponentLogger.d.ts +0 -20
- package/build/src/diag/ComponentLogger.js +0 -80
- package/build/src/diag/ComponentLogger.js.map +0 -1
- package/build/src/trace/NonRecordingSpan.d.ts +0 -25
- package/build/src/trace/NonRecordingSpan.js.map +0 -1
- package/build/src/trace/context-utils.d.ts +0 -37
- package/build/src/trace/context-utils.js +0 -74
- package/build/src/trace/context-utils.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,79 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 0.21.0
|
|
6
|
-
|
|
7
|
-
### :boom: Breaking Change
|
|
8
|
-
|
|
9
|
-
* [#78](https://github.com/open-telemetry/opentelemetry-js-api/pull/78) feat: unify signatures of `with` and `bind` ([@Rauno56](https://github.com/Rauno56))
|
|
10
|
-
* [#46](https://github.com/open-telemetry/opentelemetry-js-api/pull/46) chore: do not export singletons ([@dyladan](https://github.com/dyladan))
|
|
11
|
-
|
|
12
|
-
### :rocket: Enhancement
|
|
13
|
-
|
|
14
|
-
* [#81](https://github.com/open-telemetry/opentelemetry-js-api/pull/81) chore: function overloads implementation of startActiveSpan in noop t… ([@naseemkullah](https://github.com/naseemkullah))
|
|
15
|
-
|
|
16
|
-
### :house: Internal
|
|
17
|
-
|
|
18
|
-
* [#84](https://github.com/open-telemetry/opentelemetry-js-api/pull/84) chore: remove unused backwards compatibility folder ([@Flarna](https://github.com/Flarna))
|
|
19
|
-
* [#85](https://github.com/open-telemetry/opentelemetry-js-api/pull/85) chore: add node:16 to the test matrix ([@Rauno56](https://github.com/Rauno56))
|
|
20
|
-
* [#63](https://github.com/open-telemetry/opentelemetry-js-api/pull/63) feat: debug log global registrations and logger overwrites ([@Rauno56](https://github.com/Rauno56))
|
|
21
|
-
* [#75](https://github.com/open-telemetry/opentelemetry-js-api/pull/75) Add CodeQL Security Scan ([@xukaren](https://github.com/xukaren))
|
|
22
|
-
* [#79](https://github.com/open-telemetry/opentelemetry-js-api/pull/79) chore: fix eslint config ([@Rauno56](https://github.com/Rauno56))
|
|
23
|
-
|
|
24
|
-
### Committers: 5
|
|
25
|
-
|
|
26
|
-
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
|
|
27
|
-
* Gerhard Stöbich ([@Flarna](https://github.com/Flarna))
|
|
28
|
-
* Karen Xu ([@xukaren](https://github.com/xukaren))
|
|
29
|
-
* Naseem ([@naseemkullah](https://github.com/naseemkullah))
|
|
30
|
-
* Rauno Viskus ([@Rauno56](https://github.com/Rauno56))
|
|
31
|
-
|
|
32
|
-
## 0.20.0
|
|
33
|
-
|
|
34
|
-
### :rocket: Enhancement
|
|
35
|
-
|
|
36
|
-
* [#69](https://github.com/open-telemetry/opentelemetry-js-api/pull/69) feat(context): add utils method to remove keys from context ([@vmarchaud](https://github.com/vmarchaud))
|
|
37
|
-
* [#71](https://github.com/open-telemetry/opentelemetry-js-api/pull/71) chore: export baggage ([@dyladan](https://github.com/dyladan))
|
|
38
|
-
|
|
39
|
-
### Committers: 2
|
|
40
|
-
|
|
41
|
-
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
|
|
42
|
-
* Valentin Marchaud ([@vmarchaud](https://github.com/vmarchaud))
|
|
43
|
-
|
|
44
|
-
## 0.19.0
|
|
45
|
-
|
|
46
|
-
### :boom: Breaking Change
|
|
47
|
-
|
|
48
|
-
* [#55](https://github.com/open-telemetry/opentelemetry-js-api/pull/55) chore: move baggage methods in propagation namespace ([@vmarchaud](https://github.com/vmarchaud))
|
|
49
|
-
* [#65](https://github.com/open-telemetry/opentelemetry-js-api/pull/65) chore: remove suppress instrumentation ([@dyladan](https://github.com/dyladan))
|
|
50
|
-
* [#60](https://github.com/open-telemetry/opentelemetry-js-api/pull/60) chore: removing timed event ([@obecny](https://github.com/obecny))
|
|
51
|
-
* [#58](https://github.com/open-telemetry/opentelemetry-js-api/pull/58) chore: use spancontext for link ([@dyladan](https://github.com/dyladan))
|
|
52
|
-
* [#47](https://github.com/open-telemetry/opentelemetry-js-api/pull/47) chore: move span method for context in trace API #40 ([@vmarchaud](https://github.com/vmarchaud))
|
|
53
|
-
* [#45](https://github.com/open-telemetry/opentelemetry-js-api/pull/45) chore: rename `span#context()` to `span#spanContext` ([@dyladan](https://github.com/dyladan))
|
|
54
|
-
* [#43](https://github.com/open-telemetry/opentelemetry-js-api/pull/43) chore: renaming noop span to non recording span ([@obecny](https://github.com/obecny))
|
|
55
|
-
* [#32](https://github.com/open-telemetry/opentelemetry-js-api/pull/32) feat!: return boolean success value from setGlobalXXX methods ([@dyladan](https://github.com/dyladan))
|
|
56
|
-
|
|
57
|
-
### :rocket: Enhancement
|
|
58
|
-
|
|
59
|
-
* [#62](https://github.com/open-telemetry/opentelemetry-js-api/pull/62) chore: adding component logger ([@obecny](https://github.com/obecny))
|
|
60
|
-
* [#54](https://github.com/open-telemetry/opentelemetry-js-api/pull/54) feat: add tracer.startActiveSpan() ([@naseemkullah](https://github.com/naseemkullah))
|
|
61
|
-
* [#58](https://github.com/open-telemetry/opentelemetry-js-api/pull/58) chore: use spancontext for link ([@dyladan](https://github.com/dyladan))
|
|
62
|
-
* [#51](https://github.com/open-telemetry/opentelemetry-js-api/pull/51) feat: add function to wrap SpanContext in NonRecordingSpan #49 ([@dyladan](https://github.com/dyladan))
|
|
63
|
-
|
|
64
|
-
### :memo: Documentation
|
|
65
|
-
|
|
66
|
-
* [#64](https://github.com/open-telemetry/opentelemetry-js-api/pull/64) chore: document the reason for symbol.for ([@dyladan](https://github.com/dyladan))
|
|
67
|
-
* [#44](https://github.com/open-telemetry/opentelemetry-js-api/pull/44) chore: updating readme headline and fixing links ([@obecny](https://github.com/obecny))
|
|
68
|
-
|
|
69
|
-
### Committers: 6
|
|
70
|
-
|
|
71
|
-
* Bartlomiej Obecny ([@obecny](https://github.com/obecny))
|
|
72
|
-
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
|
|
73
|
-
* Gerhard Stöbich ([@Flarna](https://github.com/Flarna))
|
|
74
|
-
* Naseem ([@naseemkullah](https://github.com/naseemkullah))
|
|
75
|
-
* Valentin Marchaud ([@vmarchaud](https://github.com/vmarchaud))
|
|
76
|
-
* t2t2 ([@t2t2](https://github.com/t2t2))
|
|
77
|
-
|
|
78
5
|
## 1.0.0-rc.0
|
|
79
6
|
|
|
80
7
|
### :memo: Documentation
|
package/README.md
CHANGED
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
---
|
|
3
|
-
<p align="center">
|
|
4
|
-
<strong>
|
|
5
|
-
<a href="https://open-telemetry.github.io/opentelemetry-js">API Documentation<a/>
|
|
6
|
-
•
|
|
7
|
-
<a href="https://github.com/open-telemetry/opentelemetry-js/discussions">Getting In Touch (GitHub Discussions)<a/>
|
|
8
|
-
</strong>
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://github.com/open-telemetry/opentelemetry-js-api/releases">
|
|
13
|
-
<img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/open-telemetry/opentelemetry-js-api?include_prereleases&style=for-the-badge">
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://codecov.io/gh/open-telemetry/opentelemetry-js-api/branch/main/">
|
|
16
|
-
<img alt="Codecov Status" src="https://img.shields.io/codecov/c/github/open-telemetry/opentelemetry-js-api?style=for-the-badge">
|
|
17
|
-
</a>
|
|
18
|
-
<a href="https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE">
|
|
19
|
-
<img alt="license" src="https://img.shields.io/badge/license-Apache_2.0-green.svg?style=for-the-badge">
|
|
20
|
-
</a>
|
|
21
|
-
<br/>
|
|
22
|
-
<a href="https://github.com/open-telemetry/opentelemetry-js-api/actions/workflows/docs.yaml">
|
|
23
|
-
<img alt="Build Status" src="https://github.com/open-telemetry/opentelemetry-js-api/actions/workflows/test.yaml/badge.svg?branch=main">
|
|
24
|
-
</a>
|
|
25
|
-
<a href="https://github.com/open-telemetry/opentelemetry-js-api/actions/workflows/test.yaml?query=branch%3Amain">
|
|
26
|
-
<img alt="Build Status" src="https://github.com/open-telemetry/opentelemetry-js-api/actions/workflows/docs.yaml/badge.svg">
|
|
27
|
-
</a>
|
|
28
|
-
</p>
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
1
|
# OpenTelemetry API for JavaScript
|
|
33
2
|
|
|
34
3
|
[![NPM Published Version][npm-img]][npm-url]
|
|
35
4
|
[![dependencies][dependencies-image]][dependencies-url]
|
|
36
5
|
[![devDependencies][devDependencies-image]][devDependencies-url]
|
|
6
|
+
[![Apache License][license-image]][license-image]
|
|
37
7
|
|
|
38
8
|
This package provides everything needed to interact with the OpenTelemetry API, including all TypeScript interfaces, enums, and no-op implementations. It is intended for use both on the server and in the browser.
|
|
39
9
|
|
|
@@ -80,7 +50,7 @@ const tracer = trace.getTracer(name, version);
|
|
|
80
50
|
// Trace your application by creating spans
|
|
81
51
|
async function operation() {
|
|
82
52
|
const span = tracer.startSpan("do operation");
|
|
83
|
-
|
|
53
|
+
|
|
84
54
|
// mock some work by sleeping 1 second
|
|
85
55
|
await new Promise((resolve, reject) => {
|
|
86
56
|
setTimeout(resolve, 1000);
|
|
@@ -103,18 +73,6 @@ main();
|
|
|
103
73
|
|
|
104
74
|
Because the npm installer and node module resolution algorithm could potentially allow two or more copies of any given package to exist within the same `node_modules` structure, the OpenTelemetry API takes advantage of a variable on the `global` object to store the global API. When an API method in the API package is called, it checks if this `global` API exists and proxies calls to it if and only if it is a compatible API version. This means if a package has a dependency on an OpenTelemetry API version which is not compatible with the API used by the end user, the package will receive a no-op implementation of the API.
|
|
105
75
|
|
|
106
|
-
## Upgrade Guidelines
|
|
107
|
-
|
|
108
|
-
### 1.0.0-rc.1 to x
|
|
109
|
-
|
|
110
|
-
### 1.0.0-rc.0 to 1.0.0-rc.1
|
|
111
|
-
|
|
112
|
-
- Removing `TimedEvent` which was not part of spec
|
|
113
|
-
- `HttpBaggage` renamed to `HttpBaggagePropagator`
|
|
114
|
-
- [#45](https://github.com/open-telemetry/opentelemetry-js-api/pull/45) `Span#context` renamed to `Span#spanContext`
|
|
115
|
-
- [#47](https://github.com/open-telemetry/opentelemetry-js-api/pull/47) `getSpan`/`setSpan`/`getSpanContext`/`setSpanContext` moved to `trace` namespace
|
|
116
|
-
- [#55](https://github.com/open-telemetry/opentelemetry-js-api/pull/55) `getBaggage`/`setBaggage`/`createBaggage` moved to `propagation` namespace
|
|
117
|
-
|
|
118
76
|
## Useful links
|
|
119
77
|
|
|
120
78
|
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
|
|
@@ -130,11 +88,12 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
|
|
|
130
88
|
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
|
|
131
89
|
[license-url]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE
|
|
132
90
|
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
|
|
133
|
-
[dependencies-image]: https://
|
|
91
|
+
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-api/status.svg
|
|
134
92
|
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api
|
|
135
|
-
[devDependencies-image]: https://
|
|
93
|
+
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-api/dev-status.svg
|
|
136
94
|
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api?type=dev
|
|
137
95
|
[npm-url]: https://www.npmjs.com/package/@opentelemetry/api
|
|
138
96
|
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg
|
|
97
|
+
|
|
139
98
|
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/tracing.md
|
|
140
99
|
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/sdk-registration.md
|
|
@@ -9,11 +9,9 @@ export declare class ContextAPI {
|
|
|
9
9
|
/** Get the singleton instance of the Context API */
|
|
10
10
|
static getInstance(): ContextAPI;
|
|
11
11
|
/**
|
|
12
|
-
* Set the current context manager.
|
|
13
|
-
*
|
|
14
|
-
* @returns true if the context manager was successfully registered, else false
|
|
12
|
+
* Set the current context manager. Returns the initialized context manager
|
|
15
13
|
*/
|
|
16
|
-
setGlobalContextManager(contextManager: ContextManager):
|
|
14
|
+
setGlobalContextManager(contextManager: ContextManager): ContextManager;
|
|
17
15
|
/**
|
|
18
16
|
* Get the currently active context
|
|
19
17
|
*/
|
|
@@ -30,10 +28,10 @@ export declare class ContextAPI {
|
|
|
30
28
|
/**
|
|
31
29
|
* Bind a context to a target function or event emitter
|
|
32
30
|
*
|
|
33
|
-
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
34
31
|
* @param target function or event emitter to bind
|
|
32
|
+
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
35
33
|
*/
|
|
36
|
-
bind<T>(
|
|
34
|
+
bind<T>(target: T, context?: Context): T;
|
|
37
35
|
private _getContextManager;
|
|
38
36
|
/** Disable and remove the global context manager */
|
|
39
37
|
disable(): void;
|
package/build/src/api/context.js
CHANGED
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
18
|
-
for (var
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
18
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
19
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
20
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
21
|
+
r[k] = a[j];
|
|
22
|
+
return r;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
25
|
exports.ContextAPI = void 0;
|
|
@@ -40,12 +42,11 @@ var ContextAPI = /** @class */ (function () {
|
|
|
40
42
|
return this._instance;
|
|
41
43
|
};
|
|
42
44
|
/**
|
|
43
|
-
* Set the current context manager.
|
|
44
|
-
*
|
|
45
|
-
* @returns true if the context manager was successfully registered, else false
|
|
45
|
+
* Set the current context manager. Returns the initialized context manager
|
|
46
46
|
*/
|
|
47
47
|
ContextAPI.prototype.setGlobalContextManager = function (contextManager) {
|
|
48
|
-
|
|
48
|
+
global_utils_1.registerGlobal(API_NAME, contextManager);
|
|
49
|
+
return contextManager;
|
|
49
50
|
};
|
|
50
51
|
/**
|
|
51
52
|
* Get the currently active context
|
|
@@ -67,16 +68,17 @@ var ContextAPI = /** @class */ (function () {
|
|
|
67
68
|
for (var _i = 3; _i < arguments.length; _i++) {
|
|
68
69
|
args[_i - 3] = arguments[_i];
|
|
69
70
|
}
|
|
70
|
-
return (_a = this._getContextManager()).with.apply(_a,
|
|
71
|
+
return (_a = this._getContextManager()).with.apply(_a, __spreadArrays([context, fn, thisArg], args));
|
|
71
72
|
};
|
|
72
73
|
/**
|
|
73
74
|
* Bind a context to a target function or event emitter
|
|
74
75
|
*
|
|
75
|
-
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
76
76
|
* @param target function or event emitter to bind
|
|
77
|
+
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
77
78
|
*/
|
|
78
|
-
ContextAPI.prototype.bind = function (
|
|
79
|
-
|
|
79
|
+
ContextAPI.prototype.bind = function (target, context) {
|
|
80
|
+
if (context === void 0) { context = this.active(); }
|
|
81
|
+
return this._getContextManager().bind(target, context);
|
|
80
82
|
};
|
|
81
83
|
ContextAPI.prototype._getContextManager = function () {
|
|
82
84
|
return global_utils_1.getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/api/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/api/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAEH,oEAAmE;AAEnE,yDAIkC;AAElC,IAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,IAAM,oBAAoB,GAAG,IAAI,uCAAkB,EAAE,CAAC;AAEtD;;GAEG;AACH;IAGE,+FAA+F;IAC/F;IAAuB,CAAC;IAExB,oDAAoD;IACtC,sBAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;SACnC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,4CAAuB,GAA9B,UACE,cAA8B;QAE9B,6BAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QACzC,OAAO,cAAc,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,2BAAM,GAAb;QACE,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC5C,CAAC;IAED;;;;;;;OAOG;IACI,yBAAI,GAAX,UACE,OAAgB,EAChB,EAAK,EACL,OAA8B;;QAC9B,cAAU;aAAV,UAAU,EAAV,qBAAU,EAAV,IAAU;YAAV,6BAAU;;QAEV,OAAO,CAAA,KAAA,IAAI,CAAC,kBAAkB,EAAE,CAAA,CAAC,IAAI,2BAAC,OAAO,EAAE,EAAE,EAAE,OAAO,GAAK,IAAI,GAAE;IACvE,CAAC;IAED;;;;;OAKG;IACI,yBAAI,GAAX,UAAe,MAAS,EAAE,OAAgC;QAAhC,wBAAA,EAAA,UAAmB,IAAI,CAAC,MAAM,EAAE;QACxD,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAEO,uCAAkB,GAA1B;QACE,OAAO,wBAAS,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC;IACrD,CAAC;IAED,oDAAoD;IAC7C,4BAAO,GAAd;QACE,IAAI,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,+BAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IACH,iBAAC;AAAD,CAAC,AApED,IAoEC;AApEY,gCAAU"}
|
package/build/src/api/diag.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DiagLogFunction, DiagLogger, DiagLogLevel } from '../diag/types';
|
|
2
2
|
/**
|
|
3
3
|
* Singleton object which represents the entry point to the OpenTelemetry internal
|
|
4
4
|
* diagnostic API
|
|
@@ -18,13 +18,9 @@ export declare class DiagAPI implements DiagLogger {
|
|
|
18
18
|
*
|
|
19
19
|
* @param logger - [Optional] The DiagLogger instance to set as the default logger.
|
|
20
20
|
* @param logLevel - [Optional] The DiagLogLevel used to filter logs sent to the logger. If not provided it will default to INFO.
|
|
21
|
-
* @returns
|
|
21
|
+
* @returns The previously registered DiagLogger
|
|
22
22
|
*/
|
|
23
|
-
setLogger: (logger: DiagLogger, logLevel?: DiagLogLevel) =>
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
createComponentLogger: (options: ComponentLoggerOptions) => DiagLogger;
|
|
23
|
+
setLogger: (logger: DiagLogger, logLevel?: DiagLogLevel) => void;
|
|
28
24
|
verbose: DiagLogFunction;
|
|
29
25
|
debug: DiagLogFunction;
|
|
30
26
|
info: DiagLogFunction;
|
package/build/src/api/diag.js
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.DiagAPI = void 0;
|
|
19
|
-
var ComponentLogger_1 = require("../diag/ComponentLogger");
|
|
20
19
|
var logLevelLogger_1 = require("../diag/internal/logLevelLogger");
|
|
21
20
|
var types_1 = require("../diag/types");
|
|
22
21
|
var global_utils_1 = require("../internal/global-utils");
|
|
@@ -47,7 +46,7 @@ var DiagAPI = /** @class */ (function () {
|
|
|
47
46
|
var self = this;
|
|
48
47
|
// DiagAPI specific functions
|
|
49
48
|
self.setLogger = function (logger, logLevel) {
|
|
50
|
-
var _a
|
|
49
|
+
var _a;
|
|
51
50
|
if (logLevel === void 0) { logLevel = types_1.DiagLogLevel.INFO; }
|
|
52
51
|
if (logger === self) {
|
|
53
52
|
// There isn't much we can do here.
|
|
@@ -55,24 +54,13 @@ var DiagAPI = /** @class */ (function () {
|
|
|
55
54
|
// Try to log to self. If a logger was previously registered it will receive the log.
|
|
56
55
|
var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');
|
|
57
56
|
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
58
|
-
return
|
|
57
|
+
return;
|
|
59
58
|
}
|
|
60
|
-
|
|
61
|
-
var newLogger = logLevelLogger_1.createLogLevelDiagLogger(logLevel, logger);
|
|
62
|
-
// There already is an logger registered. We'll let it know before overwriting it.
|
|
63
|
-
if (oldLogger) {
|
|
64
|
-
var stack = (_b = new Error().stack) !== null && _b !== void 0 ? _b : '<failed to generate stacktrace>';
|
|
65
|
-
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
66
|
-
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
67
|
-
}
|
|
68
|
-
return global_utils_1.registerGlobal('diag', newLogger, true);
|
|
59
|
+
global_utils_1.registerGlobal('diag', logLevelLogger_1.createLogLevelDiagLogger(logLevel, logger), true);
|
|
69
60
|
};
|
|
70
61
|
self.disable = function () {
|
|
71
62
|
global_utils_1.unregisterGlobal(API_NAME);
|
|
72
63
|
};
|
|
73
|
-
self.createComponentLogger = function (options) {
|
|
74
|
-
return new ComponentLogger_1.DiagComponentLogger(options);
|
|
75
|
-
};
|
|
76
64
|
self.verbose = _logProxy('verbose');
|
|
77
65
|
self.debug = _logProxy('debug');
|
|
78
66
|
self.info = _logProxy('info');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diag.js","sourceRoot":"","sources":["../../../src/api/diag.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"diag.js","sourceRoot":"","sources":["../../../src/api/diag.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,kEAA2E;AAC3E,uCAA0E;AAC1E,yDAIkC;AAElC,IAAM,QAAQ,GAAG,MAAM,CAAC;AAExB;;;GAGG;AACH;IAYE;;;OAGG;IACH;QACE,SAAS,SAAS,CAAC,QAA0B;YAC3C,OAAO;gBACL,IAAM,MAAM,GAAG,wBAAS,CAAC,MAAM,CAAC,CAAC;gBACjC,6BAA6B;gBAC7B,IAAI,CAAC,MAAM;oBAAE,OAAO;gBACpB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAC3B,MAAM;gBACN,6CAA6C;gBAC7C,8DAA8D;gBAC9D,SAAgB,CACjB,CAAC;YACJ,CAAC,CAAC;QACJ,CAAC;QAED,mFAAmF;QACnF,IAAM,IAAI,GAAG,IAAI,CAAC;QAElB,6BAA6B;QAE7B,IAAI,CAAC,SAAS,GAAG,UACf,MAAkB,EAClB,QAA0C;;YAA1C,yBAAA,EAAA,WAAyB,oBAAY,CAAC,IAAI;YAE1C,IAAI,MAAM,KAAK,IAAI,EAAE;gBACnB,mCAAmC;gBACnC,2DAA2D;gBAC3D,qFAAqF;gBACrF,IAAM,GAAG,GAAG,IAAI,KAAK,CACnB,oIAAoI,CACrI,CAAC;gBACF,IAAI,CAAC,KAAK,OAAC,GAAG,CAAC,KAAK,mCAAI,GAAG,CAAC,OAAO,CAAC,CAAC;gBACrC,OAAO;aACR;YAED,6BAAc,CAAC,MAAM,EAAE,yCAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;QAC3E,CAAC,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG;YACb,+BAAgB,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IA5DD,oDAAoD;IACtC,gBAAQ,GAAtB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;SAChC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IA4EH,cAAC;AAAD,CAAC,AAtFD,IAsFC;AAtFY,0BAAO"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Context } from '../context/types';
|
|
2
2
|
import { TextMapGetter, TextMapPropagator, TextMapSetter } from '../propagation/TextMapPropagator';
|
|
3
|
-
import { getBaggage, setBaggage, deleteBaggage } from '../baggage/context-helpers';
|
|
4
|
-
import { createBaggage } from '../baggage/utils';
|
|
5
3
|
/**
|
|
6
4
|
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
|
7
5
|
*/
|
|
@@ -12,11 +10,9 @@ export declare class PropagationAPI {
|
|
|
12
10
|
/** Get the singleton instance of the Propagator API */
|
|
13
11
|
static getInstance(): PropagationAPI;
|
|
14
12
|
/**
|
|
15
|
-
* Set the current propagator.
|
|
16
|
-
*
|
|
17
|
-
* @returns true if the propagator was successfully registered, else false
|
|
13
|
+
* Set the current propagator. Returns the initialized propagator
|
|
18
14
|
*/
|
|
19
|
-
setGlobalPropagator(propagator: TextMapPropagator):
|
|
15
|
+
setGlobalPropagator(propagator: TextMapPropagator): TextMapPropagator;
|
|
20
16
|
/**
|
|
21
17
|
* Inject context into a carrier to be propagated inter-process
|
|
22
18
|
*
|
|
@@ -39,10 +35,6 @@ export declare class PropagationAPI {
|
|
|
39
35
|
fields(): string[];
|
|
40
36
|
/** Remove the global propagator */
|
|
41
37
|
disable(): void;
|
|
42
|
-
createBaggage: typeof createBaggage;
|
|
43
|
-
getBaggage: typeof getBaggage;
|
|
44
|
-
setBaggage: typeof setBaggage;
|
|
45
|
-
deleteBaggage: typeof deleteBaggage;
|
|
46
38
|
private _getGlobalPropagator;
|
|
47
39
|
}
|
|
48
40
|
//# sourceMappingURL=propagation.d.ts.map
|
|
@@ -16,23 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.PropagationAPI = void 0;
|
|
19
|
-
var global_utils_1 = require("../internal/global-utils");
|
|
20
19
|
var NoopTextMapPropagator_1 = require("../propagation/NoopTextMapPropagator");
|
|
21
20
|
var TextMapPropagator_1 = require("../propagation/TextMapPropagator");
|
|
22
|
-
var
|
|
23
|
-
var utils_1 = require("../baggage/utils");
|
|
21
|
+
var global_utils_1 = require("../internal/global-utils");
|
|
24
22
|
var API_NAME = 'propagation';
|
|
25
|
-
var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator();
|
|
26
23
|
/**
|
|
27
24
|
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
|
28
25
|
*/
|
|
29
26
|
var PropagationAPI = /** @class */ (function () {
|
|
30
27
|
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
31
28
|
function PropagationAPI() {
|
|
32
|
-
this.createBaggage = utils_1.createBaggage;
|
|
33
|
-
this.getBaggage = context_helpers_1.getBaggage;
|
|
34
|
-
this.setBaggage = context_helpers_1.setBaggage;
|
|
35
|
-
this.deleteBaggage = context_helpers_1.deleteBaggage;
|
|
36
29
|
}
|
|
37
30
|
/** Get the singleton instance of the Propagator API */
|
|
38
31
|
PropagationAPI.getInstance = function () {
|
|
@@ -42,12 +35,11 @@ var PropagationAPI = /** @class */ (function () {
|
|
|
42
35
|
return this._instance;
|
|
43
36
|
};
|
|
44
37
|
/**
|
|
45
|
-
* Set the current propagator.
|
|
46
|
-
*
|
|
47
|
-
* @returns true if the propagator was successfully registered, else false
|
|
38
|
+
* Set the current propagator. Returns the initialized propagator
|
|
48
39
|
*/
|
|
49
40
|
PropagationAPI.prototype.setGlobalPropagator = function (propagator) {
|
|
50
|
-
|
|
41
|
+
global_utils_1.registerGlobal(API_NAME, propagator);
|
|
42
|
+
return propagator;
|
|
51
43
|
};
|
|
52
44
|
/**
|
|
53
45
|
* Inject context into a carrier to be propagated inter-process
|
|
@@ -82,7 +74,7 @@ var PropagationAPI = /** @class */ (function () {
|
|
|
82
74
|
global_utils_1.unregisterGlobal(API_NAME);
|
|
83
75
|
};
|
|
84
76
|
PropagationAPI.prototype._getGlobalPropagator = function () {
|
|
85
|
-
return global_utils_1.getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;
|
|
77
|
+
return global_utils_1.getGlobal(API_NAME) || NoopTextMapPropagator_1.NOOP_TEXT_MAP_PROPAGATOR;
|
|
86
78
|
};
|
|
87
79
|
return PropagationAPI;
|
|
88
80
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,
|
|
1
|
+
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8EAAgF;AAChF,sEAM0C;AAC1C,yDAIkC;AAElC,IAAM,QAAQ,GAAG,aAAa,CAAC;AAE/B;;GAEG;AACH;IAGE,+FAA+F;IAC/F;IAAuB,CAAC;IAExB,uDAAuD;IACzC,0BAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,4CAAmB,GAA1B,UAA2B,UAA6B;QACtD,6BAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACrC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACI,+BAAM,GAAb,UACE,OAAgB,EAChB,OAAgB,EAChB,MAAqD;QAArD,uBAAA,EAAA,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACI,gCAAO,GAAd,UACE,OAAgB,EAChB,OAAgB,EAChB,MAAqD;QAArD,uBAAA,EAAA,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,+BAAM,GAAb;QACE,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC9C,CAAC;IAED,mCAAmC;IAC5B,gCAAO,GAAd;QACE,+BAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAEO,6CAAoB,GAA5B;QACE,OAAO,wBAAS,CAAC,QAAQ,CAAC,IAAI,gDAAwB,CAAC;IACzD,CAAC;IACH,qBAAC;AAAD,CAAC,AApED,IAoEC;AApEY,wCAAc"}
|
package/build/src/api/trace.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { isSpanContextValid, wrapSpanContext } from '../trace/spancontext-utils';
|
|
2
1
|
import { Tracer } from '../trace/tracer';
|
|
3
2
|
import { TracerProvider } from '../trace/tracer_provider';
|
|
4
|
-
import {
|
|
3
|
+
import { isSpanContextValid } from '../trace/spancontext-utils';
|
|
5
4
|
/**
|
|
6
5
|
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
|
7
6
|
*/
|
|
@@ -13,11 +12,9 @@ export declare class TraceAPI {
|
|
|
13
12
|
/** Get the singleton instance of the Trace API */
|
|
14
13
|
static getInstance(): TraceAPI;
|
|
15
14
|
/**
|
|
16
|
-
* Set the current global tracer.
|
|
17
|
-
*
|
|
18
|
-
* @returns true if the tracer provider was successfully registered, else false
|
|
15
|
+
* Set the current global tracer. Returns the initialized global tracer provider
|
|
19
16
|
*/
|
|
20
|
-
setGlobalTracerProvider(provider: TracerProvider):
|
|
17
|
+
setGlobalTracerProvider(provider: TracerProvider): TracerProvider;
|
|
21
18
|
/**
|
|
22
19
|
* Returns the global tracer provider.
|
|
23
20
|
*/
|
|
@@ -28,12 +25,6 @@ export declare class TraceAPI {
|
|
|
28
25
|
getTracer(name: string, version?: string): Tracer;
|
|
29
26
|
/** Remove the global tracer provider */
|
|
30
27
|
disable(): void;
|
|
31
|
-
wrapSpanContext: typeof wrapSpanContext;
|
|
32
28
|
isSpanContextValid: typeof isSpanContextValid;
|
|
33
|
-
deleteSpan: typeof deleteSpan;
|
|
34
|
-
getSpan: typeof getSpan;
|
|
35
|
-
getSpanContext: typeof getSpanContext;
|
|
36
|
-
setSpan: typeof setSpan;
|
|
37
|
-
setSpanContext: typeof setSpanContext;
|
|
38
29
|
}
|
|
39
30
|
//# sourceMappingURL=trace.d.ts.map
|
package/build/src/api/trace.js
CHANGED
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.TraceAPI = void 0;
|
|
19
|
-
var global_utils_1 = require("../internal/global-utils");
|
|
20
19
|
var ProxyTracerProvider_1 = require("../trace/ProxyTracerProvider");
|
|
21
20
|
var spancontext_utils_1 = require("../trace/spancontext-utils");
|
|
22
|
-
var
|
|
21
|
+
var global_utils_1 = require("../internal/global-utils");
|
|
23
22
|
var API_NAME = 'trace';
|
|
24
23
|
/**
|
|
25
24
|
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
|
@@ -28,13 +27,7 @@ var TraceAPI = /** @class */ (function () {
|
|
|
28
27
|
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
29
28
|
function TraceAPI() {
|
|
30
29
|
this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();
|
|
31
|
-
this.wrapSpanContext = spancontext_utils_1.wrapSpanContext;
|
|
32
30
|
this.isSpanContextValid = spancontext_utils_1.isSpanContextValid;
|
|
33
|
-
this.deleteSpan = context_utils_1.deleteSpan;
|
|
34
|
-
this.getSpan = context_utils_1.getSpan;
|
|
35
|
-
this.getSpanContext = context_utils_1.getSpanContext;
|
|
36
|
-
this.setSpan = context_utils_1.setSpan;
|
|
37
|
-
this.setSpanContext = context_utils_1.setSpanContext;
|
|
38
31
|
}
|
|
39
32
|
/** Get the singleton instance of the Trace API */
|
|
40
33
|
TraceAPI.getInstance = function () {
|
|
@@ -44,13 +37,12 @@ var TraceAPI = /** @class */ (function () {
|
|
|
44
37
|
return this._instance;
|
|
45
38
|
};
|
|
46
39
|
/**
|
|
47
|
-
* Set the current global tracer.
|
|
48
|
-
*
|
|
49
|
-
* @returns true if the tracer provider was successfully registered, else false
|
|
40
|
+
* Set the current global tracer. Returns the initialized global tracer provider
|
|
50
41
|
*/
|
|
51
42
|
TraceAPI.prototype.setGlobalTracerProvider = function (provider) {
|
|
52
43
|
this._proxyTracerProvider.setDelegate(provider);
|
|
53
|
-
|
|
44
|
+
global_utils_1.registerGlobal(API_NAME, this._proxyTracerProvider);
|
|
45
|
+
return this._proxyTracerProvider;
|
|
54
46
|
};
|
|
55
47
|
/**
|
|
56
48
|
* Returns the global tracer provider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/api/trace.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/api/trace.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,oEAAmE;AAGnE,gEAAgE;AAChE,yDAIkC;AAElC,IAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB;;GAEG;AACH;IAKE,+FAA+F;IAC/F;QAHQ,yBAAoB,GAAG,IAAI,yCAAmB,EAAE,CAAC;QA2ClD,uBAAkB,GAAG,sCAAkB,CAAC;IAxCxB,CAAC;IAExB,kDAAkD;IACpC,oBAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,0CAAuB,GAA9B,UAA+B,QAAwB;QACrD,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAChD,6BAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,oCAAiB,GAAxB;QACE,OAAO,wBAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,4BAAS,GAAhB,UAAiB,IAAY,EAAE,OAAgB;QAC7C,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,wCAAwC;IACjC,0BAAO,GAAd;QACE,+BAAgB,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,CAAC,oBAAoB,GAAG,IAAI,yCAAmB,EAAE,CAAC;IACxD,CAAC;IAGH,eAAC;AAAD,CAAC,AA/CD,IA+CC;AA/CY,4BAAQ"}
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface BaggageEntry {
|
|
3
|
-
/** `String` value of the `BaggageEntry`. */
|
|
4
|
-
value: string;
|
|
5
|
-
/**
|
|
6
|
-
* Metadata is an optional string property defined by the W3C baggage specification.
|
|
7
|
-
* It currently has no special meaning defined by the specification.
|
|
8
|
-
*/
|
|
9
|
-
metadata?: BaggageEntryMetadata;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Serializable Metadata defined by the W3C baggage specification.
|
|
13
|
-
* It currently has no special meaning defined by the OpenTelemetry or W3C.
|
|
14
|
-
*/
|
|
15
|
-
export declare type BaggageEntryMetadata = {
|
|
16
|
-
toString(): string;
|
|
17
|
-
} & {
|
|
18
|
-
__TYPE__: typeof baggageEntryMetadataSymbol;
|
|
19
|
-
};
|
|
1
|
+
import { BaggageEntry } from './Entry';
|
|
20
2
|
/**
|
|
21
3
|
* Baggage represents collection of key-value pairs with optional metadata.
|
|
22
4
|
* Each key of Baggage is associated with exactly one value.
|
|
@@ -57,4 +39,4 @@ export interface Baggage {
|
|
|
57
39
|
*/
|
|
58
40
|
clear(): Baggage;
|
|
59
41
|
}
|
|
60
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=Baggage.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*
|
|
2
3
|
* Copyright The OpenTelemetry Authors
|
|
3
4
|
*
|
|
@@ -13,5 +14,5 @@
|
|
|
13
14
|
* See the License for the specific language governing permissions and
|
|
14
15
|
* limitations under the License.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
//# sourceMappingURL=Baggage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Baggage.js","sourceRoot":"","sources":["../../../src/baggage/Baggage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { baggageEntryMetadataSymbol } from './internal/symbol';
|
|
2
|
+
export interface BaggageEntry {
|
|
3
|
+
/** `String` value of the `BaggageEntry`. */
|
|
4
|
+
value: string;
|
|
5
|
+
/**
|
|
6
|
+
* Metadata is an optional string property defined by the W3C baggage specification.
|
|
7
|
+
* It currently has no special meaning defined by the specification.
|
|
8
|
+
*/
|
|
9
|
+
metadata?: BaggageEntryMetadata;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Serializable Metadata defined by the W3C baggage specification.
|
|
13
|
+
* It currently has no special meaning defined by the OpenTelemetry or W3C.
|
|
14
|
+
*/
|
|
15
|
+
export declare type BaggageEntryMetadata = {
|
|
16
|
+
toString(): string;
|
|
17
|
+
} & {
|
|
18
|
+
__TYPE__: typeof baggageEntryMetadataSymbol;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=Entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Entry.js","sourceRoot":"","sources":["../../../src/baggage/Entry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { Baggage
|
|
1
|
+
import { Baggage } from './Baggage';
|
|
2
|
+
import { BaggageEntry, BaggageEntryMetadata } from './Entry';
|
|
3
|
+
export * from './Baggage';
|
|
4
|
+
export * from './Entry';
|
|
2
5
|
/**
|
|
3
6
|
* Create a new Baggage with optional entries
|
|
4
7
|
*
|
|
@@ -12,4 +15,4 @@ export declare function createBaggage(entries?: Record<string, BaggageEntry>): B
|
|
|
12
15
|
*
|
|
13
16
|
*/
|
|
14
17
|
export declare function baggageEntryMetadataFromString(str: string): BaggageEntryMetadata;
|
|
15
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|