autotel 7.6.1 → 7.7.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/NOTICE +9 -0
- package/dist/attribute-redacting-processor.cjs +1 -1
- package/dist/attribute-redacting-processor.js +1 -1
- package/dist/{attributes-DQQl-D6Q.js → attributes-De9Fx0b4.js} +1 -1
- package/dist/{attributes-DnfoMlA9.cjs → attributes-DkptT2Ck.cjs} +1 -1
- package/dist/attributes.cjs +1 -1
- package/dist/attributes.d.cts +1 -1
- package/dist/attributes.d.ts +1 -1
- package/dist/attributes.js +1 -1
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/business-baggage.cjs +1 -1
- package/dist/business-baggage.d.cts +1 -1
- package/dist/business-baggage.d.ts +1 -1
- package/dist/business-baggage.js +1 -1
- package/dist/{canonical-log-line-processor-CBv-OCp4.js → canonical-log-line-processor-BQ6NeZAk.js} +1 -1
- package/dist/{canonical-log-line-processor-B-tzezhk.cjs → canonical-log-line-processor-Bvgb1lE4.cjs} +1 -1
- package/dist/{correlated-events-CcuknWnU.cjs → correlated-events-9RRdfyWR.cjs} +1 -1
- package/dist/{correlated-events-DwMMbItg.js → correlated-events-BfpH5uS-.js} +1 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/db.cjs +1 -1
- package/dist/db.js +1 -1
- package/dist/decorators.cjs +2 -2
- package/dist/decorators.d.cts +2 -2
- package/dist/decorators.d.ts +2 -2
- package/dist/decorators.js +2 -2
- package/dist/diagnostics.cjs +2 -2
- package/dist/diagnostics.js +2 -2
- package/dist/event.cjs +1 -1
- package/dist/event.js +1 -1
- package/dist/exception-fingerprint.cjs +1 -1
- package/dist/exception-fingerprint.js +1 -1
- package/dist/{functional-CgWcRXGX.d.cts → functional-C4mjgtJb.d.cts} +25 -2
- package/dist/{functional-zasLBPyX.cjs → functional-CJI0HCVJ.cjs} +113 -23
- package/dist/{functional-BXgTFVTA.js → functional-Cnga_Lnv.js} +109 -25
- package/dist/{functional-RFFpQzAV.d.ts → functional-DN_ztd9C.d.ts} +25 -2
- package/dist/functional.cjs +2 -1
- package/dist/functional.d.cts +3 -3
- package/dist/functional.d.ts +3 -3
- package/dist/functional.js +2 -2
- package/dist/http.cjs +2 -2
- package/dist/http.js +2 -2
- package/dist/{index-Y7If_wH4.d.cts → index-8bFU4kmd.d.cts} +1 -1
- package/dist/{index-CsoeCsGL.d.ts → index-o_6YjZhV.d.ts} +1 -1
- package/dist/index.cjs +9 -8
- package/dist/index.d.cts +14 -5
- package/dist/index.d.ts +14 -5
- package/dist/index.js +9 -9
- package/dist/{init-OSYC19sK.cjs → init-BYXDCfRL.cjs} +60 -23
- package/dist/{init-BHV2gWsV.d.ts → init-CKSMbJUG.d.ts} +17 -1
- package/dist/{init-Bst_BhiS.js → init-Dyq6WtsO.js} +60 -23
- package/dist/{init-DxmeJ3d0.d.cts → init-WwjD-kQu.d.cts} +17 -1
- package/dist/instrumentation.cjs +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{logger-DdPp__xW.js → logger-B2VPcBgZ.js} +1 -1
- package/dist/{logger-Sm66cjKl.cjs → logger-CSdZkxbh.cjs} +1 -1
- package/dist/logger.cjs +1 -1
- package/dist/logger.js +1 -1
- package/dist/messaging-adapters.cjs +1 -1
- package/dist/messaging-adapters.js +1 -1
- package/dist/messaging.cjs +4 -4
- package/dist/messaging.d.cts +1 -1
- package/dist/messaging.d.ts +1 -1
- package/dist/messaging.js +4 -4
- package/dist/{node-require-EifOMikz.cjs → node-require-B_IVapV3.cjs} +1 -1
- package/dist/{node-require-DSPjaw_l.js → node-require-CkK_xzL-.js} +1 -1
- package/dist/parse-error.cjs +1 -1
- package/dist/parse-error.js +1 -1
- package/dist/policy.cjs +0 -0
- package/dist/policy.js +0 -0
- package/dist/processors.cjs +1 -1
- package/dist/processors.js +1 -1
- package/dist/sampling.cjs +1 -1
- package/dist/sampling.js +1 -1
- package/dist/semantic-helpers.cjs +2 -2
- package/dist/semantic-helpers.d.cts +1 -1
- package/dist/semantic-helpers.d.ts +1 -1
- package/dist/semantic-helpers.js +2 -2
- package/dist/{stable-hash-BkoAYVks.js → stable-hash-AOUgw1DW.js} +1 -1
- package/dist/{stable-hash-C0pOegH_.cjs → stable-hash-C9F6xjzx.cjs} +1 -1
- package/dist/{structured-error--_wXpd_C.cjs → structured-error-BAXhglRE.cjs} +48 -24
- package/dist/{structured-error-YIuka-FE.js → structured-error-Y9y-1Pae.js} +48 -24
- package/dist/tail-sampling-processor.cjs +1 -1
- package/dist/tail-sampling-processor.js +1 -1
- package/dist/test-span-collector.cjs +1 -1
- package/dist/test-span-collector.js +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +1 -1
- package/dist/{trace-context-f89xPJbK.d.ts → trace-context-CqCblIQE.d.ts} +12 -5
- package/dist/{trace-context-C1Cn1q0y.d.cts → trace-context-f7Xq0Q2q.d.cts} +12 -5
- package/dist/trace-helpers.cjs +6 -6
- package/dist/trace-helpers.js +6 -6
- package/dist/tracer-provider.cjs +1 -1
- package/dist/tracer-provider.js +1 -1
- package/dist/validate.cjs +3 -3
- package/dist/validate.js +3 -3
- package/dist/{values-DApyq53y.cjs → values-tm4bi0FF.cjs} +12 -2
- package/dist/{values-BenyvWKz.js → values-xBtdXtjA.js} +11 -1
- package/dist/webhook.cjs +3 -3
- package/dist/webhook.d.cts +1 -1
- package/dist/webhook.d.ts +1 -1
- package/dist/webhook.js +3 -3
- package/dist/workflow-distributed.cjs +3 -3
- package/dist/workflow-distributed.d.cts +1 -1
- package/dist/workflow-distributed.d.ts +1 -1
- package/dist/workflow-distributed.js +3 -3
- package/dist/workflow.cjs +3 -3
- package/dist/workflow.d.cts +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.js +3 -3
- 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 +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TraceContext } from "./trace-context-
|
|
1
|
+
import { n as TraceContext } from "./trace-context-CqCblIQE.js";
|
|
2
2
|
import { m as Sampler } from "./sampling-DBng4Foa.js";
|
|
3
3
|
import { Attributes, Span, SpanKind } from "@opentelemetry/api";
|
|
4
4
|
//#region src/functional-wrapper.d.ts
|
|
@@ -144,6 +144,29 @@ type BaggageValues = Record<string, string | number | boolean>;
|
|
|
144
144
|
*/
|
|
145
145
|
declare function getActiveTraceContext<TBaggage extends BaggageValues | undefined = undefined>(): TraceContext<TBaggage> | undefined;
|
|
146
146
|
declare const ctx: TraceContext;
|
|
147
|
+
/**
|
|
148
|
+
* The ambient {@link ctx}, aimed at the **request** span rather than at
|
|
149
|
+
* whatever span the calling code happens to be inside.
|
|
150
|
+
*
|
|
151
|
+
* Framework instrumentation nests spans per layer - express opens one per
|
|
152
|
+
* middleware and per route handler - so `ctx.setAttribute()` from a shared
|
|
153
|
+
* middleware records on a span that ends the moment `next()` fires. Attributes
|
|
154
|
+
* that describe the request as a whole (the authenticated user, the tenant, the
|
|
155
|
+
* plan) belong on the request span, which is what a backend shows as the
|
|
156
|
+
* resource and what a canonical log line is built from.
|
|
157
|
+
*
|
|
158
|
+
* Falls back to the active span outside a request, and no-ops when nothing is
|
|
159
|
+
* active at all, exactly as `ctx` does.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* app.use((req, _res, next) => {
|
|
164
|
+
* requestCtx.setAttributes({ user: req.user }); // user.id, user.plan, ...
|
|
165
|
+
* next();
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
declare const requestCtx: TraceContext;
|
|
147
170
|
/**
|
|
148
171
|
* Wrap a plain function with a traced wrapper, or run one named operation
|
|
149
172
|
* immediately with {@link trace.run}.
|
|
@@ -450,4 +473,4 @@ interface WithBaggageOptions<T = unknown> {
|
|
|
450
473
|
*/
|
|
451
474
|
declare function withBaggage<T = unknown>(options: WithBaggageOptions<T>): T | Promise<T>;
|
|
452
475
|
//#endregion
|
|
453
|
-
export { getActiveTraceContext as a,
|
|
476
|
+
export { getActiveTraceContext as a, span as c, withNewContext as d, withTracing as f, TracingOptions as h, ctx as i, trace$1 as l, SingleInstrumentOptions as m, WithBaggageOptions as n, instrument as o, InstrumentOptions as p, WithNewContextOptions as r, requestCtx as s, SpanOptions as t, withBaggage as u };
|
package/dist/functional.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_functional = require('./functional-
|
|
2
|
+
const require_functional = require('./functional-CJI0HCVJ.cjs');
|
|
3
3
|
|
|
4
4
|
exports.ctx = require_functional.ctx;
|
|
5
5
|
exports.getActiveTraceContext = require_functional.getActiveTraceContext;
|
|
6
6
|
exports.instrument = require_functional.instrument;
|
|
7
|
+
exports.requestCtx = require_functional.requestCtx;
|
|
7
8
|
exports.span = require_functional.span;
|
|
8
9
|
exports.trace = require_functional.trace;
|
|
9
10
|
exports.withBaggage = require_functional.withBaggage;
|
package/dist/functional.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as TraceContext } from "./trace-context-
|
|
2
|
-
import { a as getActiveTraceContext, c as
|
|
3
|
-
export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, span, trace, withBaggage, withNewContext, withTracing };
|
|
1
|
+
import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
|
|
2
|
+
import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, h as TracingOptions, i as ctx, l as trace, 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-C4mjgtJb.cjs";
|
|
3
|
+
export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
|
package/dist/functional.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as TraceContext } from "./trace-context-
|
|
2
|
-
import { a as getActiveTraceContext, c as
|
|
3
|
-
export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, span, trace, withBaggage, withNewContext, withTracing };
|
|
1
|
+
import { n as TraceContext } from "./trace-context-CqCblIQE.js";
|
|
2
|
+
import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, h as TracingOptions, i as ctx, l as trace, 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-DN_ztd9C.js";
|
|
3
|
+
export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
|
package/dist/functional.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as span, c as withNewContext, i as requestCtx, l as withTracing, n as getActiveTraceContext, o as trace, r as instrument, s as withBaggage, t as ctx } from "./functional-Cnga_Lnv.js";
|
|
2
2
|
|
|
3
|
-
export { ctx, getActiveTraceContext, instrument, span, trace, withBaggage, withNewContext, withTracing };
|
|
3
|
+
export { ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
|
package/dist/http.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_values = require('./values-
|
|
2
|
+
const require_values = require('./values-tm4bi0FF.cjs');
|
|
3
3
|
const require_config = require('./config.cjs');
|
|
4
|
-
const require_init = require('./init-
|
|
4
|
+
const require_init = require('./init-BYXDCfRL.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
6
6
|
|
|
7
7
|
//#region src/http.ts
|
package/dist/http.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as readProperty, h as isFunction, i as asNumber, l as asString } from "./values-
|
|
1
|
+
import { _ as readProperty, h as isFunction, i as asNumber, l as asString } from "./values-xBtdXtjA.js";
|
|
2
2
|
import { getConfig } from "./config.js";
|
|
3
|
-
import { G as getActiveContextWithBaggage } from "./init-
|
|
3
|
+
import { G as getActiveContextWithBaggage } from "./init-Dyq6WtsO.js";
|
|
4
4
|
import { SpanStatusCode, context, propagation } from "@opentelemetry/api";
|
|
5
5
|
|
|
6
6
|
//#region src/http.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TraceContext, t as AttributeValue$1 } from "./trace-context-
|
|
1
|
+
import { n as TraceContext, t as AttributeValue$1 } from "./trace-context-f7Xq0Q2q.cjs";
|
|
2
2
|
import { AttributeValue, Attributes, Span } from "@opentelemetry/api";
|
|
3
3
|
import { Resource } from "@opentelemetry/resources";
|
|
4
4
|
//#region src/attributes/types.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TraceContext, t as AttributeValue$1 } from "./trace-context-
|
|
1
|
+
import { n as TraceContext, t as AttributeValue$1 } from "./trace-context-CqCblIQE.js";
|
|
2
2
|
import { Resource } from "@opentelemetry/resources";
|
|
3
3
|
import { AttributeValue, Attributes, Span } from "@opentelemetry/api";
|
|
4
4
|
//#region src/attributes/types.d.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
3
|
-
const require_values = require('./values-
|
|
3
|
+
const require_values = require('./values-tm4bi0FF.cjs');
|
|
4
4
|
const require_tracer_provider = require('./tracer-provider.cjs');
|
|
5
|
-
const require_structured_error = require('./structured-error
|
|
6
|
-
const require_init = require('./init-
|
|
5
|
+
const require_structured_error = require('./structured-error-BAXhglRE.cjs');
|
|
6
|
+
const require_init = require('./init-BYXDCfRL.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-Bvgb1lE4.cjs');
|
|
11
11
|
const require_metric = require('./metric.cjs');
|
|
12
|
-
const require_functional = require('./functional-
|
|
12
|
+
const require_functional = require('./functional-CJI0HCVJ.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-C9F6xjzx.cjs');
|
|
15
|
+
const require_correlated_events = require('./correlated-events-9RRdfyWR.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
20
|
const require_registry = require('./registry-DIoklBz5.cjs');
|
|
21
21
|
const require_semantic_conventions = require('./semantic-conventions.cjs');
|
|
22
|
-
const require_attributes = require('./attributes-
|
|
22
|
+
const require_attributes = require('./attributes-DkptT2Ck.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');
|
|
@@ -684,6 +684,7 @@ Object.defineProperty(exports, 'propagation', {
|
|
|
684
684
|
});
|
|
685
685
|
exports.recordStructuredError = require_structured_error.recordStructuredError;
|
|
686
686
|
exports.request = require_attributes.request;
|
|
687
|
+
exports.requestCtx = require_functional.requestCtx;
|
|
687
688
|
exports.resetEvents = require_init.resetEvents;
|
|
688
689
|
exports.resetMetrics = require_metric.resetMetrics;
|
|
689
690
|
exports.resolveSamplingPreset = require_init.resolveSamplingPreset;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
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-CvBE0z1p.cjs";
|
|
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-
|
|
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-8bFU4kmd.cjs";
|
|
3
3
|
import { t as UnknownRecord } from "./values-CeMH-mYG.cjs";
|
|
4
|
-
import { n as TraceContext$1, r as defineBaggageSchema, t as AttributeValue$2 } from "./trace-context-
|
|
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
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-Er217Mge.cjs";
|
|
8
|
-
import { a as getActiveTraceContext, c as
|
|
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-C4mjgtJb.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-WwjD-kQu.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";
|
|
@@ -596,6 +596,10 @@ declare function defineAuditCatalog<const T extends Record<string, AuditCatalogE
|
|
|
596
596
|
* AttributeValue. Returns undefined when the value cannot be represented -
|
|
597
597
|
* which is how flattenToAttributes below learns it has an object to descend
|
|
598
598
|
* into rather than a leaf to record.
|
|
599
|
+
*
|
|
600
|
+
* Total by construction: this runs on whatever an application hands an
|
|
601
|
+
* attribute setter, so a value that cannot be read is a marker in the
|
|
602
|
+
* telemetry, never an exception on the request path.
|
|
599
603
|
*/
|
|
600
604
|
declare function toAttributeValue(value: unknown): AttributeValue$2 | undefined;
|
|
601
605
|
/** A flat, dot-notation attribute bag: what a nested object flattens to. */
|
|
@@ -605,6 +609,11 @@ interface FlatAttributes {
|
|
|
605
609
|
/**
|
|
606
610
|
* Recursively flatten a nested object into dot-notation OTel attributes.
|
|
607
611
|
* Includes circular reference protection via WeakSet.
|
|
612
|
+
*
|
|
613
|
+
* Every key is converted inside its own guard, so one value that cannot be read
|
|
614
|
+
* - a getter that throws, an exotic proxy, a `Map` whose key has no string form
|
|
615
|
+
* - costs that key alone and never the call. Keys are listed before their
|
|
616
|
+
* values are read, so a sibling of the bad value still lands.
|
|
608
617
|
*/
|
|
609
618
|
declare function flattenToAttributes(fields: UnknownRecord, prefix?: string): FlatAttributes;
|
|
610
619
|
//#endregion
|
|
@@ -672,4 +681,4 @@ declare function defineEnricher<TEvent extends UnknownRecord, TValue extends obj
|
|
|
672
681
|
*/
|
|
673
682
|
declare function formatDuration(ms: number): string;
|
|
674
683
|
//#endregion
|
|
675
|
-
export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type ExperimentOptions, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
|
|
684
|
+
export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type ExperimentOptions, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, requestCtx, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
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-CvBE0z1p.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-
|
|
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-o_6YjZhV.js";
|
|
3
3
|
import { t as UnknownRecord } from "./values-CeMH-mYG.js";
|
|
4
|
-
import { n as TraceContext$1, r as defineBaggageSchema, t as AttributeValue$2 } from "./trace-context-
|
|
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
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-DBng4Foa.js";
|
|
8
|
-
import { a as getActiveTraceContext, c as
|
|
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-DN_ztd9C.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
12
|
import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-BpDagWNa.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-
|
|
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-CKSMbJUG.js";
|
|
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.js";
|
|
15
15
|
import "./canonical-log-line-processor-Yq4cXcD5.js";
|
|
16
16
|
import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-Bd8f8mST.js";
|
|
@@ -596,6 +596,10 @@ declare function defineAuditCatalog<const T extends Record<string, AuditCatalogE
|
|
|
596
596
|
* AttributeValue. Returns undefined when the value cannot be represented -
|
|
597
597
|
* which is how flattenToAttributes below learns it has an object to descend
|
|
598
598
|
* into rather than a leaf to record.
|
|
599
|
+
*
|
|
600
|
+
* Total by construction: this runs on whatever an application hands an
|
|
601
|
+
* attribute setter, so a value that cannot be read is a marker in the
|
|
602
|
+
* telemetry, never an exception on the request path.
|
|
599
603
|
*/
|
|
600
604
|
declare function toAttributeValue(value: unknown): AttributeValue$2 | undefined;
|
|
601
605
|
/** A flat, dot-notation attribute bag: what a nested object flattens to. */
|
|
@@ -605,6 +609,11 @@ interface FlatAttributes {
|
|
|
605
609
|
/**
|
|
606
610
|
* Recursively flatten a nested object into dot-notation OTel attributes.
|
|
607
611
|
* Includes circular reference protection via WeakSet.
|
|
612
|
+
*
|
|
613
|
+
* Every key is converted inside its own guard, so one value that cannot be read
|
|
614
|
+
* - a getter that throws, an exotic proxy, a `Map` whose key has no string form
|
|
615
|
+
* - costs that key alone and never the call. Keys are listed before their
|
|
616
|
+
* values are read, so a sibling of the bad value still lands.
|
|
608
617
|
*/
|
|
609
618
|
declare function flattenToAttributes(fields: UnknownRecord, prefix?: string): FlatAttributes;
|
|
610
619
|
//#endregion
|
|
@@ -672,4 +681,4 @@ declare function defineEnricher<TEvent extends UnknownRecord, TValue extends obj
|
|
|
672
681
|
*/
|
|
673
682
|
declare function formatDuration(ms: number): string;
|
|
674
683
|
//#endregion
|
|
675
|
-
export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type ExperimentOptions, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
|
|
684
|
+
export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type ExperimentOptions, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, requestCtx, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { g as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord, x as toError } from "./values-
|
|
1
|
+
import { g as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord, x as toError } from "./values-xBtdXtjA.js";
|
|
2
2
|
import { getAutotelTracer, getAutotelTracerProvider, setAutotelTracerProvider } from "./tracer-provider.js";
|
|
3
|
-
import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-
|
|
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-
|
|
3
|
+
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
|
-
import { n as formatDuration } from "./canonical-log-line-processor-
|
|
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
|
|
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-Cnga_Lnv.js";
|
|
11
11
|
import { createDeterministicTraceId, enrichWithTraceContext, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTraceContext, getTracer, isTracing, resolveTraceUrl, runWithSpan } from "./trace-helpers.js";
|
|
12
|
-
import { t as hashJson } from "./stable-hash-
|
|
13
|
-
import { t as emitCorrelatedEvent } from "./correlated-events-
|
|
12
|
+
import { t as hashJson } from "./stable-hash-AOUgw1DW.js";
|
|
13
|
+
import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
|
|
14
14
|
import { parseError } from "./parse-error.js";
|
|
15
15
|
import { createDrainPipeline } from "./drain-pipeline.js";
|
|
16
16
|
import { createCounter, createHistogram, createObservableGauge, createUpDownCounter, getMeter } from "./metric-helpers.js";
|
|
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-De9Fx0b4.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";
|
|
@@ -548,4 +548,4 @@ function defineEnricher(def, options = {}) {
|
|
|
548
548
|
}
|
|
549
549
|
|
|
550
550
|
//#endregion
|
|
551
|
-
export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, AttributeRedactingProcessor, BaggageSpanProcessor, BusinessBaggage, CORRELATION_ID_BAGGAGE_KEY, Event, FilteringSpanProcessor, HTTPAttributes, Metric, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, NeverSampler, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, RandomSampler, ServiceAttributes, SpanKind, SpanNameNormalizingProcessor, SpanStatusCode, URLAttributes, UserIdSampler, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
|
|
551
|
+
export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, AttributeRedactingProcessor, BaggageSpanProcessor, BusinessBaggage, CORRELATION_ID_BAGGAGE_KEY, Event, FilteringSpanProcessor, HTTPAttributes, Metric, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, NeverSampler, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, RandomSampler, ServiceAttributes, SpanKind, SpanNameNormalizingProcessor, SpanStatusCode, URLAttributes, UserIdSampler, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, requestCtx, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
2
|
-
const require_values = require('./values-
|
|
2
|
+
const require_values = require('./values-tm4bi0FF.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-BAXhglRE.cjs');
|
|
6
|
+
const require_node_require = require('./node-require-B_IVapV3.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-Bvgb1lE4.cjs');
|
|
13
13
|
const require_metric = require('./metric.cjs');
|
|
14
14
|
let _opentelemetry_sdk_node = require("@opentelemetry/sdk-node");
|
|
15
15
|
let _opentelemetry_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
@@ -1005,8 +1005,17 @@ function createTraceContext(span) {
|
|
|
1005
1005
|
traceId: spanContext.traceId,
|
|
1006
1006
|
spanId: spanContext.spanId,
|
|
1007
1007
|
correlationId: spanContext.traceId.slice(0, 16),
|
|
1008
|
-
setAttribute:
|
|
1009
|
-
|
|
1008
|
+
setAttribute: (key, value) => {
|
|
1009
|
+
const attr = require_structured_error.toAttributeValue(value);
|
|
1010
|
+
if (attr === void 0) {
|
|
1011
|
+
span.setAttributes(require_structured_error.flattenToAttributes({ [key]: value }));
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
span.setAttribute(key, attr);
|
|
1015
|
+
},
|
|
1016
|
+
setAttributes: (attrs) => {
|
|
1017
|
+
span.setAttributes(require_structured_error.flattenToAttributes(attrs));
|
|
1018
|
+
},
|
|
1010
1019
|
setStatus: (status) => {
|
|
1011
1020
|
spansWithExplicitStatus.add(span);
|
|
1012
1021
|
span.setStatus(status);
|
|
@@ -3785,6 +3794,44 @@ const INSTRUMENTATION_CLASS_TO_PACKAGE = new Map(Object.entries({
|
|
|
3785
3794
|
MySQL2Instrumentation: "@opentelemetry/instrumentation-mysql2"
|
|
3786
3795
|
}));
|
|
3787
3796
|
/**
|
|
3797
|
+
* What autotel configures when the caller has not said otherwise.
|
|
3798
|
+
*
|
|
3799
|
+
* `instrumentation-express` opens a span per layer and runs the layer under it,
|
|
3800
|
+
* so whatever is active inside a middleware is that layer's span - one that
|
|
3801
|
+
* ends the moment `next()` fires. Request-wide attributes set there would land
|
|
3802
|
+
* on `middleware - anonymous` rather than on the request span every backend
|
|
3803
|
+
* shows as the resource. Ignoring the two leaf layer types puts them back on
|
|
3804
|
+
* the request span and drops a pile of noise spans with them; the route rename
|
|
3805
|
+
* (`GET /users/:id`) survives, because `rpcMetadata.route` is assigned before
|
|
3806
|
+
* the ignore check.
|
|
3807
|
+
*
|
|
3808
|
+
* Pass your own `ignoreLayersType` - `[]` for the upstream behaviour - to
|
|
3809
|
+
* override it, or `ignoreLayers` to silence only the noisy paths.
|
|
3810
|
+
*/
|
|
3811
|
+
const AUTOTEL_DEFAULTS = { "@opentelemetry/instrumentation-express": { ignoreLayersType: ["middleware", "request_handler"] } };
|
|
3812
|
+
/** Apply {@link AUTOTEL_DEFAULTS} under whatever the caller already chose. */
|
|
3813
|
+
function withAutotelDefaults(config) {
|
|
3814
|
+
const merged = { ...config };
|
|
3815
|
+
for (const [packageName, defaults] of Object.entries(AUTOTEL_DEFAULTS)) {
|
|
3816
|
+
const options = merged[packageName];
|
|
3817
|
+
if (options?.enabled === false) continue;
|
|
3818
|
+
merged[packageName] = {
|
|
3819
|
+
...defaults,
|
|
3820
|
+
...options
|
|
3821
|
+
};
|
|
3822
|
+
}
|
|
3823
|
+
return merged;
|
|
3824
|
+
}
|
|
3825
|
+
/**
|
|
3826
|
+
* `express` and `@opentelemetry/instrumentation-express` name the same thing.
|
|
3827
|
+
* `getNodeAutoInstrumentations` only answers to the full name - it
|
|
3828
|
+
* `diag.error`s anything else and ignores the config - so the short form every
|
|
3829
|
+
* autotel example uses has to be expanded before it gets there.
|
|
3830
|
+
*/
|
|
3831
|
+
function toPackageName(name) {
|
|
3832
|
+
return name.startsWith("@opentelemetry/instrumentation-") ? name : `@opentelemetry/instrumentation-${name}`;
|
|
3833
|
+
}
|
|
3834
|
+
/**
|
|
3788
3835
|
* Detect if we're running in ESM mode
|
|
3789
3836
|
*/
|
|
3790
3837
|
function isESMMode() {
|
|
@@ -3839,24 +3886,14 @@ function getAutoInstrumentations(integrations, manualInstrumentationNames = /* @
|
|
|
3839
3886
|
const packageName = INSTRUMENTATION_CLASS_TO_PACKAGE.get(className);
|
|
3840
3887
|
if (packageName) exclusionConfig[packageName] = { enabled: false };
|
|
3841
3888
|
}
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3889
|
+
const config = { ...exclusionConfig };
|
|
3890
|
+
const requested = integrations === true ? [] : Array.isArray(integrations) ? integrations.map((name) => [name, { enabled: true }]) : Object.entries(integrations);
|
|
3891
|
+
for (const [name, options] of requested) {
|
|
3892
|
+
const packageName = toPackageName(name);
|
|
3893
|
+
if (packageName in exclusionConfig) continue;
|
|
3894
|
+
config[packageName] = options;
|
|
3845
3895
|
}
|
|
3846
|
-
|
|
3847
|
-
const config = { ...exclusionConfig };
|
|
3848
|
-
for (const name of integrations) {
|
|
3849
|
-
const packageName = `@opentelemetry/instrumentation-${name}`;
|
|
3850
|
-
if (!exclusionConfig[packageName]) config[packageName] = { enabled: true };
|
|
3851
|
-
}
|
|
3852
|
-
return getNodeAutoInstrumentations(config);
|
|
3853
|
-
}
|
|
3854
|
-
const config = {
|
|
3855
|
-
...exclusionConfig,
|
|
3856
|
-
...integrations
|
|
3857
|
-
};
|
|
3858
|
-
for (const packageName of Object.keys(exclusionConfig)) if (Object.keys(integrations).find((key) => packageName.includes(key))) config[packageName] = { enabled: false };
|
|
3859
|
-
return getNodeAutoInstrumentations(config);
|
|
3896
|
+
return getNodeAutoInstrumentations(withAutotelDefaults(config));
|
|
3860
3897
|
}
|
|
3861
3898
|
|
|
3862
3899
|
//#endregion
|
|
@@ -468,6 +468,22 @@ interface AutotelConfig {
|
|
|
468
468
|
* })
|
|
469
469
|
* ```
|
|
470
470
|
*
|
|
471
|
+
* @example Pass options to an instrumentation
|
|
472
|
+
* Anything beyond `enabled` goes to that instrumentation's constructor, and
|
|
473
|
+
* overrides what autotel defaults it to. Express defaults to
|
|
474
|
+
* `ignoreLayersType: ['middleware', 'request_handler']`, which keeps
|
|
475
|
+
* attributes set from a middleware on the request span; `[]` asks for the
|
|
476
|
+
* per-layer spans back.
|
|
477
|
+
* ```typescript
|
|
478
|
+
* init({
|
|
479
|
+
* service: 'my-app',
|
|
480
|
+
* autoInstrumentations: {
|
|
481
|
+
* http: { enabled: true },
|
|
482
|
+
* express: { ignoreLayersType: [] }
|
|
483
|
+
* }
|
|
484
|
+
* })
|
|
485
|
+
* ```
|
|
486
|
+
*
|
|
471
487
|
* @example Manual config when you need custom settings
|
|
472
488
|
* ```typescript
|
|
473
489
|
* import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb'
|
|
@@ -485,7 +501,7 @@ interface AutotelConfig {
|
|
|
485
501
|
*/
|
|
486
502
|
autoInstrumentations?: string[] | boolean | Record<string, {
|
|
487
503
|
enabled?: boolean;
|
|
488
|
-
}
|
|
504
|
+
} & Record<string, unknown>>;
|
|
489
505
|
/**
|
|
490
506
|
* OTLP endpoint for traces/metrics/logs
|
|
491
507
|
* Single-destination shorthand. For multi-backend OTLP fan-out, use
|