@opentelemetry/api 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/build/esm/api/context.d.ts +3 -1
- package/build/esm/api/context.js +23 -65
- package/build/esm/api/context.js.map +1 -1
- package/build/esm/api/diag.d.ts +3 -1
- package/build/esm/api/diag.js +28 -69
- package/build/esm/api/diag.js.map +1 -1
- package/build/esm/api/metrics.d.ts +2 -2
- package/build/esm/api/metrics.js +15 -29
- package/build/esm/api/metrics.js.map +1 -1
- package/build/esm/api/propagation.d.ts +4 -2
- package/build/esm/api/propagation.js +22 -35
- package/build/esm/api/propagation.js.map +1 -1
- package/build/esm/api/trace.d.ts +4 -2
- package/build/esm/api/trace.js +18 -29
- package/build/esm/api/trace.js.map +1 -1
- package/build/esm/baggage/context-helpers.d.ts +2 -2
- package/build/esm/baggage/context-helpers.js +2 -13
- package/build/esm/baggage/context-helpers.js.map +1 -1
- package/build/esm/baggage/internal/baggage-impl.js +23 -81
- package/build/esm/baggage/internal/baggage-impl.js.map +1 -1
- package/build/esm/baggage/internal/symbol.js +2 -13
- package/build/esm/baggage/internal/symbol.js.map +1 -1
- package/build/esm/baggage/types.d.ts +9 -2
- package/build/esm/baggage/types.js +1 -12
- package/build/esm/baggage/types.js.map +1 -1
- package/build/esm/baggage/utils.d.ts +2 -1
- package/build/esm/baggage/utils.js +6 -17
- package/build/esm/baggage/utils.js.map +1 -1
- package/build/esm/common/Attributes.d.ts +5 -1
- package/build/esm/common/Attributes.js +1 -12
- package/build/esm/common/Attributes.js.map +1 -1
- package/build/esm/common/Exception.d.ts +3 -1
- package/build/esm/common/Exception.js +1 -12
- package/build/esm/common/Exception.js.map +1 -1
- package/build/esm/common/Time.d.ts +6 -2
- package/build/esm/common/Time.js.map +1 -1
- package/build/esm/context/NoopContextManager.d.ts +1 -1
- package/build/esm/context/NoopContextManager.js +14 -58
- package/build/esm/context/NoopContextManager.js.map +1 -1
- package/build/esm/context/context.d.ts +11 -3
- package/build/esm/context/context.js +20 -24
- package/build/esm/context/context.js.map +1 -1
- package/build/esm/context/types.d.ts +6 -0
- package/build/esm/context/types.js +1 -12
- package/build/esm/context/types.js.map +1 -1
- package/build/esm/context-api.d.ts +4 -1
- package/build/esm/context-api.js +6 -14
- package/build/esm/context-api.js.map +1 -1
- package/build/esm/diag/ComponentLogger.d.ts +6 -6
- package/build/esm/diag/ComponentLogger.js +16 -75
- package/build/esm/diag/ComponentLogger.js.map +1 -1
- package/build/esm/diag/consoleLogger.d.ts +6 -1
- package/build/esm/diag/consoleLogger.js +41 -31
- package/build/esm/diag/consoleLogger.js.map +1 -1
- package/build/esm/diag/internal/logLevelLogger.d.ts +2 -1
- package/build/esm/diag/internal/logLevelLogger.js +2 -13
- package/build/esm/diag/internal/logLevelLogger.js.map +1 -1
- package/build/esm/diag/internal/noopLogger.d.ts +1 -1
- package/build/esm/diag/internal/noopLogger.js +1 -12
- package/build/esm/diag/internal/noopLogger.js.map +1 -1
- package/build/esm/diag/types.d.ts +11 -1
- package/build/esm/diag/types.js +1 -12
- package/build/esm/diag/types.js.map +1 -1
- package/build/esm/diag-api.d.ts +2 -0
- package/build/esm/diag-api.js +4 -13
- package/build/esm/diag-api.js.map +1 -1
- package/build/esm/experimental/index.d.ts +5 -1
- package/build/esm/experimental/index.js +5 -12
- package/build/esm/experimental/index.js.map +1 -1
- package/build/esm/experimental/trace/SugaredOptions.d.ts +1 -1
- package/build/esm/experimental/trace/SugaredOptions.js +1 -12
- package/build/esm/experimental/trace/SugaredOptions.js.map +1 -1
- package/build/esm/experimental/trace/SugaredTracer.d.ts +2 -2
- package/build/esm/experimental/trace/SugaredTracer.js +22 -26
- package/build/esm/experimental/trace/SugaredTracer.js.map +1 -1
- package/build/esm/index.d.ts +29 -24
- package/build/esm/index.js +9 -19
- package/build/esm/index.js.map +1 -1
- package/build/esm/internal/global-utils.d.ts +5 -5
- package/build/esm/internal/global-utils.js +20 -25
- package/build/esm/internal/global-utils.js.map +1 -1
- package/build/esm/internal/semver.js +10 -21
- package/build/esm/internal/semver.js.map +1 -1
- package/build/esm/metrics/Meter.d.ts +5 -1
- package/build/esm/metrics/Meter.js +1 -12
- package/build/esm/metrics/Meter.js.map +1 -1
- package/build/esm/metrics/MeterProvider.d.ts +3 -1
- package/build/esm/metrics/MeterProvider.js +1 -12
- package/build/esm/metrics/MeterProvider.js.map +1 -1
- package/build/esm/metrics/Metric.d.ts +79 -11
- package/build/esm/metrics/Metric.js +5 -12
- package/build/esm/metrics/Metric.js.map +1 -1
- package/build/esm/metrics/NoopMeter.d.ts +4 -2
- package/build/esm/metrics/NoopMeter.js +54 -131
- package/build/esm/metrics/NoopMeter.js.map +1 -1
- package/build/esm/metrics/NoopMeterProvider.d.ts +2 -2
- package/build/esm/metrics/NoopMeterProvider.js +6 -21
- package/build/esm/metrics/NoopMeterProvider.js.map +1 -1
- package/build/esm/metrics-api.d.ts +5 -1
- package/build/esm/metrics-api.js +7 -14
- package/build/esm/metrics-api.js.map +1 -1
- package/build/esm/propagation/NoopTextMapPropagator.d.ts +2 -2
- package/build/esm/propagation/NoopTextMapPropagator.js +8 -23
- package/build/esm/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/esm/propagation/TextMapPropagator.d.ts +14 -2
- package/build/esm/propagation/TextMapPropagator.js +12 -17
- package/build/esm/propagation/TextMapPropagator.js.map +1 -1
- package/build/esm/propagation-api.d.ts +5 -1
- package/build/esm/propagation-api.js +7 -14
- package/build/esm/propagation-api.js.map +1 -1
- package/build/esm/trace/NonRecordingSpan.d.ts +8 -8
- package/build/esm/trace/NonRecordingSpan.js +25 -39
- package/build/esm/trace/NonRecordingSpan.js.map +1 -1
- package/build/esm/trace/NoopTracer.d.ts +4 -4
- package/build/esm/trace/NoopTracer.js +21 -33
- package/build/esm/trace/NoopTracer.js.map +1 -1
- package/build/esm/trace/NoopTracerProvider.d.ts +3 -3
- package/build/esm/trace/NoopTracerProvider.js +5 -20
- package/build/esm/trace/NoopTracerProvider.js.map +1 -1
- package/build/esm/trace/ProxyTracer.d.ts +14 -9
- package/build/esm/trace/ProxyTracer.js +16 -27
- package/build/esm/trace/ProxyTracer.js.map +1 -1
- package/build/esm/trace/ProxyTracerProvider.d.ts +6 -3
- package/build/esm/trace/ProxyTracerProvider.js +15 -27
- package/build/esm/trace/ProxyTracerProvider.js.map +1 -1
- package/build/esm/trace/Sampler.d.ts +7 -5
- package/build/esm/trace/Sampler.js +1 -12
- package/build/esm/trace/Sampler.js.map +1 -1
- package/build/esm/trace/SamplingResult.d.ts +6 -2
- package/build/esm/trace/SamplingResult.js +3 -12
- package/build/esm/trace/SamplingResult.js.map +1 -1
- package/build/esm/trace/SpanOptions.d.ts +7 -5
- package/build/esm/trace/SpanOptions.js +1 -12
- package/build/esm/trace/SpanOptions.js.map +1 -1
- package/build/esm/trace/attributes.d.ts +5 -3
- package/build/esm/trace/attributes.js +1 -12
- package/build/esm/trace/attributes.js.map +1 -1
- package/build/esm/trace/context-utils.d.ts +3 -3
- package/build/esm/trace/context-utils.js +2 -13
- package/build/esm/trace/context-utils.js.map +1 -1
- package/build/esm/trace/internal/tracestate-impl.d.ts +1 -1
- package/build/esm/trace/internal/tracestate-impl.js +37 -49
- package/build/esm/trace/internal/tracestate-impl.js.map +1 -1
- package/build/esm/trace/internal/tracestate-validators.js +7 -18
- package/build/esm/trace/internal/tracestate-validators.js.map +1 -1
- package/build/esm/trace/internal/utils.d.ts +4 -1
- package/build/esm/trace/internal/utils.js +4 -12
- package/build/esm/trace/internal/utils.js.map +1 -1
- package/build/esm/trace/invalid-span-constants.d.ts +10 -1
- package/build/esm/trace/invalid-span-constants.js +13 -15
- package/build/esm/trace/invalid-span-constants.js.map +1 -1
- package/build/esm/trace/link.d.ts +4 -2
- package/build/esm/trace/link.js +1 -12
- package/build/esm/trace/link.js.map +1 -1
- package/build/esm/trace/span.d.ts +22 -10
- package/build/esm/trace/span.js +1 -12
- package/build/esm/trace/span.js.map +1 -1
- package/build/esm/trace/span_context.d.ts +3 -1
- package/build/esm/trace/span_context.js +1 -12
- package/build/esm/trace/span_context.js.map +1 -1
- package/build/esm/trace/span_kind.d.ts +3 -0
- package/build/esm/trace/span_kind.js +4 -12
- package/build/esm/trace/span_kind.js.map +1 -1
- package/build/esm/trace/spancontext-utils.d.ts +10 -2
- package/build/esm/trace/spancontext-utils.js +33 -16
- package/build/esm/trace/spancontext-utils.js.map +1 -1
- package/build/esm/trace/status.d.ts +5 -0
- package/build/esm/trace/status.js +6 -0
- package/build/esm/trace/status.js.map +1 -1
- package/build/esm/trace/trace_flags.d.ts +3 -0
- package/build/esm/trace/trace_flags.js +4 -12
- package/build/esm/trace/trace_flags.js.map +1 -1
- package/build/esm/trace/trace_state.d.ts +3 -0
- package/build/esm/trace/trace_state.js +1 -12
- package/build/esm/trace/trace_state.js.map +1 -1
- package/build/esm/trace/tracer.d.ts +5 -3
- package/build/esm/trace/tracer.js +1 -12
- package/build/esm/trace/tracer.js.map +1 -1
- package/build/esm/trace/tracer_options.d.ts +2 -0
- package/build/esm/trace/tracer_options.js +1 -12
- package/build/esm/trace/tracer_options.js.map +1 -1
- package/build/esm/trace/tracer_provider.d.ts +4 -2
- package/build/esm/trace/tracer_provider.js +1 -12
- package/build/esm/trace/tracer_provider.js.map +1 -1
- package/build/esm/trace-api.d.ts +5 -1
- package/build/esm/trace-api.js +7 -14
- package/build/esm/trace-api.js.map +1 -1
- package/build/esm/version.d.ts +1 -1
- package/build/esm/version.js +2 -13
- package/build/esm/version.js.map +1 -1
- package/build/esnext/api/context.d.ts +3 -1
- package/build/esnext/api/context.js +3 -12
- package/build/esnext/api/context.js.map +1 -1
- package/build/esnext/api/diag.d.ts +3 -1
- package/build/esnext/api/diag.js +11 -20
- package/build/esnext/api/diag.js.map +1 -1
- package/build/esnext/api/metrics.d.ts +2 -2
- package/build/esnext/api/metrics.js +1 -12
- package/build/esnext/api/metrics.js.map +1 -1
- package/build/esnext/api/propagation.d.ts +4 -2
- package/build/esnext/api/propagation.js +3 -12
- package/build/esnext/api/propagation.js.map +1 -1
- package/build/esnext/api/trace.d.ts +4 -2
- package/build/esnext/api/trace.js +3 -12
- package/build/esnext/api/trace.js.map +1 -1
- package/build/esnext/baggage/context-helpers.d.ts +2 -2
- package/build/esnext/baggage/context-helpers.js +1 -12
- package/build/esnext/baggage/context-helpers.js.map +1 -1
- package/build/esnext/baggage/internal/baggage-impl.js +2 -13
- package/build/esnext/baggage/internal/baggage-impl.js.map +1 -1
- package/build/esnext/baggage/internal/symbol.js +1 -12
- package/build/esnext/baggage/internal/symbol.js.map +1 -1
- package/build/esnext/baggage/types.d.ts +9 -2
- package/build/esnext/baggage/types.js +1 -12
- package/build/esnext/baggage/types.js.map +1 -1
- package/build/esnext/baggage/utils.d.ts +2 -1
- package/build/esnext/baggage/utils.js +2 -12
- package/build/esnext/baggage/utils.js.map +1 -1
- package/build/esnext/common/Attributes.d.ts +5 -1
- package/build/esnext/common/Attributes.js +1 -12
- package/build/esnext/common/Attributes.js.map +1 -1
- package/build/esnext/common/Exception.d.ts +3 -1
- package/build/esnext/common/Exception.js +1 -12
- package/build/esnext/common/Exception.js.map +1 -1
- package/build/esnext/common/Time.d.ts +6 -2
- package/build/esnext/common/Time.js.map +1 -1
- package/build/esnext/context/NoopContextManager.d.ts +1 -1
- package/build/esnext/context/NoopContextManager.js +1 -12
- package/build/esnext/context/NoopContextManager.js.map +1 -1
- package/build/esnext/context/context.d.ts +11 -3
- package/build/esnext/context/context.js +10 -13
- package/build/esnext/context/context.js.map +1 -1
- package/build/esnext/context/types.d.ts +6 -0
- package/build/esnext/context/types.js +1 -12
- package/build/esnext/context/types.js.map +1 -1
- package/build/esnext/context-api.d.ts +4 -1
- package/build/esnext/context-api.js +5 -13
- package/build/esnext/context-api.js.map +1 -1
- package/build/esnext/diag/ComponentLogger.d.ts +6 -6
- package/build/esnext/diag/ComponentLogger.js +2 -14
- package/build/esnext/diag/ComponentLogger.js.map +1 -1
- package/build/esnext/diag/consoleLogger.d.ts +6 -1
- package/build/esnext/diag/consoleLogger.js +36 -20
- package/build/esnext/diag/consoleLogger.js.map +1 -1
- package/build/esnext/diag/internal/logLevelLogger.d.ts +2 -1
- package/build/esnext/diag/internal/logLevelLogger.js +1 -12
- package/build/esnext/diag/internal/logLevelLogger.js.map +1 -1
- package/build/esnext/diag/internal/noopLogger.d.ts +1 -1
- package/build/esnext/diag/internal/noopLogger.js +1 -12
- package/build/esnext/diag/internal/noopLogger.js.map +1 -1
- package/build/esnext/diag/types.d.ts +11 -1
- package/build/esnext/diag/types.js +1 -12
- package/build/esnext/diag/types.js.map +1 -1
- package/build/esnext/diag-api.d.ts +2 -0
- package/build/esnext/diag-api.js +3 -12
- package/build/esnext/diag-api.js.map +1 -1
- package/build/esnext/experimental/index.d.ts +5 -1
- package/build/esnext/experimental/index.js +5 -12
- package/build/esnext/experimental/index.js.map +1 -1
- package/build/esnext/experimental/trace/SugaredOptions.d.ts +1 -1
- package/build/esnext/experimental/trace/SugaredOptions.js +1 -12
- package/build/esnext/experimental/trace/SugaredOptions.js.map +1 -1
- package/build/esnext/experimental/trace/SugaredTracer.d.ts +2 -2
- package/build/esnext/experimental/trace/SugaredTracer.js +2 -2
- package/build/esnext/experimental/trace/SugaredTracer.js.map +1 -1
- package/build/esnext/index.d.ts +29 -24
- package/build/esnext/index.js +4 -14
- package/build/esnext/index.js.map +1 -1
- package/build/esnext/internal/global-utils.d.ts +5 -5
- package/build/esnext/internal/global-utils.js +10 -14
- package/build/esnext/internal/global-utils.js.map +1 -1
- package/build/esnext/internal/semver.js +1 -12
- package/build/esnext/internal/semver.js.map +1 -1
- package/build/esnext/metrics/Meter.d.ts +5 -1
- package/build/esnext/metrics/Meter.js +1 -12
- package/build/esnext/metrics/Meter.js.map +1 -1
- package/build/esnext/metrics/MeterProvider.d.ts +3 -1
- package/build/esnext/metrics/MeterProvider.js +1 -12
- package/build/esnext/metrics/MeterProvider.js.map +1 -1
- package/build/esnext/metrics/Metric.d.ts +79 -11
- package/build/esnext/metrics/Metric.js +5 -12
- package/build/esnext/metrics/Metric.js.map +1 -1
- package/build/esnext/metrics/NoopMeter.d.ts +4 -2
- package/build/esnext/metrics/NoopMeter.js +3 -12
- package/build/esnext/metrics/NoopMeter.js.map +1 -1
- package/build/esnext/metrics/NoopMeterProvider.d.ts +2 -2
- package/build/esnext/metrics/NoopMeterProvider.js +1 -12
- package/build/esnext/metrics/NoopMeterProvider.js.map +1 -1
- package/build/esnext/metrics-api.d.ts +5 -1
- package/build/esnext/metrics-api.js +6 -13
- package/build/esnext/metrics-api.js.map +1 -1
- package/build/esnext/propagation/NoopTextMapPropagator.d.ts +2 -2
- package/build/esnext/propagation/NoopTextMapPropagator.js +1 -12
- package/build/esnext/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/esnext/propagation/TextMapPropagator.d.ts +14 -2
- package/build/esnext/propagation/TextMapPropagator.js +7 -12
- package/build/esnext/propagation/TextMapPropagator.js.map +1 -1
- package/build/esnext/propagation-api.d.ts +5 -1
- package/build/esnext/propagation-api.js +6 -13
- package/build/esnext/propagation-api.js.map +1 -1
- package/build/esnext/trace/NonRecordingSpan.d.ts +8 -8
- package/build/esnext/trace/NonRecordingSpan.js +3 -14
- package/build/esnext/trace/NonRecordingSpan.js.map +1 -1
- package/build/esnext/trace/NoopTracer.d.ts +4 -4
- package/build/esnext/trace/NoopTracer.js +6 -13
- package/build/esnext/trace/NoopTracer.js.map +1 -1
- package/build/esnext/trace/NoopTracerProvider.d.ts +3 -3
- package/build/esnext/trace/NoopTracerProvider.js +1 -12
- package/build/esnext/trace/NoopTracerProvider.js.map +1 -1
- package/build/esnext/trace/ProxyTracer.d.ts +14 -9
- package/build/esnext/trace/ProxyTracer.js +5 -14
- package/build/esnext/trace/ProxyTracer.js.map +1 -1
- package/build/esnext/trace/ProxyTracerProvider.d.ts +6 -3
- package/build/esnext/trace/ProxyTracerProvider.js +4 -12
- package/build/esnext/trace/ProxyTracerProvider.js.map +1 -1
- package/build/esnext/trace/Sampler.d.ts +7 -5
- package/build/esnext/trace/Sampler.js +1 -12
- package/build/esnext/trace/Sampler.js.map +1 -1
- package/build/esnext/trace/SamplingResult.d.ts +6 -2
- package/build/esnext/trace/SamplingResult.js +3 -12
- package/build/esnext/trace/SamplingResult.js.map +1 -1
- package/build/esnext/trace/SpanOptions.d.ts +7 -5
- package/build/esnext/trace/SpanOptions.js +1 -12
- package/build/esnext/trace/SpanOptions.js.map +1 -1
- package/build/esnext/trace/attributes.d.ts +5 -3
- package/build/esnext/trace/attributes.js +1 -12
- package/build/esnext/trace/attributes.js.map +1 -1
- package/build/esnext/trace/context-utils.d.ts +3 -3
- package/build/esnext/trace/context-utils.js +1 -12
- package/build/esnext/trace/context-utils.js.map +1 -1
- package/build/esnext/trace/internal/tracestate-impl.d.ts +1 -1
- package/build/esnext/trace/internal/tracestate-impl.js +8 -17
- package/build/esnext/trace/internal/tracestate-impl.js.map +1 -1
- package/build/esnext/trace/internal/tracestate-validators.js +1 -12
- package/build/esnext/trace/internal/tracestate-validators.js.map +1 -1
- package/build/esnext/trace/internal/utils.d.ts +4 -1
- package/build/esnext/trace/internal/utils.js +4 -12
- package/build/esnext/trace/internal/utils.js.map +1 -1
- package/build/esnext/trace/invalid-span-constants.d.ts +10 -1
- package/build/esnext/trace/invalid-span-constants.js +10 -12
- package/build/esnext/trace/invalid-span-constants.js.map +1 -1
- package/build/esnext/trace/link.d.ts +4 -2
- package/build/esnext/trace/link.js +1 -12
- package/build/esnext/trace/link.js.map +1 -1
- package/build/esnext/trace/span.d.ts +22 -10
- package/build/esnext/trace/span.js +1 -12
- package/build/esnext/trace/span.js.map +1 -1
- package/build/esnext/trace/span_context.d.ts +3 -1
- package/build/esnext/trace/span_context.js +1 -12
- package/build/esnext/trace/span_context.js.map +1 -1
- package/build/esnext/trace/span_kind.d.ts +3 -0
- package/build/esnext/trace/span_kind.js +4 -12
- package/build/esnext/trace/span_kind.js.map +1 -1
- package/build/esnext/trace/spancontext-utils.d.ts +10 -2
- package/build/esnext/trace/spancontext-utils.js +33 -16
- package/build/esnext/trace/spancontext-utils.js.map +1 -1
- package/build/esnext/trace/status.d.ts +5 -0
- package/build/esnext/trace/status.js +6 -0
- package/build/esnext/trace/status.js.map +1 -1
- package/build/esnext/trace/trace_flags.d.ts +3 -0
- package/build/esnext/trace/trace_flags.js +4 -12
- package/build/esnext/trace/trace_flags.js.map +1 -1
- package/build/esnext/trace/trace_state.d.ts +3 -0
- package/build/esnext/trace/trace_state.js +1 -12
- package/build/esnext/trace/trace_state.js.map +1 -1
- package/build/esnext/trace/tracer.d.ts +5 -3
- package/build/esnext/trace/tracer.js +1 -12
- package/build/esnext/trace/tracer.js.map +1 -1
- package/build/esnext/trace/tracer_options.d.ts +2 -0
- package/build/esnext/trace/tracer_options.js +1 -12
- package/build/esnext/trace/tracer_options.js.map +1 -1
- package/build/esnext/trace/tracer_provider.d.ts +4 -2
- package/build/esnext/trace/tracer_provider.js +1 -12
- package/build/esnext/trace/tracer_provider.js.map +1 -1
- package/build/esnext/trace-api.d.ts +5 -1
- package/build/esnext/trace-api.js +6 -13
- package/build/esnext/trace-api.js.map +1 -1
- package/build/esnext/version.d.ts +1 -1
- package/build/esnext/version.js +2 -13
- package/build/esnext/version.js.map +1 -1
- package/build/src/api/context.d.ts +3 -1
- package/build/src/api/context.js +3 -12
- package/build/src/api/context.js.map +1 -1
- package/build/src/api/diag.d.ts +3 -1
- package/build/src/api/diag.js +10 -19
- package/build/src/api/diag.js.map +1 -1
- package/build/src/api/metrics.d.ts +2 -2
- package/build/src/api/metrics.js +1 -12
- package/build/src/api/metrics.js.map +1 -1
- package/build/src/api/propagation.d.ts +4 -2
- package/build/src/api/propagation.js +3 -12
- package/build/src/api/propagation.js.map +1 -1
- package/build/src/api/trace.d.ts +4 -2
- package/build/src/api/trace.js +3 -12
- package/build/src/api/trace.js.map +1 -1
- package/build/src/baggage/context-helpers.d.ts +2 -2
- package/build/src/baggage/context-helpers.js +1 -12
- package/build/src/baggage/context-helpers.js.map +1 -1
- package/build/src/baggage/internal/baggage-impl.js +2 -13
- package/build/src/baggage/internal/baggage-impl.js.map +1 -1
- package/build/src/baggage/internal/symbol.js +1 -12
- package/build/src/baggage/internal/symbol.js.map +1 -1
- package/build/src/baggage/types.d.ts +9 -2
- package/build/src/baggage/types.js +1 -12
- package/build/src/baggage/types.js.map +1 -1
- package/build/src/baggage/utils.d.ts +2 -1
- package/build/src/baggage/utils.js +2 -12
- package/build/src/baggage/utils.js.map +1 -1
- package/build/src/common/Attributes.d.ts +5 -1
- package/build/src/common/Attributes.js +1 -12
- package/build/src/common/Attributes.js.map +1 -1
- package/build/src/common/Exception.d.ts +3 -1
- package/build/src/common/Exception.js +1 -12
- package/build/src/common/Exception.js.map +1 -1
- package/build/src/common/Time.d.ts +6 -2
- package/build/src/common/Time.js.map +1 -1
- package/build/src/context/NoopContextManager.d.ts +1 -1
- package/build/src/context/NoopContextManager.js +1 -12
- package/build/src/context/NoopContextManager.js.map +1 -1
- package/build/src/context/context.d.ts +11 -3
- package/build/src/context/context.js +11 -14
- package/build/src/context/context.js.map +1 -1
- package/build/src/context/types.d.ts +6 -0
- package/build/src/context/types.js +1 -12
- package/build/src/context/types.js.map +1 -1
- package/build/src/context-api.d.ts +4 -1
- package/build/src/context-api.js +5 -13
- package/build/src/context-api.js.map +1 -1
- package/build/src/diag/ComponentLogger.d.ts +6 -6
- package/build/src/diag/ComponentLogger.js +2 -14
- package/build/src/diag/ComponentLogger.js.map +1 -1
- package/build/src/diag/consoleLogger.d.ts +6 -1
- package/build/src/diag/consoleLogger.js +37 -21
- package/build/src/diag/consoleLogger.js.map +1 -1
- package/build/src/diag/internal/logLevelLogger.d.ts +2 -1
- package/build/src/diag/internal/logLevelLogger.js +1 -12
- package/build/src/diag/internal/logLevelLogger.js.map +1 -1
- package/build/src/diag/internal/noopLogger.d.ts +1 -1
- package/build/src/diag/internal/noopLogger.js +1 -12
- package/build/src/diag/internal/noopLogger.js.map +1 -1
- package/build/src/diag/types.d.ts +11 -1
- package/build/src/diag/types.js +1 -12
- package/build/src/diag/types.js.map +1 -1
- package/build/src/diag-api.d.ts +2 -0
- package/build/src/diag-api.js +3 -12
- package/build/src/diag-api.js.map +1 -1
- package/build/src/experimental/index.d.ts +5 -1
- package/build/src/experimental/index.js +7 -14
- package/build/src/experimental/index.js.map +1 -1
- package/build/src/experimental/trace/SugaredOptions.d.ts +1 -1
- package/build/src/experimental/trace/SugaredOptions.js +1 -12
- package/build/src/experimental/trace/SugaredOptions.js.map +1 -1
- package/build/src/experimental/trace/SugaredTracer.d.ts +2 -2
- package/build/src/experimental/trace/SugaredTracer.js.map +1 -1
- package/build/src/index.d.ts +29 -24
- package/build/src/index.js +2 -12
- package/build/src/index.js.map +1 -1
- package/build/src/internal/global-utils.d.ts +5 -5
- package/build/src/internal/global-utils.js +10 -14
- package/build/src/internal/global-utils.js.map +1 -1
- package/build/src/internal/semver.js +1 -12
- package/build/src/internal/semver.js.map +1 -1
- package/build/src/metrics/Meter.d.ts +5 -1
- package/build/src/metrics/Meter.js +1 -12
- package/build/src/metrics/Meter.js.map +1 -1
- package/build/src/metrics/MeterProvider.d.ts +3 -1
- package/build/src/metrics/MeterProvider.js +1 -12
- package/build/src/metrics/MeterProvider.js.map +1 -1
- package/build/src/metrics/Metric.d.ts +79 -11
- package/build/src/metrics/Metric.js +6 -13
- package/build/src/metrics/Metric.js.map +1 -1
- package/build/src/metrics/NoopMeter.d.ts +4 -2
- package/build/src/metrics/NoopMeter.js +3 -12
- package/build/src/metrics/NoopMeter.js.map +1 -1
- package/build/src/metrics/NoopMeterProvider.d.ts +2 -2
- package/build/src/metrics/NoopMeterProvider.js +1 -12
- package/build/src/metrics/NoopMeterProvider.js.map +1 -1
- package/build/src/metrics-api.d.ts +5 -1
- package/build/src/metrics-api.js +6 -13
- package/build/src/metrics-api.js.map +1 -1
- package/build/src/propagation/NoopTextMapPropagator.d.ts +2 -2
- package/build/src/propagation/NoopTextMapPropagator.js +1 -12
- package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/src/propagation/TextMapPropagator.d.ts +14 -2
- package/build/src/propagation/TextMapPropagator.js +7 -12
- package/build/src/propagation/TextMapPropagator.js.map +1 -1
- package/build/src/propagation-api.d.ts +5 -1
- package/build/src/propagation-api.js +6 -13
- package/build/src/propagation-api.js.map +1 -1
- package/build/src/trace/NonRecordingSpan.d.ts +8 -8
- package/build/src/trace/NonRecordingSpan.js +3 -14
- package/build/src/trace/NonRecordingSpan.js.map +1 -1
- package/build/src/trace/NoopTracer.d.ts +4 -4
- package/build/src/trace/NoopTracer.js +6 -13
- package/build/src/trace/NoopTracer.js.map +1 -1
- package/build/src/trace/NoopTracerProvider.d.ts +3 -3
- package/build/src/trace/NoopTracerProvider.js +1 -12
- package/build/src/trace/NoopTracerProvider.js.map +1 -1
- package/build/src/trace/ProxyTracer.d.ts +14 -9
- package/build/src/trace/ProxyTracer.js +5 -14
- package/build/src/trace/ProxyTracer.js.map +1 -1
- package/build/src/trace/ProxyTracerProvider.d.ts +6 -3
- package/build/src/trace/ProxyTracerProvider.js +4 -12
- package/build/src/trace/ProxyTracerProvider.js.map +1 -1
- package/build/src/trace/Sampler.d.ts +7 -5
- package/build/src/trace/Sampler.js +1 -12
- package/build/src/trace/Sampler.js.map +1 -1
- package/build/src/trace/SamplingResult.d.ts +6 -2
- package/build/src/trace/SamplingResult.js +3 -12
- package/build/src/trace/SamplingResult.js.map +1 -1
- package/build/src/trace/SpanOptions.d.ts +7 -5
- package/build/src/trace/SpanOptions.js +1 -12
- package/build/src/trace/SpanOptions.js.map +1 -1
- package/build/src/trace/attributes.d.ts +5 -3
- package/build/src/trace/attributes.js +1 -12
- package/build/src/trace/attributes.js.map +1 -1
- package/build/src/trace/context-utils.d.ts +3 -3
- package/build/src/trace/context-utils.js +1 -12
- package/build/src/trace/context-utils.js.map +1 -1
- package/build/src/trace/internal/tracestate-impl.d.ts +1 -1
- package/build/src/trace/internal/tracestate-impl.js +8 -17
- package/build/src/trace/internal/tracestate-impl.js.map +1 -1
- package/build/src/trace/internal/tracestate-validators.js +1 -12
- package/build/src/trace/internal/tracestate-validators.js.map +1 -1
- package/build/src/trace/internal/utils.d.ts +4 -1
- package/build/src/trace/internal/utils.js +4 -12
- package/build/src/trace/internal/utils.js.map +1 -1
- package/build/src/trace/invalid-span-constants.d.ts +10 -1
- package/build/src/trace/invalid-span-constants.js +10 -12
- package/build/src/trace/invalid-span-constants.js.map +1 -1
- package/build/src/trace/link.d.ts +4 -2
- package/build/src/trace/link.js +1 -12
- package/build/src/trace/link.js.map +1 -1
- package/build/src/trace/span.d.ts +22 -10
- package/build/src/trace/span.js +1 -12
- package/build/src/trace/span.js.map +1 -1
- package/build/src/trace/span_context.d.ts +3 -1
- package/build/src/trace/span_context.js +1 -12
- package/build/src/trace/span_context.js.map +1 -1
- package/build/src/trace/span_kind.d.ts +3 -0
- package/build/src/trace/span_kind.js +6 -14
- package/build/src/trace/span_kind.js.map +1 -1
- package/build/src/trace/spancontext-utils.d.ts +10 -2
- package/build/src/trace/spancontext-utils.js +33 -16
- package/build/src/trace/spancontext-utils.js.map +1 -1
- package/build/src/trace/status.d.ts +5 -0
- package/build/src/trace/status.js +6 -0
- package/build/src/trace/status.js.map +1 -1
- package/build/src/trace/trace_flags.d.ts +3 -0
- package/build/src/trace/trace_flags.js +4 -12
- package/build/src/trace/trace_flags.js.map +1 -1
- package/build/src/trace/trace_state.d.ts +3 -0
- package/build/src/trace/trace_state.js +1 -12
- package/build/src/trace/trace_state.js.map +1 -1
- package/build/src/trace/tracer.d.ts +5 -3
- package/build/src/trace/tracer.js +1 -12
- package/build/src/trace/tracer.js.map +1 -1
- package/build/src/trace/tracer_options.d.ts +2 -0
- package/build/src/trace/tracer_options.js +1 -12
- package/build/src/trace/tracer_options.js.map +1 -1
- package/build/src/trace/tracer_provider.d.ts +4 -2
- package/build/src/trace/tracer_provider.js +1 -12
- package/build/src/trace/tracer_provider.js.map +1 -1
- package/build/src/trace-api.d.ts +5 -1
- package/build/src/trace-api.js +6 -13
- package/build/src/trace-api.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +2 -13
- package/build/src/version.js.map +1 -1
- package/package.json +19 -36
- package/build/esm/metrics/ObservableResult.d.ts +0 -31
- package/build/esm/metrics/ObservableResult.js +0 -17
- package/build/esm/metrics/ObservableResult.js.map +0 -1
- package/build/esm/platform/browser/globalThis.d.ts +0 -10
- package/build/esm/platform/browser/globalThis.js +0 -35
- 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/esnext/metrics/ObservableResult.d.ts +0 -31
- package/build/esnext/metrics/ObservableResult.js +0 -17
- package/build/esnext/metrics/ObservableResult.js.map +0 -1
- package/build/esnext/platform/browser/globalThis.d.ts +0 -10
- package/build/esnext/platform/browser/globalThis.js +0 -35
- package/build/esnext/platform/browser/globalThis.js.map +0 -1
- package/build/esnext/platform/browser/index.d.ts +0 -2
- package/build/esnext/platform/browser/index.js +0 -17
- package/build/esnext/platform/browser/index.js.map +0 -1
- package/build/esnext/platform/index.d.ts +0 -2
- package/build/esnext/platform/index.js +0 -17
- package/build/esnext/platform/index.js.map +0 -1
- package/build/esnext/platform/node/globalThis.d.ts +0 -3
- package/build/esnext/platform/node/globalThis.js +0 -19
- package/build/esnext/platform/node/globalThis.js.map +0 -1
- package/build/esnext/platform/node/index.d.ts +0 -2
- package/build/esnext/platform/node/index.js +0 -17
- package/build/esnext/platform/node/index.js.map +0 -1
- package/build/src/metrics/ObservableResult.d.ts +0 -31
- package/build/src/metrics/ObservableResult.js +0 -18
- package/build/src/metrics/ObservableResult.js.map +0 -1
- package/build/src/platform/browser/globalThis.d.ts +0 -10
- package/build/src/platform/browser/globalThis.js +0 -38
- package/build/src/platform/browser/globalThis.js.map +0 -1
- package/build/src/platform/browser/index.d.ts +0 -2
- package/build/src/platform/browser/index.js +0 -29
- package/build/src/platform/browser/index.js.map +0 -1
- package/build/src/platform/index.d.ts +0 -2
- package/build/src/platform/index.js +0 -29
- package/build/src/platform/index.js.map +0 -1
- package/build/src/platform/node/globalThis.d.ts +0 -3
- package/build/src/platform/node/globalThis.js +0 -22
- package/build/src/platform/node/globalThis.js.map +0 -1
- package/build/src/platform/node/index.d.ts +0 -2
- package/build/src/platform/node/index.js +0 -29
- package/build/src/platform/node/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAwC,EAAE;IAE1C,OAAO,IAAI,WAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,qDAAqD,OAAO,GAAG,EAAE,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,0BAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport type { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\n\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(\n entries: Record<string, BaggageEntry> = {}\n): Baggage {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n * @since 1.0.0\n */\nexport function baggageEntryMetadataFromString(\n str: string\n): BaggageEntryMetadata {\n if (typeof str !== 'string') {\n diag.error(\n `Cannot create baggage metadata from unknown type: ${typeof str}`\n );\n str = '';\n }\n\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n"]}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Attributes is a map from string to attribute values.
|
|
3
3
|
*
|
|
4
4
|
* Note: only the own enumerable keys are counted as valid attribute keys.
|
|
5
|
+
*
|
|
6
|
+
* @since 1.3.0
|
|
5
7
|
*/
|
|
6
8
|
export interface Attributes {
|
|
7
9
|
[attributeKey: string]: AttributeValue | undefined;
|
|
@@ -10,6 +12,8 @@ export interface Attributes {
|
|
|
10
12
|
* Attribute values may be any non-nullish primitive value except an object.
|
|
11
13
|
*
|
|
12
14
|
* null or undefined attribute values are invalid and will result in undefined behavior.
|
|
15
|
+
*
|
|
16
|
+
* @since 1.3.0
|
|
13
17
|
*/
|
|
14
|
-
export
|
|
18
|
+
export type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
|
15
19
|
//# sourceMappingURL=Attributes.d.ts.map
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
export {};
|
|
17
6
|
//# sourceMappingURL=Attributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Attributes.js","sourceRoot":"","sources":["../../../src/common/Attributes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Attributes.js","sourceRoot":"","sources":["../../../src/common/Attributes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Attributes is a map from string to attribute values.\n *\n * Note: only the own enumerable keys are counted as valid attribute keys.\n *\n * @since 1.3.0\n */\nexport interface Attributes {\n [attributeKey: string]: AttributeValue | undefined;\n}\n\n/**\n * Attribute values may be any non-nullish primitive value except an object.\n *\n * null or undefined attribute values are invalid and will result in undefined behavior.\n *\n * @since 1.3.0\n */\nexport type AttributeValue =\n | string\n | number\n | boolean\n | Array<null | undefined | string>\n | Array<null | undefined | number>\n | Array<null | undefined | boolean>;\n"]}
|
|
@@ -20,7 +20,9 @@ interface ExceptionWithName {
|
|
|
20
20
|
* Defines Exception.
|
|
21
21
|
*
|
|
22
22
|
* string or an object with one of (message or name or code) and optional stack
|
|
23
|
+
*
|
|
24
|
+
* @since 1.0.0
|
|
23
25
|
*/
|
|
24
|
-
export
|
|
26
|
+
export type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
|
|
25
27
|
export {};
|
|
26
28
|
//# sourceMappingURL=Exception.d.ts.map
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
export {};
|
|
17
6
|
//# sourceMappingURL=Exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/common/Exception.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/common/Exception.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\ninterface ExceptionWithCode {\n code: string | number;\n name?: string;\n message?: string;\n stack?: string;\n}\n\ninterface ExceptionWithMessage {\n code?: string | number;\n message: string;\n name?: string;\n stack?: string;\n}\n\ninterface ExceptionWithName {\n code?: string | number;\n message?: string;\n name: string;\n stack?: string;\n}\n\n/**\n * Defines Exception.\n *\n * string or an object with one of (message or name or code) and optional stack\n *\n * @since 1.0.0\n */\nexport type Exception =\n | ExceptionWithCode\n | ExceptionWithMessage\n | ExceptionWithName\n | string;\n"]}
|
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
* The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
|
|
10
10
|
* HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
|
|
11
11
|
* This is represented in HrTime format as [1609504210, 150000000].
|
|
12
|
+
*
|
|
13
|
+
* @since 1.0.0
|
|
12
14
|
*/
|
|
13
|
-
export
|
|
15
|
+
export type HrTime = [number, number];
|
|
14
16
|
/**
|
|
15
17
|
* Defines TimeInput.
|
|
16
18
|
*
|
|
17
19
|
* hrtime, epoch milliseconds, performance.now() or Date
|
|
20
|
+
*
|
|
21
|
+
* @since 1.0.0
|
|
18
22
|
*/
|
|
19
|
-
export
|
|
23
|
+
export type TimeInput = HrTime | number | Date;
|
|
20
24
|
//# sourceMappingURL=Time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../src/common/Time.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n
|
|
1
|
+
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../src/common/Time.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Defines High-Resolution Time.\n *\n * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.\n * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.\n * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.\n * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:\n * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.\n * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:\n * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.\n * This is represented in HrTime format as [1609504210, 150000000].\n *\n * @since 1.0.0\n */\nexport type HrTime = [number, number];\n\n/**\n * Defines TimeInput.\n *\n * hrtime, epoch milliseconds, performance.now() or Date\n *\n * @since 1.0.0\n */\nexport type TimeInput = HrTime | number | Date;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as types from './types';
|
|
1
|
+
import type * as types from './types';
|
|
2
2
|
export declare class NoopContextManager implements types.ContextManager {
|
|
3
3
|
active(): types.Context;
|
|
4
4
|
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(_context: types.Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
import { ROOT_CONTEXT } from './context';
|
|
17
6
|
export class NoopContextManager {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopContextManager.js","sourceRoot":"","sources":["../../../src/context/NoopContextManager.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NoopContextManager.js","sourceRoot":"","sources":["../../../src/context/NoopContextManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,OAAO,kBAAkB;IAC7B,MAAM;QACJ,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,CACF,QAAuB,EACvB,EAAK,EACL,OAA8B,EAC9B,GAAG,IAAO;QAEV,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,CAAI,QAAuB,EAAE,MAAS;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ROOT_CONTEXT } from './context';\nimport type * as types from './types';\n\nexport class NoopContextManager implements types.ContextManager {\n active(): types.Context {\n return ROOT_CONTEXT;\n }\n\n with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n _context: types.Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return fn.call(thisArg, ...args);\n }\n\n bind<T>(_context: types.Context, target: T): T {\n return target;\n }\n\n enable(): this {\n return this;\n }\n\n disable(): this {\n return this;\n }\n}\n"]}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { Context } from './types';
|
|
2
|
-
/**
|
|
1
|
+
import type { Context } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Get a key to uniquely identify a context value
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
6
|
+
*/
|
|
3
7
|
export declare function createContextKey(description: string): symbol;
|
|
4
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The root context is used as the default parent context when there is no active context
|
|
10
|
+
*
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
5
13
|
export declare const ROOT_CONTEXT: Context;
|
|
6
14
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get a key to uniquely identify a context value
|
|
3
7
|
*
|
|
4
|
-
*
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
8
|
+
* @since 1.0.0
|
|
15
9
|
*/
|
|
16
|
-
/** Get a key to uniquely identify a context value */
|
|
17
10
|
export function createContextKey(description) {
|
|
18
11
|
// The specification states that for the same input, multiple calls should
|
|
19
12
|
// return different keys. Due to the nature of the JS dependency management
|
|
@@ -46,6 +39,10 @@ class BaseContext {
|
|
|
46
39
|
};
|
|
47
40
|
}
|
|
48
41
|
}
|
|
49
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* The root context is used as the default parent context when there is no active context
|
|
44
|
+
*
|
|
45
|
+
* @since 1.0.0
|
|
46
|
+
*/
|
|
50
47
|
export const ROOT_CONTEXT = new BaseContext();
|
|
51
48
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,mDAAmD;IACnD,EAAE;IACF,8EAA8E;IAC9E,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,WAAW;IAGf;;;;OAIG;IACH,YAAY,aAAoC;QAC9C,mBAAmB;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QAE1E,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,KAAc,EAAW,EAAE;YACvD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACxC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,CAAC,GAAW,EAAW,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CAyBF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAY,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from './types';\n\n/**\n * Get a key to uniquely identify a context value\n *\n * @since 1.0.0\n */\nexport function createContextKey(description: string) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\n\nclass BaseContext implements Context {\n private _currentContext!: Map<symbol, unknown>;\n\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext?: Map<symbol, unknown>) {\n // for minification\n const self = this;\n\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n\n self.getValue = (key: symbol) => self._currentContext.get(key);\n\n self.setValue = (key: symbol, value: unknown): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n\n self.deleteValue = (key: symbol): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n\n /**\n * Get a value from the context.\n *\n * @param key key which identifies a context value\n */\n public getValue!: (key: symbol) => unknown;\n\n /**\n * Create a new context which inherits from this context and has\n * the given key set to the given value.\n *\n * @param key context key for which to set the value\n * @param value value to set for the given key\n */\n public setValue!: (key: symbol, value: unknown) => Context;\n\n /**\n * Return a new context which inherits from this context but does\n * not contain a value for the given key.\n *\n * @param key context key for which to clear a value\n */\n public deleteValue!: (key: symbol) => Context;\n}\n\n/**\n * The root context is used as the default parent context when there is no active context\n *\n * @since 1.0.0\n */\nexport const ROOT_CONTEXT: Context = new BaseContext();\n"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
1
4
|
export interface Context {
|
|
2
5
|
/**
|
|
3
6
|
* Get a value from the context.
|
|
@@ -21,6 +24,9 @@ export interface Context {
|
|
|
21
24
|
*/
|
|
22
25
|
deleteValue(key: symbol): Context;
|
|
23
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
*/
|
|
24
30
|
export interface ContextManager {
|
|
25
31
|
/**
|
|
26
32
|
* Get the current active context
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
export {};
|
|
17
6
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport interface Context {\n /**\n * Get a value from the context.\n *\n * @param key key which identifies a context value\n */\n getValue(key: symbol): unknown;\n\n /**\n * Create a new context which inherits from this context and has\n * the given key set to the given value.\n *\n * @param key context key for which to set the value\n * @param value value to set for the given key\n */\n setValue(key: symbol, value: unknown): Context;\n\n /**\n * Return a new context which inherits from this context but does\n * not contain a value for the given key.\n *\n * @param key context key for which to clear a value\n */\n deleteValue(key: symbol): Context;\n}\n\n/**\n * @since 1.0.0\n */\nexport interface ContextManager {\n /**\n * Get the current active context\n */\n active(): Context;\n\n /**\n * Run the fn callback with object set as the current active context\n * @param context Any object to set as the current active context\n * @param fn A callback to be immediately run within a specific context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n context: Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F>;\n\n /**\n * Bind an object as the current context (or a specific one)\n * @param [context] Optionally specify the context which you want to assign\n * @param target Any object to which a context need to be set\n */\n bind<T>(context: Context, target: T): T;\n\n /**\n * Enable context management\n */\n enable(): this;\n\n /**\n * Disable context management\n */\n disable(): this;\n}\n"]}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
// Split module-level variable definition into separate files to allow
|
|
17
6
|
// tree-shaking on each api instance.
|
|
18
7
|
import { ContextAPI } from './api/context';
|
|
19
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Entrypoint for context API
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
*/
|
|
20
12
|
export const context = ContextAPI.getInstance();
|
|
21
13
|
//# sourceMappingURL=context-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-api.js","sourceRoot":"","sources":["../../src/context-api.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"context-api.js","sourceRoot":"","sources":["../../src/context-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/**\n * Entrypoint for context API\n * @since 1.0.0\n */\nexport const context = ContextAPI.getInstance();\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentLoggerOptions, DiagLogger } from './types';
|
|
1
|
+
import type { ComponentLoggerOptions, DiagLogger } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Component Logger which is meant to be used as part of any component which
|
|
4
4
|
* will add automatically additional namespace in front of the log message.
|
|
@@ -11,10 +11,10 @@ import { ComponentLoggerOptions, DiagLogger } from './types';
|
|
|
11
11
|
export declare class DiagComponentLogger implements DiagLogger {
|
|
12
12
|
private _namespace;
|
|
13
13
|
constructor(props: ComponentLoggerOptions);
|
|
14
|
-
debug(...args:
|
|
15
|
-
error(...args:
|
|
16
|
-
info(...args:
|
|
17
|
-
warn(...args:
|
|
18
|
-
verbose(...args:
|
|
14
|
+
debug(...args: unknown[]): void;
|
|
15
|
+
error(...args: unknown[]): void;
|
|
16
|
+
info(...args: unknown[]): void;
|
|
17
|
+
warn(...args: unknown[]): void;
|
|
18
|
+
verbose(...args: unknown[]): void;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=ComponentLogger.d.ts.map
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
import { getGlobal } from '../internal/global-utils';
|
|
17
6
|
/**
|
|
@@ -49,7 +38,6 @@ function logProxy(funcName, namespace, args) {
|
|
|
49
38
|
if (!logger) {
|
|
50
39
|
return;
|
|
51
40
|
}
|
|
52
|
-
|
|
53
|
-
return logger[funcName](...args);
|
|
41
|
+
return logger[funcName](namespace, ...args);
|
|
54
42
|
}
|
|
55
43
|
//# sourceMappingURL=ComponentLogger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentLogger.js","sourceRoot":"","sources":["../../../src/diag/ComponentLogger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ComponentLogger.js","sourceRoot":"","sources":["../../../src/diag/ComponentLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD;;;;;;;;GAQG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,KAA6B;QACvC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,IAAI,qBAAqB,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,GAAG,IAAe;QAC7B,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,GAAG,IAAe;QAC7B,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,IAAI,CAAC,GAAG,IAAe;QAC5B,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,IAAI,CAAC,GAAG,IAAe;QAC5B,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,OAAO,CAAC,GAAG,IAAe;QAC/B,OAAO,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF;AAED,SAAS,QAAQ,CACf,QAA0B,EAC1B,SAAiB,EACjB,IAAe;IAEf,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,6BAA6B;IAC7B,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IAED,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getGlobal } from '../internal/global-utils';\nimport type { ComponentLoggerOptions, DiagLogger } from './types';\n\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nexport class DiagComponentLogger implements DiagLogger {\n private _namespace: string;\n\n constructor(props: ComponentLoggerOptions) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n\n public debug(...args: unknown[]): void {\n return logProxy('debug', this._namespace, args);\n }\n\n public error(...args: unknown[]): void {\n return logProxy('error', this._namespace, args);\n }\n\n public info(...args: unknown[]): void {\n return logProxy('info', this._namespace, args);\n }\n\n public warn(...args: unknown[]): void {\n return logProxy('warn', this._namespace, args);\n }\n\n public verbose(...args: unknown[]): void {\n return logProxy('verbose', this._namespace, args);\n }\n}\n\nfunction logProxy(\n funcName: keyof DiagLogger,\n namespace: string,\n args: unknown[]\n): void {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n\n return logger[funcName](namespace, ...args);\n}\n"]}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { DiagLogger, DiagLogFunction } from './types';
|
|
1
|
+
import type { DiagLogger, DiagLogFunction } from './types';
|
|
2
|
+
type ConsoleMapKeys = 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
3
|
+
export declare const _originalConsoleMethods: Partial<Record<ConsoleMapKeys | 'log', typeof console.log>>;
|
|
2
4
|
/**
|
|
3
5
|
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
|
|
4
6
|
* If you want to limit the amount of logging to a specific level or lower use the
|
|
5
7
|
* {@link createLogLevelDiagLogger}
|
|
8
|
+
*
|
|
9
|
+
* @since 1.0.0
|
|
6
10
|
*/
|
|
7
11
|
export declare class DiagConsoleLogger implements DiagLogger {
|
|
8
12
|
constructor();
|
|
@@ -35,4 +39,5 @@ export declare class DiagConsoleLogger implements DiagLogger {
|
|
|
35
39
|
*/
|
|
36
40
|
verbose: DiagLogFunction;
|
|
37
41
|
}
|
|
42
|
+
export {};
|
|
38
43
|
//# sourceMappingURL=consoleLogger.d.ts.map
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
const consoleMap = [
|
|
17
6
|
{ n: 'error', c: 'error' },
|
|
@@ -20,28 +9,55 @@ const consoleMap = [
|
|
|
20
9
|
{ n: 'debug', c: 'debug' },
|
|
21
10
|
{ n: 'verbose', c: 'trace' },
|
|
22
11
|
];
|
|
12
|
+
// Save original console methods at module load time, before any instrumentation
|
|
13
|
+
// can wrap them. This ensures DiagConsoleLogger calls the unwrapped originals.
|
|
14
|
+
// Exported for testing only — not part of the public API.
|
|
15
|
+
export const _originalConsoleMethods = {};
|
|
16
|
+
if (typeof console !== 'undefined') {
|
|
17
|
+
const keys = [
|
|
18
|
+
'error',
|
|
19
|
+
'warn',
|
|
20
|
+
'info',
|
|
21
|
+
'debug',
|
|
22
|
+
'trace',
|
|
23
|
+
'log',
|
|
24
|
+
];
|
|
25
|
+
for (const key of keys) {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
if (typeof console[key] === 'function') {
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
_originalConsoleMethods[key] = console[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
23
33
|
/**
|
|
24
34
|
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
|
|
25
35
|
* If you want to limit the amount of logging to a specific level or lower use the
|
|
26
36
|
* {@link createLogLevelDiagLogger}
|
|
37
|
+
*
|
|
38
|
+
* @since 1.0.0
|
|
27
39
|
*/
|
|
28
40
|
export class DiagConsoleLogger {
|
|
29
41
|
constructor() {
|
|
30
42
|
function _consoleFunc(funcName) {
|
|
31
43
|
return function (...args) {
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
// Prefer original (pre-instrumentation) methods saved at module load time.
|
|
45
|
+
let theFunc = _originalConsoleMethods[funcName];
|
|
46
|
+
// Some environments only expose the console when the F12 developer console is open
|
|
47
|
+
if (typeof theFunc !== 'function') {
|
|
48
|
+
theFunc = _originalConsoleMethods['log'];
|
|
49
|
+
}
|
|
50
|
+
// Fall back in case console was not available at module load time but became available later.
|
|
51
|
+
if (typeof theFunc !== 'function' && console) {
|
|
34
52
|
// eslint-disable-next-line no-console
|
|
35
|
-
|
|
53
|
+
theFunc = console[funcName];
|
|
36
54
|
if (typeof theFunc !== 'function') {
|
|
37
|
-
// Not all environments support all functions
|
|
38
55
|
// eslint-disable-next-line no-console
|
|
39
56
|
theFunc = console.log;
|
|
40
57
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
58
|
+
}
|
|
59
|
+
if (typeof theFunc === 'function') {
|
|
60
|
+
return theFunc.apply(console, args);
|
|
45
61
|
}
|
|
46
62
|
};
|
|
47
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleLogger.js","sourceRoot":"","sources":["../../../src/diag/consoleLogger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"consoleLogger.js","sourceRoot":"","sources":["../../../src/diag/consoleLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,UAAU,GAAiD;IAC/D,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE;CAC7B,CAAC;AAEF,gFAAgF;AAChF,+EAA+E;AAC/E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,uBAAuB,GAEhC,EAAE,CAAC;AACP,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;IAClC,MAAM,IAAI,GAA+B;QACvC,OAAO;QACP,MAAM;QACN,MAAM;QACN,OAAO;QACP,OAAO;QACP,KAAK;KACN,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,sCAAsC;QACtC,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,UAAU,EAAE;YACtC,sCAAsC;YACtC,uBAAuB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;SAC7C;KACF;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IAC5B;QACE,SAAS,YAAY,CAAC,QAAwB;YAC5C,OAAO,UAAU,GAAG,IAAI;gBACtB,2EAA2E;gBAC3E,IAAI,OAAO,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;gBAChD,mFAAmF;gBACnF,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;oBACjC,OAAO,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;iBAC1C;gBACD,8FAA8F;gBAC9F,IAAI,OAAO,OAAO,KAAK,UAAU,IAAI,OAAO,EAAE;oBAC5C,sCAAsC;oBACtC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC5B,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;wBACjC,sCAAsC;wBACtC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;qBACvB;iBACF;gBACD,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;oBACjC,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;iBACrC;YACH,CAAC,CAAC;QACJ,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD;IACH,CAAC;CAkCF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DiagLogger, DiagLogFunction } from './types';\n\ntype ConsoleMapKeys = 'error' | 'warn' | 'info' | 'debug' | 'trace';\nconst consoleMap: { n: keyof DiagLogger; c: ConsoleMapKeys }[] = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n\n// Save original console methods at module load time, before any instrumentation\n// can wrap them. This ensures DiagConsoleLogger calls the unwrapped originals.\n// Exported for testing only — not part of the public API.\nexport const _originalConsoleMethods: Partial<\n Record<ConsoleMapKeys | 'log', typeof console.log>\n> = {};\nif (typeof console !== 'undefined') {\n const keys: (ConsoleMapKeys | 'log')[] = [\n 'error',\n 'warn',\n 'info',\n 'debug',\n 'trace',\n 'log',\n ];\n for (const key of keys) {\n // eslint-disable-next-line no-console\n if (typeof console[key] === 'function') {\n // eslint-disable-next-line no-console\n _originalConsoleMethods[key] = console[key];\n }\n }\n}\n\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n *\n * @since 1.0.0\n */\nexport class DiagConsoleLogger implements DiagLogger {\n constructor() {\n function _consoleFunc(funcName: ConsoleMapKeys): DiagLogFunction {\n return function (...args) {\n // Prefer original (pre-instrumentation) methods saved at module load time.\n let theFunc = _originalConsoleMethods[funcName];\n // Some environments only expose the console when the F12 developer console is open\n if (typeof theFunc !== 'function') {\n theFunc = _originalConsoleMethods['log'];\n }\n // Fall back in case console was not available at module load time but became available later.\n if (typeof theFunc !== 'function' && console) {\n // eslint-disable-next-line no-console\n theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n }\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n };\n }\n\n for (let i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n\n /** Log an error scenario that was not expected and caused the requested operation to fail. */\n public error!: DiagLogFunction;\n\n /**\n * Log a warning scenario to inform the developer of an issues that should be investigated.\n * The requested operation may or may not have succeeded or completed.\n */\n public warn!: DiagLogFunction;\n\n /**\n * Log a general informational message, this should not affect functionality.\n * This is also the default logging level so this should NOT be used for logging\n * debugging level information.\n */\n public info!: DiagLogFunction;\n\n /**\n * Log a general debug message that can be useful for identifying a failure.\n * Information logged at this level may include diagnostic details that would\n * help identify a failure scenario. Useful scenarios would be to log the execution\n * order of async operations\n */\n public debug!: DiagLogFunction;\n\n /**\n * Log a detailed (verbose) trace level logging that can be used to identify failures\n * where debug level logging would be insufficient, this level of tracing can include\n * input and output parameters and as such may include PII information passing through\n * the API. As such it is recommended that this level of tracing should not be enabled\n * in a production environment.\n */\n public verbose!: DiagLogFunction;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { DiagLogger
|
|
1
|
+
import type { DiagLogger } from '../types';
|
|
2
|
+
import { DiagLogLevel } from '../types';
|
|
2
3
|
export declare function createLogLevelDiagLogger(maxLevel: DiagLogLevel, logger: DiagLogger): DiagLogger;
|
|
3
4
|
//# sourceMappingURL=logLevelLogger.d.ts.map
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
import { DiagLogLevel } from '../types';
|
|
17
6
|
export function createLogLevelDiagLogger(maxLevel, logger) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logLevelLogger.js","sourceRoot":"","sources":["../../../../src/diag/internal/logLevelLogger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logLevelLogger.js","sourceRoot":"","sources":["../../../../src/diag/internal/logLevelLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,UAAU,wBAAwB,CACtC,QAAsB,EACtB,MAAkB;IAElB,IAAI,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE;QAChC,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC;KAC9B;SAAM,IAAI,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE;QACtC,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC;KAC7B;IAED,0CAA0C;IAC1C,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAEtB,SAAS,WAAW,CAClB,QAA0B,EAC1B,QAAsB;QAEtB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEjC,IAAI,OAAO,OAAO,KAAK,UAAU,IAAI,QAAQ,IAAI,QAAQ,EAAE;YACzD,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B;QACD,OAAO,cAAa,CAAC,CAAC;IACxB,CAAC;IAED,OAAO;QACL,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;QAC/C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC5C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC5C,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;QAC/C,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DiagLogFunction, DiagLogger } from '../types';\nimport { DiagLogLevel } from '../types';\n\nexport function createLogLevelDiagLogger(\n maxLevel: DiagLogLevel,\n logger: DiagLogger\n): DiagLogger {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n } else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n\n // In case the logger is null or undefined\n logger = logger || {};\n\n function _filterFunc(\n funcName: keyof DiagLogger,\n theLevel: DiagLogLevel\n ): DiagLogFunction {\n const theFunc = logger[funcName];\n\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () {};\n }\n\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n"]}
|