autotel 7.7.1 → 7.8.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/dist/analysis.cjs +0 -1
- package/dist/{attribute-redacting-processor-CvBE0z1p.d.ts → attribute-redacting-processor-rkV_WL-k.d.ts} +2 -2
- package/dist/attribute-redacting-processor.cjs +1 -1
- package/dist/attribute-redacting-processor.d.ts +1 -1
- package/dist/{attributes-De9Fx0b4.js → attributes-CuGx6cOI.js} +21 -11
- package/dist/{attributes-DkptT2Ck.cjs → attributes-Ii3jDPsW.cjs} +23 -13
- package/dist/attributes.cjs +1 -1
- package/dist/attributes.d.ts +1 -1
- package/dist/attributes.js +1 -1
- package/dist/auto.cjs +2 -2
- package/dist/auto.js +1 -1
- package/dist/business-baggage.cjs +1 -1
- package/dist/{canonical-log-line-processor-Bvgb1lE4.cjs → canonical-log-line-processor-BU03jJeA.cjs} +1 -1
- package/dist/{canonical-log-line-processor-Yq4cXcD5.d.ts → canonical-log-line-processor-Bwrt_L4c.d.ts} +1 -1
- package/dist/{correlated-events-9RRdfyWR.cjs → correlated-events-DE_4A3oD.cjs} +1 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/db.cjs +1 -1
- package/dist/decorators.cjs +2 -2
- package/dist/decorators.d.cts +1 -1
- package/dist/decorators.d.ts +1 -1
- package/dist/decorators.js +1 -1
- package/dist/diagnostics.cjs +3 -3
- package/dist/diagnostics.js +1 -1
- package/dist/drain-pipeline.cjs +0 -1
- package/dist/enrichers.cjs +0 -1
- package/dist/event-testing.cjs +0 -1
- package/dist/event.cjs +1 -1
- package/dist/event.js +1 -1
- package/dist/evidence.cjs +0 -1
- package/dist/exception-fingerprint.cjs +1 -1
- package/dist/{filtering-span-processor-BpDagWNa.d.ts → filtering-span-processor-vkewzbqB.d.ts} +2 -2
- package/dist/filtering-span-processor.cjs +0 -1
- package/dist/filtering-span-processor.d.ts +1 -1
- package/dist/{functional-S9IJNlBn.js → functional-CC2BFGAO.js} +9 -9
- package/dist/{functional-C4mjgtJb.d.cts → functional-DPZTpGh6.d.cts} +2 -2
- package/dist/{functional-DN_ztd9C.d.ts → functional-SeRUabkE.d.ts} +2 -2
- package/dist/{functional-UIJ0CaTV.cjs → functional-u5Qwjray.cjs} +3 -3
- package/dist/functional.cjs +1 -1
- package/dist/functional.d.cts +1 -1
- package/dist/functional.d.ts +1 -1
- package/dist/functional.js +1 -1
- package/dist/http.cjs +2 -2
- package/dist/http.js +1 -1
- package/dist/{index-o_6YjZhV.d.ts → index-B9aRLp6c.d.ts} +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.js +3 -3
- package/dist/{init-BYXDCfRL.cjs → init-21HWbm7_.cjs} +194 -39
- package/dist/{init-Dyq6WtsO.js → init-8SISAGdE.js} +190 -35
- package/dist/{init-WwjD-kQu.d.cts → init-COfMwKbc.d.cts} +38 -10
- package/dist/{init-CKSMbJUG.d.ts → init-CnoRlJqS.d.ts} +43 -15
- package/dist/instrumentation.cjs +9 -8
- package/dist/instrumentation.js +8 -7
- package/dist/{logger-CSdZkxbh.cjs → logger-DLjHQAus.cjs} +1 -1
- package/dist/logger.cjs +1 -1
- package/dist/messaging-adapters.cjs +1 -1
- package/dist/messaging-testing.cjs +0 -1
- package/dist/messaging.cjs +8 -7
- package/dist/messaging.js +5 -4
- package/dist/metric-testing.cjs +0 -1
- package/dist/{node-require-B_IVapV3.cjs → node-require-BPsB09eC.cjs} +2 -2
- package/dist/parse-error.cjs +1 -1
- package/dist/{policy-C4QcZnqv.d.ts → policy-DNw_0qUq.d.ts} +1 -1
- package/dist/policy.cjs +0 -0
- package/dist/policy.d.ts +1 -1
- package/dist/processors.cjs +1 -1
- package/dist/processors.d.ts +1 -1
- package/dist/register.cjs +1 -1
- package/dist/{registry-DIoklBz5.cjs → registry-B3ZJmUtU.cjs} +0 -1
- package/dist/{rolldown-runtime-C_NdSu1c.cjs → rolldown-runtime-C24Yb2bl.cjs} +1 -2
- package/dist/{sampling-DBng4Foa.d.ts → sampling-CZi7OM9u.d.ts} +13 -13
- package/dist/{sampling-Er217Mge.d.cts → sampling-DENUjT_8.d.cts} +13 -13
- package/dist/sampling.cjs +1 -1
- package/dist/sampling.d.cts +1 -1
- package/dist/sampling.d.ts +1 -1
- package/dist/sampling.js +1 -1
- package/dist/security-schema.cjs +0 -1
- package/dist/semantic-conventions.cjs +1 -1
- package/dist/semantic-helpers.cjs +3 -3
- package/dist/semantic-helpers.js +1 -1
- package/dist/{span-name-normalizer-CN1-8C76.d.ts → span-name-normalizer-DHcg1bSP.d.ts} +2 -2
- package/dist/span-name-normalizer.cjs +0 -1
- package/dist/span-name-normalizer.d.ts +1 -1
- package/dist/{stable-hash-C9F6xjzx.cjs → stable-hash-sLi1o4jj.cjs} +2 -2
- package/dist/{structured-error-BAXhglRE.cjs → structured-error-DynjWTTu.cjs} +1 -1
- package/dist/tail-sampling-processor.cjs +1 -1
- package/dist/tail-sampling-processor.d.ts +2 -2
- package/dist/tail-sampling-processor.js +1 -1
- package/dist/test-span-collector.cjs +1 -1
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/{trace-factory-validation-Dc8epn87.cjs → trace-factory-validation-CHU1WcjK.cjs} +0 -1
- package/dist/trace-helpers.cjs +2 -2
- package/dist/tracer-provider.cjs +1 -1
- package/dist/validate.cjs +3 -3
- package/dist/validation-attributes.cjs +0 -1
- package/dist/{values-tm4bi0FF.cjs → values-AxGpgYBA.cjs} +0 -1
- package/dist/webhook.cjs +16 -13
- package/dist/webhook.js +14 -11
- package/dist/workflow-distributed.cjs +4 -6
- package/dist/workflow-distributed.js +2 -4
- package/dist/workflow.cjs +7 -6
- package/dist/workflow.js +3 -2
- package/dist/yaml-config.cjs +1 -1
- package/dist/yaml-config.d.cts +2 -2
- package/dist/yaml-config.d.ts +2 -2
- package/dist/yaml-config.js +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_rolldown_runtime = require('./rolldown-runtime-
|
|
3
|
-
const
|
|
2
|
+
const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
|
|
3
|
+
const require_init = require('./init-21HWbm7_.cjs');
|
|
4
|
+
const require_values = require('./values-AxGpgYBA.cjs');
|
|
4
5
|
const require_tracer_provider = require('./tracer-provider.cjs');
|
|
5
|
-
const require_structured_error = require('./structured-error-
|
|
6
|
-
const require_init = require('./init-BYXDCfRL.cjs');
|
|
6
|
+
const require_structured_error = require('./structured-error-DynjWTTu.cjs');
|
|
7
7
|
const require_filtering_span_processor = require('./filtering-span-processor.cjs');
|
|
8
8
|
const require_span_name_normalizer = require('./span-name-normalizer.cjs');
|
|
9
9
|
const require_attribute_redacting_processor = require('./attribute-redacting-processor.cjs');
|
|
10
|
-
const require_canonical_log_line_processor = require('./canonical-log-line-processor-
|
|
10
|
+
const require_canonical_log_line_processor = require('./canonical-log-line-processor-BU03jJeA.cjs');
|
|
11
11
|
const require_metric = require('./metric.cjs');
|
|
12
|
-
const require_functional = require('./functional-
|
|
12
|
+
const require_functional = require('./functional-u5Qwjray.cjs');
|
|
13
13
|
const require_trace_helpers = require('./trace-helpers.cjs');
|
|
14
|
-
const require_stable_hash = require('./stable-hash-
|
|
15
|
-
const require_correlated_events = require('./correlated-events-
|
|
14
|
+
const require_stable_hash = require('./stable-hash-sLi1o4jj.cjs');
|
|
15
|
+
const require_correlated_events = require('./correlated-events-DE_4A3oD.cjs');
|
|
16
16
|
const require_parse_error = require('./parse-error.cjs');
|
|
17
17
|
const require_drain_pipeline = require('./drain-pipeline.cjs');
|
|
18
18
|
const require_metric_helpers = require('./metric-helpers.cjs');
|
|
19
19
|
const require_semantic_helpers = require('./semantic-helpers.cjs');
|
|
20
|
-
const require_registry = require('./registry-
|
|
20
|
+
const require_registry = require('./registry-B3ZJmUtU.cjs');
|
|
21
21
|
const require_semantic_conventions = require('./semantic-conventions.cjs');
|
|
22
|
-
const require_attributes = require('./attributes-
|
|
22
|
+
const require_attributes = require('./attributes-Ii3jDPsW.cjs');
|
|
23
23
|
const require_messaging = require('./messaging.cjs');
|
|
24
24
|
const require_business_baggage = require('./business-baggage.cjs');
|
|
25
25
|
const require_workflow = require('./workflow.cjs');
|
package/dist/index.d.cts
CHANGED
|
@@ -4,13 +4,13 @@ import { t as UnknownRecord } from "./values-CeMH-mYG.cjs";
|
|
|
4
4
|
import { n as TraceContext$1, r as defineBaggageSchema, t as AttributeValue$2 } from "./trace-context-f7Xq0Q2q.cjs";
|
|
5
5
|
import { BaggageError, BaggageFieldDefinition, BaggageFieldType, BusinessBaggage, BusinessBaggageValues, SafeBaggageOptions, SafeBaggageSchema, createSafeBaggageSchema } from "./business-baggage.cjs";
|
|
6
6
|
import { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage } from "./correlation-id.cjs";
|
|
7
|
-
import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-
|
|
8
|
-
import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-
|
|
7
|
+
import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-DENUjT_8.cjs";
|
|
8
|
+
import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-DPZTpGh6.cjs";
|
|
9
9
|
import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./drain-pipeline.cjs";
|
|
10
10
|
import { a as EventSchemaMetadata, c as FunnelStatus, l as OutcomeStatus, n as EventAttributeValue, o as EventSubscriber, r as EventAttributes, s as EventTrackingOptions, t as AutotelEventContext } from "./event-subscriber-DMACQA-1.cjs";
|
|
11
11
|
import { Event, EventsOptions, getEvents, resetEvents } from "./event.cjs";
|
|
12
12
|
import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-BpDagWNa.cjs";
|
|
13
|
-
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-
|
|
13
|
+
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-COfMwKbc.cjs";
|
|
14
14
|
import { a as SpanNameNormalizerPreset, i as SpanNameNormalizerFn, n as NORMALIZER_PRESETS, o as SpanNameNormalizingProcessor, r as SpanNameNormalizerConfig, s as SpanNameNormalizingProcessorOptions, t as NORMALIZER_PATTERNS } from "./span-name-normalizer-CN1-8C76.cjs";
|
|
15
15
|
import "./canonical-log-line-processor-C0Z_N4oL.cjs";
|
|
16
16
|
import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-BNeuKUPv.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-
|
|
2
|
-
import { A as ExceptionAttrs, B as PeerAttrs, C as CloudAttrs, D as DeploymentAttrs, E as DBAttrs, F as HTTPServerAttrs, G as SessionAttrs, H as RPCAttrs, I as K8sAttrs, J as URLAttrs, K as TLSAttrs, L as MessagingAttrs, M as FeatureFlagAttrs, N as GraphQLAttrs, O as DeviceAttrs, P as HTTPClientAttrs, R as NetworkAttrs, S as ClientAttrs, T as ContainerAttrs, U as ServerAddressAttrs, V as ProcessAttrs, W as ServiceAttrs, Y as UserAttrs, _ as autoRedactPII, a as httpClient, b as validateAttribute, c as mergeServiceResource, d as setError, f as setException, g as AttributePolicy, h as AttributeGuardrails, i as dbClient, j as FaaSAttrs, k as ErrorAttrs, l as request, m as setUser, n as safeSetAttributes, o as httpServer, p as setSession, q as ThreadAttrs, s as identify, t as mergeAttrs, u as setDevice, w as CodeAttrs, x as attrs, z as OTelAttrs } from "./index-
|
|
1
|
+
import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-rkV_WL-k.js";
|
|
2
|
+
import { A as ExceptionAttrs, B as PeerAttrs, C as CloudAttrs, D as DeploymentAttrs, E as DBAttrs, F as HTTPServerAttrs, G as SessionAttrs, H as RPCAttrs, I as K8sAttrs, J as URLAttrs, K as TLSAttrs, L as MessagingAttrs, M as FeatureFlagAttrs, N as GraphQLAttrs, O as DeviceAttrs, P as HTTPClientAttrs, R as NetworkAttrs, S as ClientAttrs, T as ContainerAttrs, U as ServerAddressAttrs, V as ProcessAttrs, W as ServiceAttrs, Y as UserAttrs, _ as autoRedactPII, a as httpClient, b as validateAttribute, c as mergeServiceResource, d as setError, f as setException, g as AttributePolicy, h as AttributeGuardrails, i as dbClient, j as FaaSAttrs, k as ErrorAttrs, l as request, m as setUser, n as safeSetAttributes, o as httpServer, p as setSession, q as ThreadAttrs, s as identify, t as mergeAttrs, u as setDevice, w as CodeAttrs, x as attrs, z as OTelAttrs } from "./index-B9aRLp6c.js";
|
|
3
3
|
import { t as UnknownRecord } from "./values-CeMH-mYG.js";
|
|
4
4
|
import { n as TraceContext$1, r as defineBaggageSchema, t as AttributeValue$2 } from "./trace-context-CqCblIQE.js";
|
|
5
5
|
import { BaggageError, BaggageFieldDefinition, BaggageFieldType, BusinessBaggage, BusinessBaggageValues, SafeBaggageOptions, SafeBaggageSchema, createSafeBaggageSchema } from "./business-baggage.js";
|
|
6
6
|
import { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage } from "./correlation-id.js";
|
|
7
|
-
import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-
|
|
8
|
-
import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-
|
|
7
|
+
import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-CZi7OM9u.js";
|
|
8
|
+
import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-SeRUabkE.js";
|
|
9
9
|
import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./drain-pipeline.js";
|
|
10
10
|
import { a as EventSchemaMetadata, c as FunnelStatus, l as OutcomeStatus, n as EventAttributeValue, o as EventSubscriber, r as EventAttributes, s as EventTrackingOptions, t as AutotelEventContext } from "./event-subscriber-DMACQA-1.js";
|
|
11
11
|
import { Event, EventsOptions, getEvents, resetEvents } from "./event.js";
|
|
12
|
-
import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-
|
|
13
|
-
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-
|
|
14
|
-
import { a as SpanNameNormalizerPreset, i as SpanNameNormalizerFn, n as NORMALIZER_PRESETS, o as SpanNameNormalizingProcessor, r as SpanNameNormalizerConfig, s as SpanNameNormalizingProcessorOptions, t as NORMALIZER_PATTERNS } from "./span-name-normalizer-
|
|
15
|
-
import "./canonical-log-line-processor-
|
|
12
|
+
import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-vkewzbqB.js";
|
|
13
|
+
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-CnoRlJqS.js";
|
|
14
|
+
import { a as SpanNameNormalizerPreset, i as SpanNameNormalizerFn, n as NORMALIZER_PRESETS, o as SpanNameNormalizingProcessor, r as SpanNameNormalizerConfig, s as SpanNameNormalizingProcessorOptions, t as NORMALIZER_PATTERNS } from "./span-name-normalizer-DHcg1bSP.js";
|
|
15
|
+
import "./canonical-log-line-processor-Bwrt_L4c.js";
|
|
16
16
|
import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-Bd8f8mST.js";
|
|
17
17
|
import { ParsedError, parseError } from "./parse-error.js";
|
|
18
18
|
import { Metric, MetricsOptions, getMetrics, resetMetrics } from "./metric.js";
|
|
@@ -23,8 +23,8 @@ import { DBConfig, HTTPConfig, MessagingConfig, traceDB, traceHTTP, traceMessagi
|
|
|
23
23
|
import { a as URLAttributes, i as ServiceAttributes, n as httpResponseHeaderAttribute, r as HTTPAttributes, t as httpRequestHeaderAttribute } from "./semantic-conventions-FhSxv-bK.js";
|
|
24
24
|
import { ConsumerConfig, ConsumerContext, LagMetricsConfig, MessagingOperation, MessagingSystem, ProducerConfig, ProducerContext, traceConsumer, traceProducer } from "./messaging.js";
|
|
25
25
|
import { StepConfig, StepContext, StepStatus, WorkflowConfig, WorkflowContext, WorkflowStatus, getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from "./workflow.js";
|
|
26
|
+
import { AttributeValue, Attributes, Baggage, BaggageEntry, Context, Context as Context$1, Exception, HrTime, Link, Link as SpanLink, ROOT_CONTEXT, Span, Span as Span$1, SpanAttributes, SpanContext, SpanKind, SpanStatusCode, TextMapGetter, TextMapSetter, TimeInput, TraceFlags, TraceState, Tracer, TracerProvider, context, propagation, trace as otelTrace, trace as trace$1 } from "@opentelemetry/api";
|
|
26
27
|
import { ReadableSpan, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
27
|
-
import { AttributeValue, Attributes, Baggage, BaggageEntry, Context, Context as Context$1, Exception, HrTime, Link, Link as SpanLink, ROOT_CONTEXT, Span, Span as Span$2, SpanAttributes, SpanContext, SpanKind, SpanStatusCode, TextMapGetter, TextMapSetter, TimeInput, TraceFlags, TraceState, Tracer, TracerProvider, context, propagation, trace as otelTrace, trace as trace$1 } from "@opentelemetry/api";
|
|
28
28
|
//#region src/baggage-span-processor.d.ts
|
|
29
29
|
interface BaggageSpanProcessorOptions {
|
|
30
30
|
/**
|
|
@@ -67,7 +67,7 @@ interface BaggageSpanProcessorOptions {
|
|
|
67
67
|
declare class BaggageSpanProcessor implements SpanProcessor {
|
|
68
68
|
private readonly prefix;
|
|
69
69
|
constructor(options?: BaggageSpanProcessorOptions);
|
|
70
|
-
onStart(span: Span$
|
|
70
|
+
onStart(span: Span$1, parentContext: Context$1): void;
|
|
71
71
|
onEnd(_span: ReadableSpan): void;
|
|
72
72
|
shutdown(): Promise<void>;
|
|
73
73
|
forceFlush(): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { B as markForceKept, D as AlwaysSampler, E as AdaptiveSampler, F as createLinkFromHeaders, H as samplingPresets, J as getEventQueue, L as extractLinksFromBatch, M as NeverSampler, N as RandomSampler, P as UserIdSampler, Q as getCorrelationId, S as AUTOTEL_DEBUG_BAGGAGE_KEY, T as AUTOTEL_SAMPLING_TAIL_KEEP, U as createTraceContext, V as resolveSamplingPreset, W as defineBaggageSchema, X as CORRELATION_ID_BAGGAGE_KEY, Y as track, Z as generateCorrelationId, a as init, b as BaggageSpanProcessor, c as lockLogger, d as Event, et as getOrCreateCorrelationId, f as getEvents, h as runInOperationContext, l as flush, m as getOperationContext, nt as setCorrelationId, o as isInitialized, p as resetEvents, rt as setCorrelationIdInBaggage, s as isLoggerLocked, tt as runWithCorrelationId, u as shutdown, w as AUTOTEL_SAMPLING_TAIL_EVALUATED, y as createStringRedactor } from "./init-8SISAGdE.js";
|
|
1
2
|
import { g as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord, x as toError } from "./values-xBtdXtjA.js";
|
|
2
3
|
import { getAutotelTracer, getAutotelTracerProvider, setAutotelTracerProvider } from "./tracer-provider.js";
|
|
3
4
|
import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-Y9y-1Pae.js";
|
|
4
|
-
import { B as markForceKept, D as AlwaysSampler, E as AdaptiveSampler, F as createLinkFromHeaders, H as samplingPresets, J as getEventQueue, L as extractLinksFromBatch, M as NeverSampler, N as RandomSampler, P as UserIdSampler, Q as getCorrelationId, S as AUTOTEL_DEBUG_BAGGAGE_KEY, T as AUTOTEL_SAMPLING_TAIL_KEEP, U as createTraceContext, V as resolveSamplingPreset, W as defineBaggageSchema, X as CORRELATION_ID_BAGGAGE_KEY, Y as track, Z as generateCorrelationId, a as init, b as BaggageSpanProcessor, c as lockLogger, d as Event, et as getOrCreateCorrelationId, f as getEvents, h as runInOperationContext, l as flush, m as getOperationContext, nt as setCorrelationId, o as isInitialized, p as resetEvents, rt as setCorrelationIdInBaggage, s as isLoggerLocked, tt as runWithCorrelationId, u as shutdown, w as AUTOTEL_SAMPLING_TAIL_EVALUATED, y as createStringRedactor } from "./init-Dyq6WtsO.js";
|
|
5
5
|
import { FilteringSpanProcessor } from "./filtering-span-processor.js";
|
|
6
6
|
import { NORMALIZER_PATTERNS, NORMALIZER_PRESETS, SpanNameNormalizingProcessor } from "./span-name-normalizer.js";
|
|
7
7
|
import { AttributeRedactingProcessor, REDACTOR_PATTERNS, REDACTOR_PRESETS, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig } from "./attribute-redacting-processor.js";
|
|
8
8
|
import { n as formatDuration } from "./canonical-log-line-processor-BQ6NeZAk.js";
|
|
9
9
|
import { Metric, getMetrics, resetMetrics } from "./metric.js";
|
|
10
|
-
import { a as span, c as withNewContext, i as requestCtx, l as withTracing, n as getActiveTraceContext, o as trace$2, r as instrument, s as withBaggage, t as ctx } from "./functional-
|
|
10
|
+
import { a as span, c as withNewContext, i as requestCtx, l as withTracing, n as getActiveTraceContext, o as trace$2, r as instrument, s as withBaggage, t as ctx } from "./functional-CC2BFGAO.js";
|
|
11
11
|
import { createDeterministicTraceId, enrichWithTraceContext, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTraceContext, getTracer, isTracing, resolveTraceUrl, runWithSpan } from "./trace-helpers.js";
|
|
12
12
|
import { t as hashJson } from "./stable-hash-AOUgw1DW.js";
|
|
13
13
|
import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
|
|
@@ -17,7 +17,7 @@ import { createCounter, createHistogram, createObservableGauge, createUpDownCoun
|
|
|
17
17
|
import { traceDB, traceHTTP, traceMessaging } from "./semantic-helpers.js";
|
|
18
18
|
import { C as URLAttributes, d as HTTPAttributes, y as ServiceAttributes } from "./registry-Cy4JjIB-.js";
|
|
19
19
|
import { httpRequestHeaderAttribute, httpResponseHeaderAttribute } from "./semantic-conventions.js";
|
|
20
|
-
import { a as identify, c as setDevice, d as setSession, f as setUser, h as autoRedactPII, i as httpServer, l as setError, m as safeSetAttributes, n as dbClient, o as mergeServiceResource, p as mergeAttrs, r as httpClient, s as request, u as setException, v as validateAttribute, y as attrs } from "./attributes-
|
|
20
|
+
import { a as identify, c as setDevice, d as setSession, f as setUser, h as autoRedactPII, i as httpServer, l as setError, m as safeSetAttributes, n as dbClient, o as mergeServiceResource, p as mergeAttrs, r as httpClient, s as request, u as setException, v as validateAttribute, y as attrs } from "./attributes-CuGx6cOI.js";
|
|
21
21
|
import { traceConsumer, traceProducer } from "./messaging.js";
|
|
22
22
|
import { BusinessBaggage, createSafeBaggageSchema } from "./business-baggage.js";
|
|
23
23
|
import { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from "./workflow.js";
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./rolldown-runtime-
|
|
2
|
-
const require_values = require('./values-
|
|
1
|
+
const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
|
|
2
|
+
const require_values = require('./values-AxGpgYBA.cjs');
|
|
3
3
|
const require_tracer_provider = require('./tracer-provider.cjs');
|
|
4
4
|
const require_config = require('./config.cjs');
|
|
5
|
-
const require_structured_error = require('./structured-error-
|
|
6
|
-
const require_node_require = require('./node-require-
|
|
5
|
+
const require_structured_error = require('./structured-error-DynjWTTu.cjs');
|
|
6
|
+
const require_node_require = require('./node-require-BPsB09eC.cjs');
|
|
7
7
|
const require_filtering_span_processor = require('./filtering-span-processor.cjs');
|
|
8
8
|
const require_policy = require('./policy.cjs');
|
|
9
9
|
const require_span_name_normalizer = require('./span-name-normalizer.cjs');
|
|
10
10
|
const require_attribute_redacting_processor = require('./attribute-redacting-processor.cjs');
|
|
11
11
|
const require_pretty_console_exporter = require('./pretty-console-exporter-CMzlrRNg.cjs');
|
|
12
|
-
const require_canonical_log_line_processor = require('./canonical-log-line-processor-
|
|
12
|
+
const require_canonical_log_line_processor = require('./canonical-log-line-processor-BU03jJeA.cjs');
|
|
13
13
|
const require_metric = require('./metric.cjs');
|
|
14
|
-
let
|
|
15
|
-
let
|
|
14
|
+
let _opentelemetry_api = require("@opentelemetry/api");
|
|
15
|
+
let _opentelemetry_api_logs = require("@opentelemetry/api-logs");
|
|
16
|
+
let _opentelemetry_context_async_hooks = require("@opentelemetry/context-async-hooks");
|
|
17
|
+
let _opentelemetry_core = require("@opentelemetry/core");
|
|
18
|
+
let _opentelemetry_instrumentation = require("@opentelemetry/instrumentation");
|
|
16
19
|
let _opentelemetry_resources = require("@opentelemetry/resources");
|
|
20
|
+
let _opentelemetry_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
21
|
+
let _opentelemetry_sdk_logs = require("@opentelemetry/sdk-logs");
|
|
22
|
+
let _opentelemetry_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
23
|
+
let _opentelemetry_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
17
24
|
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
18
|
-
let _opentelemetry_api = require("@opentelemetry/api");
|
|
19
25
|
let node_async_hooks = require("node:async_hooks");
|
|
20
26
|
node_async_hooks = require_rolldown_runtime.__toESM(node_async_hooks, 1);
|
|
21
|
-
let _opentelemetry_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
22
|
-
let _opentelemetry_sdk_logs = require("@opentelemetry/sdk-logs");
|
|
23
27
|
let node_fs = require("node:fs");
|
|
24
28
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
25
29
|
let node_path = require("node:path");
|
|
@@ -27,8 +31,153 @@ node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
|
27
31
|
let node_os = require("node:os");
|
|
28
32
|
let _opentelemetry_exporter_metrics_otlp_http = require("@opentelemetry/exporter-metrics-otlp-http");
|
|
29
33
|
let _opentelemetry_exporter_trace_otlp_http = require("@opentelemetry/exporter-trace-otlp-http");
|
|
30
|
-
let _opentelemetry_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
31
34
|
|
|
35
|
+
//#region src/sdk.ts
|
|
36
|
+
/**
|
|
37
|
+
* The SDK behind `init()`: builds and registers the tracer, meter and logger
|
|
38
|
+
* providers from components autotel has already resolved.
|
|
39
|
+
*
|
|
40
|
+
* This replaces `@opentelemetry/sdk-node`'s `NodeSDK`. That class did the same
|
|
41
|
+
* registration, but it statically imports every exporter the `OTEL_*_EXPORTER`
|
|
42
|
+
* variables could name — OTLP over gRPC (`@grpc/grpc-js`, `protobufjs`),
|
|
43
|
+
* Prometheus, the YAML file-config loader — so any bundle that contained
|
|
44
|
+
* `init()` shipped ~1 MB of exporters it never used. autotel resolves its own
|
|
45
|
+
* exporters up front, so all it ever needed from `NodeSDK` was `start()`.
|
|
46
|
+
*
|
|
47
|
+
* Kept from `NodeSDK`, because code and tests rely on them:
|
|
48
|
+
* - `OTEL_SDK_DISABLED=true` makes `start()` a no-op.
|
|
49
|
+
* - `OTEL_LOG_LEVEL` installs the console diag logger.
|
|
50
|
+
* - Resource: `envDetector`, `processDetector` and `hostDetector` are merged
|
|
51
|
+
* in, then `serviceName` is applied last so the resolved autotel value
|
|
52
|
+
* wins (`OTEL_NODE_RESOURCE_DETECTORS=none` turns detection off).
|
|
53
|
+
* - Context manager: `AsyncLocalStorageContextManager`.
|
|
54
|
+
* - Propagator: W3C trace context + baggage, or `OTEL_PROPAGATORS`.
|
|
55
|
+
* - Providers are only registered when they have something to do; an empty
|
|
56
|
+
* `spanProcessors` list still registers a tracer provider, so context keeps
|
|
57
|
+
* propagating even when nothing is exported.
|
|
58
|
+
*
|
|
59
|
+
* Not kept: building an exporter from `OTEL_TRACES_EXPORTER` /
|
|
60
|
+
* `OTEL_LOGS_EXPORTER` / `OTEL_METRICS_EXPORTER`. autotel always passes its own
|
|
61
|
+
* processors, so the traces and metrics variables never reached `NodeSDK`
|
|
62
|
+
* anyway; `OTEL_LOGS_EXPORTER=none` still switches logs off, and `otlp` gets
|
|
63
|
+
* the OTLP/HTTP log exporter. gRPC and Prometheus are no longer reachable from
|
|
64
|
+
* the environment — pass an exporter through `init()` instead.
|
|
65
|
+
*/
|
|
66
|
+
const DIAG_LEVELS = {
|
|
67
|
+
ALL: _opentelemetry_api.DiagLogLevel.ALL,
|
|
68
|
+
VERBOSE: _opentelemetry_api.DiagLogLevel.VERBOSE,
|
|
69
|
+
DEBUG: _opentelemetry_api.DiagLogLevel.DEBUG,
|
|
70
|
+
INFO: _opentelemetry_api.DiagLogLevel.INFO,
|
|
71
|
+
WARN: _opentelemetry_api.DiagLogLevel.WARN,
|
|
72
|
+
ERROR: _opentelemetry_api.DiagLogLevel.ERROR,
|
|
73
|
+
NONE: _opentelemetry_api.DiagLogLevel.NONE
|
|
74
|
+
};
|
|
75
|
+
function envFlag(name) {
|
|
76
|
+
return (process.env[name] ?? "").trim().toLowerCase() === "true";
|
|
77
|
+
}
|
|
78
|
+
function propagatorFromEnv() {
|
|
79
|
+
const raw = process.env.OTEL_PROPAGATORS?.trim();
|
|
80
|
+
if (!raw) return void 0;
|
|
81
|
+
const names = raw.split(",").map((n) => n.trim().toLowerCase()).filter(Boolean);
|
|
82
|
+
if (names.includes("none")) return new _opentelemetry_core.CompositePropagator({ propagators: [] });
|
|
83
|
+
const propagators = [];
|
|
84
|
+
for (const name of names) if (name === "tracecontext") propagators.push(new _opentelemetry_core.W3CTraceContextPropagator());
|
|
85
|
+
else if (name === "baggage") propagators.push(new _opentelemetry_core.W3CBaggagePropagator());
|
|
86
|
+
else _opentelemetry_api.diag.warn(`[autotel] OTEL_PROPAGATORS names "${name}", which needs a propagator package autotel does not bundle; pass one via init({ propagator }).`);
|
|
87
|
+
return propagators.length > 0 ? new _opentelemetry_core.CompositePropagator({ propagators }) : void 0;
|
|
88
|
+
}
|
|
89
|
+
function defaultPropagator() {
|
|
90
|
+
return new _opentelemetry_core.CompositePropagator({ propagators: [new _opentelemetry_core.W3CTraceContextPropagator(), new _opentelemetry_core.W3CBaggagePropagator()] });
|
|
91
|
+
}
|
|
92
|
+
var AutotelSdk = class {
|
|
93
|
+
options;
|
|
94
|
+
disabled;
|
|
95
|
+
tracerProvider;
|
|
96
|
+
meterProvider;
|
|
97
|
+
loggerProvider;
|
|
98
|
+
constructor(options = {}) {
|
|
99
|
+
this.options = options;
|
|
100
|
+
this.disabled = envFlag("OTEL_SDK_DISABLED");
|
|
101
|
+
const level = process.env.OTEL_LOG_LEVEL?.trim().toUpperCase();
|
|
102
|
+
if (level && DIAG_LEVELS[level] !== void 0) _opentelemetry_api.diag.setLogger(new _opentelemetry_api.DiagConsoleLogger(), { logLevel: DIAG_LEVELS[level] });
|
|
103
|
+
}
|
|
104
|
+
start() {
|
|
105
|
+
if (this.disabled) return;
|
|
106
|
+
const o = this.options;
|
|
107
|
+
const instrumentations = (o.instrumentations ?? []).flat();
|
|
108
|
+
(0, _opentelemetry_instrumentation.registerInstrumentations)({ instrumentations });
|
|
109
|
+
_opentelemetry_api.context.setGlobalContextManager(new _opentelemetry_context_async_hooks.AsyncLocalStorageContextManager().enable());
|
|
110
|
+
if (o.textMapPropagator !== null) _opentelemetry_api.propagation.setGlobalPropagator(o.textMapPropagator ?? propagatorFromEnv() ?? defaultPropagator());
|
|
111
|
+
const resource = this.resolveResource();
|
|
112
|
+
if (o.metricReaders && o.metricReaders.length > 0) {
|
|
113
|
+
this.meterProvider = new _opentelemetry_sdk_metrics.MeterProvider({
|
|
114
|
+
resource,
|
|
115
|
+
readers: o.metricReaders
|
|
116
|
+
});
|
|
117
|
+
_opentelemetry_api.metrics.setGlobalMeterProvider(this.meterProvider);
|
|
118
|
+
for (const instrumentation of instrumentations) instrumentation.setMeterProvider(this.meterProvider);
|
|
119
|
+
}
|
|
120
|
+
this.tracerProvider = new _opentelemetry_sdk_trace_base.BasicTracerProvider({
|
|
121
|
+
resource,
|
|
122
|
+
spanProcessors: o.spanProcessors ?? [],
|
|
123
|
+
...o.sampler && { sampler: o.sampler }
|
|
124
|
+
});
|
|
125
|
+
_opentelemetry_api.trace.setGlobalTracerProvider(this.tracerProvider);
|
|
126
|
+
const logProcessors = this.resolveLogProcessors();
|
|
127
|
+
if (logProcessors) {
|
|
128
|
+
this.loggerProvider = new _opentelemetry_sdk_logs.LoggerProvider({
|
|
129
|
+
resource,
|
|
130
|
+
processors: logProcessors
|
|
131
|
+
});
|
|
132
|
+
_opentelemetry_api_logs.logs.setGlobalLoggerProvider(this.loggerProvider);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
getTracerProvider() {
|
|
136
|
+
return this.tracerProvider;
|
|
137
|
+
}
|
|
138
|
+
async shutdown() {
|
|
139
|
+
await Promise.allSettled([
|
|
140
|
+
this.tracerProvider?.forceFlush(),
|
|
141
|
+
this.loggerProvider?.forceFlush(),
|
|
142
|
+
this.meterProvider?.forceFlush()
|
|
143
|
+
]);
|
|
144
|
+
await Promise.all([
|
|
145
|
+
this.tracerProvider?.shutdown(),
|
|
146
|
+
this.loggerProvider?.shutdown(),
|
|
147
|
+
this.meterProvider?.shutdown()
|
|
148
|
+
]);
|
|
149
|
+
}
|
|
150
|
+
resolveResource() {
|
|
151
|
+
const o = this.options;
|
|
152
|
+
let resource = o.resource ?? (0, _opentelemetry_resources.resourceFromAttributes)({});
|
|
153
|
+
const detectorsEnv = process.env.OTEL_NODE_RESOURCE_DETECTORS?.trim();
|
|
154
|
+
if (o.autoDetectResources ?? detectorsEnv?.toLowerCase() !== "none") {
|
|
155
|
+
const detectors = o.resourceDetectors ?? [
|
|
156
|
+
_opentelemetry_resources.envDetector,
|
|
157
|
+
_opentelemetry_resources.processDetector,
|
|
158
|
+
_opentelemetry_resources.hostDetector
|
|
159
|
+
];
|
|
160
|
+
resource = resource.merge((0, _opentelemetry_resources.detectResources)({ detectors }));
|
|
161
|
+
}
|
|
162
|
+
if (o.serviceName !== void 0) resource = resource.merge((0, _opentelemetry_resources.resourceFromAttributes)({ [_opentelemetry_semantic_conventions.ATTR_SERVICE_NAME]: o.serviceName }));
|
|
163
|
+
return resource;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* `init()` passes a list when it configured logs itself and `undefined` to
|
|
167
|
+
* defer to `OTEL_LOGS_EXPORTER`. Only `otlp` (over HTTP) and `none`/unset
|
|
168
|
+
* are honoured there; any other value is named in a warning.
|
|
169
|
+
*/
|
|
170
|
+
resolveLogProcessors() {
|
|
171
|
+
const configured = this.options.logRecordProcessors;
|
|
172
|
+
if (configured) return configured;
|
|
173
|
+
const fromEnv = process.env.OTEL_LOGS_EXPORTER?.trim().toLowerCase();
|
|
174
|
+
if (!fromEnv || fromEnv === "none") return void 0;
|
|
175
|
+
if (fromEnv === "otlp") return [new _opentelemetry_sdk_logs.BatchLogRecordProcessor({ exporter: new _opentelemetry_exporter_logs_otlp_http.OTLPLogExporter() })];
|
|
176
|
+
_opentelemetry_api.diag.warn(`[autotel] OTEL_LOGS_EXPORTER=${fromEnv} is not supported without sdk-node; pass a log exporter via init() instead.`);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
//#endregion
|
|
32
181
|
//#region src/rate-limiter.ts
|
|
33
182
|
/**
|
|
34
183
|
* Token bucket rate limiter
|
|
@@ -514,28 +663,30 @@ var EventQueue = class {
|
|
|
514
663
|
*/
|
|
515
664
|
async sendWithRetry(events, retriesLeft, subscribersByEventIndex) {
|
|
516
665
|
const failedDeliveries = await this.sendToSubscribers(events, subscribersByEventIndex);
|
|
517
|
-
if (failedDeliveries.length > 0)
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
|
|
666
|
+
if (failedDeliveries.length > 0) {
|
|
667
|
+
if (retriesLeft > 0) {
|
|
668
|
+
const failedEventIndicesOrdered = [...new Set(failedDeliveries.map((f) => f.eventIndex))].toSorted((a, b) => a - b);
|
|
669
|
+
const eventsToRetry = failedEventIndicesOrdered.map((i) => events[i]);
|
|
670
|
+
const failedSubscribersByRetryIndex = /* @__PURE__ */ new Map();
|
|
671
|
+
for (const [j, origIndex] of failedEventIndicesOrdered.entries()) {
|
|
672
|
+
const set = /* @__PURE__ */ new Set();
|
|
673
|
+
for (const { eventIndex, subscriberName } of failedDeliveries) if (eventIndex === origIndex) set.add(subscriberName);
|
|
674
|
+
failedSubscribersByRetryIndex.set(j, set);
|
|
675
|
+
}
|
|
676
|
+
const delay = Math.pow(2, this.config.maxRetries - retriesLeft) * 1e3;
|
|
677
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
678
|
+
return this.sendWithRetry(eventsToRetry, retriesLeft - 1, failedSubscribersByRetryIndex);
|
|
679
|
+
} else {
|
|
680
|
+
for (const { eventIndex, subscriberName, error } of failedDeliveries) {
|
|
681
|
+
const event = events[eventIndex];
|
|
682
|
+
if (event) this.recordFailed(event, subscriberName, error);
|
|
683
|
+
}
|
|
684
|
+
const failedSubscriberNames = [...new Set(failedDeliveries.map((f) => f.subscriberName))];
|
|
685
|
+
getLogger().error({
|
|
686
|
+
failedSubscribers: failedSubscriberNames,
|
|
687
|
+
retriesAttempted: this.config.maxRetries
|
|
688
|
+
}, "[autotel] Failed to send events after retries");
|
|
533
689
|
}
|
|
534
|
-
const failedSubscriberNames = [...new Set(failedDeliveries.map((f) => f.subscriberName))];
|
|
535
|
-
getLogger().error({
|
|
536
|
-
failedSubscribers: failedSubscriberNames,
|
|
537
|
-
retriesAttempted: this.config.maxRetries
|
|
538
|
-
}, "[autotel] Failed to send events after retries");
|
|
539
690
|
}
|
|
540
691
|
}
|
|
541
692
|
/**
|
|
@@ -892,7 +1043,8 @@ function getOrCreateQueue() {
|
|
|
892
1043
|
function track(event, data, options) {
|
|
893
1044
|
const queue = getOrCreateQueue();
|
|
894
1045
|
if (!queue) return;
|
|
895
|
-
const
|
|
1046
|
+
const validationConfig = getValidationConfig();
|
|
1047
|
+
const validated = validateEvent(event, data, validationConfig || void 0);
|
|
896
1048
|
const span = _opentelemetry_api.trace.getActiveSpan();
|
|
897
1049
|
const enrichedData = span ? {
|
|
898
1050
|
...validated.attributes,
|
|
@@ -2994,7 +3146,8 @@ var Event = class {
|
|
|
2994
3146
|
* ```
|
|
2995
3147
|
*/
|
|
2996
3148
|
trackEvent(eventName, attributes) {
|
|
2997
|
-
const
|
|
3149
|
+
const validationConfig = getValidationConfig();
|
|
3150
|
+
const validated = validateEvent(eventName, attributes, validationConfig || void 0);
|
|
2998
3151
|
const enrichedAttributes = this.enrichWithTelemetryContext(validated.attributes);
|
|
2999
3152
|
this.logger?.info({
|
|
3000
3153
|
event: validated.eventName,
|
|
@@ -4056,7 +4209,8 @@ function init(cfg) {
|
|
|
4056
4209
|
if (devtoolsConfig.enabled && mergedConfig.logs === void 0) mergedConfig.logs = true;
|
|
4057
4210
|
const silent = mergedConfig.silent ?? false;
|
|
4058
4211
|
const minLevel = mergedConfig.minLevel ?? "info";
|
|
4059
|
-
|
|
4212
|
+
const baseLogger = mergedConfig.logger || silentLogger;
|
|
4213
|
+
logger = wrapLogger(baseLogger, silent, minLevel);
|
|
4060
4214
|
if (initialized) logger.warn({}, "[autotel] init() called again - last config wins. This may cause unexpected behavior.");
|
|
4061
4215
|
config = mergedConfig;
|
|
4062
4216
|
validationConfig = mergedConfig.validation || null;
|
|
@@ -4169,10 +4323,11 @@ function init(cfg) {
|
|
|
4169
4323
|
if (logsEnabled) {
|
|
4170
4324
|
for (const destination of otlpDestinations) {
|
|
4171
4325
|
if (!destinationSupportsSignal(destination, "logs")) continue;
|
|
4172
|
-
|
|
4326
|
+
const logExporter = createLogExporter(destination.protocol, {
|
|
4173
4327
|
url: formatEndpointUrl(destination.endpoint, "logs", destination.protocol),
|
|
4174
4328
|
headers: destination.headers
|
|
4175
|
-
})
|
|
4329
|
+
});
|
|
4330
|
+
let processor = new _opentelemetry_sdk_logs.BatchLogRecordProcessor({ exporter: logExporter });
|
|
4176
4331
|
if (_stringRedactor) processor = new RedactingLogRecordProcessor(processor, _stringRedactor);
|
|
4177
4332
|
if (!logRecordProcessors) logRecordProcessors = [];
|
|
4178
4333
|
logRecordProcessors.push(processor);
|
|
@@ -4214,8 +4369,8 @@ function init(cfg) {
|
|
|
4214
4369
|
if (metricReaders.length > 0) sdkOptions.metricReaders = metricReaders;
|
|
4215
4370
|
if (logRecordProcessors && logRecordProcessors.length > 0) sdkOptions.logRecordProcessors = logRecordProcessors;
|
|
4216
4371
|
else if (!process.env.OTEL_LOGS_EXPORTER) sdkOptions.logRecordProcessors = [];
|
|
4217
|
-
sdk = mergedConfig.sdkFactory ? mergedConfig.sdkFactory(sdkOptions) : new
|
|
4218
|
-
if (!sdk) throw new Error("[autotel] sdkFactory must return
|
|
4372
|
+
sdk = mergedConfig.sdkFactory ? mergedConfig.sdkFactory(sdkOptions) : new AutotelSdk(sdkOptions);
|
|
4373
|
+
if (!sdk) throw new Error("[autotel] sdkFactory must return an SDK instance");
|
|
4219
4374
|
sdk.start();
|
|
4220
4375
|
if (mergedConfig.openllmetry?.enabled) {
|
|
4221
4376
|
const traceloop = _optionalRequire("@traceloop/node-server-sdk");
|