autotel 8.1.0 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.js +1 -1
- package/dist/event.cjs +1 -1
- package/dist/event.js +1 -1
- package/dist/{functional-7uwlAIJd.js → functional-DPuMySRd.js} +6 -4
- package/dist/{functional-DCfOaKoM.cjs → functional-u1L2mzVO.cjs} +5 -3
- package/dist/functional.cjs +1 -1
- package/dist/functional.js +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-D4TpmUIg.js → init-BtmNJzPs.js} +19 -6
- package/dist/{init-DlJvp1WH.cjs → init-Cx2YBujN.cjs} +19 -6
- package/dist/instrumentation.cjs +1 -1
- package/dist/instrumentation.js +1 -1
- package/dist/messaging.cjs +2 -2
- package/dist/messaging.js +2 -2
- package/dist/sampling.cjs +1 -1
- package/dist/sampling.js +1 -1
- package/dist/semantic-helpers.cjs +1 -1
- package/dist/semantic-helpers.js +1 -1
- package/dist/tail-sampling-processor.cjs +1 -1
- package/dist/tail-sampling-processor.js +1 -1
- package/dist/webhook.cjs +1 -1
- package/dist/webhook.js +1 -1
- package/dist/workflow-distributed.cjs +1 -1
- package/dist/workflow-distributed.js +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.js +1 -1
- package/dist/yaml-config.cjs +1 -1
- package/dist/yaml-config.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2736,7 +2736,7 @@ export const handler = async (event) => {
|
|
|
2736
2736
|
The `flush()` function:
|
|
2737
2737
|
|
|
2738
2738
|
- Flushes events from the queue
|
|
2739
|
-
- Force-flushes OpenTelemetry spans to exporters
|
|
2739
|
+
- Force-flushes OpenTelemetry spans and batched log records to exporters
|
|
2740
2740
|
- Includes timeout protection (default: 2000ms)
|
|
2741
2741
|
- Safe to call multiple times
|
|
2742
2742
|
|
package/dist/auto.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
node_module = require_rolldown_runtime.__toESM(node_module, 1);
|
|
5
5
|
let import_in_the_middle = require("import-in-the-middle");
|
package/dist/auto.js
CHANGED
package/dist/correlation-id.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
|
|
4
4
|
exports.CORRELATION_ID_BAGGAGE_KEY = require_init.CORRELATION_ID_BAGGAGE_KEY;
|
|
5
5
|
exports.generateCorrelationId = require_init.generateCorrelationId;
|
package/dist/correlation-id.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as CORRELATION_ID_BAGGAGE_KEY, at as setCorrelationId, et as generateCorrelationId, it as runWithCorrelationId, nt as getCorrelationStorage, ot as setCorrelationIdInBaggage, rt as getOrCreateCorrelationId, tt as getCorrelationId } from "./init-
|
|
1
|
+
import { $ as CORRELATION_ID_BAGGAGE_KEY, at as setCorrelationId, et as generateCorrelationId, it as runWithCorrelationId, nt as getCorrelationStorage, ot as setCorrelationIdInBaggage, rt as getOrCreateCorrelationId, tt as getCorrelationId } from "./init-BtmNJzPs.js";
|
|
2
2
|
|
|
3
3
|
export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getCorrelationStorage, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage };
|
package/dist/decorators.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
4
4
|
const require_config = require('./config.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
package/dist/decorators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as createTraceContext } from "./init-
|
|
1
|
+
import { K as createTraceContext } from "./init-BtmNJzPs.js";
|
|
2
2
|
import { b as splitNameOrOptions } from "./values-Dm0yEC5p.js";
|
|
3
3
|
import { getConfig } from "./config.js";
|
|
4
4
|
import { SpanStatusCode } from "@opentelemetry/api";
|
package/dist/event.cjs
CHANGED
package/dist/event.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as AlwaysSampler, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, E as AUTOTEL_SAMPLING_RATE, H as isForceKept, J as explicitSpanStatus, K as createTraceContext, O as AUTOTEL_SAMPLING_TAIL_KEEP, S as rememberRequestAttributes, X as getContextStorage, Y as getActiveContextWithBaggage, Z as getEventQueue, h as runInOperationContext, i as getSdk, n as getConfiguredSampler, t as getConfig, x as getRequestSpanIn, z as debugCaptureRequested } from "./init-
|
|
1
|
+
import { A as AlwaysSampler, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, E as AUTOTEL_SAMPLING_RATE, H as isForceKept, J as explicitSpanStatus, K as createTraceContext, O as AUTOTEL_SAMPLING_TAIL_KEEP, S as rememberRequestAttributes, X as getContextStorage, Y as getActiveContextWithBaggage, Z as getEventQueue, h as runInOperationContext, i as getSdk, n as getConfiguredSampler, t as getConfig, x as getRequestSpanIn, z as debugCaptureRequested } from "./init-BtmNJzPs.js";
|
|
2
2
|
import { h as isDevelopment, l as asString } from "./values-Dm0yEC5p.js";
|
|
3
3
|
import { getForceFlushableProvider } from "./tracer-provider.js";
|
|
4
4
|
import { getConfig as getConfig$1 } from "./config.js";
|
|
5
5
|
import { a as flattenToAttributes } from "./structured-error-UEtlg9Uu.js";
|
|
6
6
|
import { evidenceAttribute } from "./evidence.js";
|
|
7
7
|
import { setSpanName } from "./trace-helpers.js";
|
|
8
|
-
import { SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
8
|
+
import { SpanStatusCode, TraceFlags, context, propagation, trace } from "@opentelemetry/api";
|
|
9
9
|
import * as nodeFs from "node:fs";
|
|
10
10
|
import * as nodeUrl from "node:url";
|
|
11
11
|
|
|
@@ -365,7 +365,10 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
365
365
|
metadata: {}
|
|
366
366
|
};
|
|
367
367
|
const sampler = resolveSampler();
|
|
368
|
-
const
|
|
368
|
+
const activeSpan = trace.getActiveSpan();
|
|
369
|
+
const parent = options.startNewRoot ? void 0 : activeSpan?.spanContext();
|
|
370
|
+
const parentSampled = parent !== void 0 && !parent.isRemote && (parent.traceFlags & TraceFlags.SAMPLED) !== 0;
|
|
371
|
+
const shouldSample = sampler.shouldSample(samplingContext) || parentSampled;
|
|
369
372
|
const sampleRate = sampler.sampleRate?.(samplingContext);
|
|
370
373
|
const needsTailSampling = sampler.needsTailSampling?.() ?? false;
|
|
371
374
|
if (!shouldSample && !needsTailSampling) {
|
|
@@ -373,7 +376,6 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
373
376
|
return promiseFromThenable(unsampled) ?? unsampled;
|
|
374
377
|
}
|
|
375
378
|
const startTime = performance.now();
|
|
376
|
-
const activeSpan = trace.getActiveSpan();
|
|
377
379
|
const flushRootTelemetry = createRootTelemetryFlusher(options, options.startNewRoot || activeSpan === void 0 || activeSpan.spanContext().isRemote === true);
|
|
378
380
|
const spanOptions = {};
|
|
379
381
|
if (options.startNewRoot) spanOptions.root = true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
4
4
|
const require_tracer_provider = require('./tracer-provider.cjs');
|
|
5
5
|
const require_config = require('./config.cjs');
|
|
@@ -368,7 +368,10 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
368
368
|
metadata: {}
|
|
369
369
|
};
|
|
370
370
|
const sampler = resolveSampler();
|
|
371
|
-
const
|
|
371
|
+
const activeSpan = _opentelemetry_api.trace.getActiveSpan();
|
|
372
|
+
const parent = options.startNewRoot ? void 0 : activeSpan?.spanContext();
|
|
373
|
+
const parentSampled = parent !== void 0 && !parent.isRemote && (parent.traceFlags & _opentelemetry_api.TraceFlags.SAMPLED) !== 0;
|
|
374
|
+
const shouldSample = sampler.shouldSample(samplingContext) || parentSampled;
|
|
372
375
|
const sampleRate = sampler.sampleRate?.(samplingContext);
|
|
373
376
|
const needsTailSampling = sampler.needsTailSampling?.() ?? false;
|
|
374
377
|
if (!shouldSample && !needsTailSampling) {
|
|
@@ -376,7 +379,6 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
376
379
|
return promiseFromThenable(unsampled) ?? unsampled;
|
|
377
380
|
}
|
|
378
381
|
const startTime = performance.now();
|
|
379
|
-
const activeSpan = _opentelemetry_api.trace.getActiveSpan();
|
|
380
382
|
const flushRootTelemetry = createRootTelemetryFlusher(options, options.startNewRoot || activeSpan === void 0 || activeSpan.spanContext().isRemote === true);
|
|
381
383
|
const spanOptions = {};
|
|
382
384
|
if (options.startNewRoot) spanOptions.root = true;
|
package/dist/functional.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_functional = require('./functional-
|
|
2
|
+
const require_functional = require('./functional-u1L2mzVO.cjs');
|
|
3
3
|
|
|
4
4
|
exports.ctx = require_functional.ctx;
|
|
5
5
|
exports.getActiveTraceContext = require_functional.getActiveTraceContext;
|
package/dist/functional.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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-
|
|
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-DPuMySRd.js";
|
|
2
2
|
|
|
3
3
|
export { ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
|
package/dist/http.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
4
4
|
const require_config = require('./config.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
package/dist/http.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as getActiveContextWithBaggage } from "./init-
|
|
1
|
+
import { Y as getActiveContextWithBaggage } from "./init-BtmNJzPs.js";
|
|
2
2
|
import { g as isFunction, i as asNumber, l as asString, v as readProperty } from "./values-Dm0yEC5p.js";
|
|
3
3
|
import { getConfig } from "./config.js";
|
|
4
4
|
import { SpanStatusCode, context, propagation } from "@opentelemetry/api";
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
|
|
3
|
-
const require_init = require('./init-
|
|
3
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
4
4
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
5
5
|
const require_tracer_provider = require('./tracer-provider.cjs');
|
|
6
6
|
const require_structured_error = require('./structured-error-Ci8s_M6u.cjs');
|
|
@@ -9,7 +9,7 @@ const require_span_name_normalizer = require('./span-name-normalizer.cjs');
|
|
|
9
9
|
const require_attribute_redacting_processor = require('./attribute-redacting-processor.cjs');
|
|
10
10
|
const require_canonical_log_line_processor = require('./canonical-log-line-processor-DScNq1g8.cjs');
|
|
11
11
|
const require_metric = require('./metric.cjs');
|
|
12
|
-
const require_functional = require('./functional-
|
|
12
|
+
const require_functional = require('./functional-u1L2mzVO.cjs');
|
|
13
13
|
const require_trace_helpers = require('./trace-helpers.cjs');
|
|
14
14
|
const require_stable_hash = require('./stable-hash-58iP5-N-.cjs');
|
|
15
15
|
const require_correlated_events = require('./correlated-events-wCrXVUby.cjs');
|
package/dist/index.d.cts
CHANGED
|
@@ -377,7 +377,7 @@ export declare function getEventQueue(): EventQueue | null;
|
|
|
377
377
|
/**
|
|
378
378
|
* Flush all pending telemetry
|
|
379
379
|
*
|
|
380
|
-
* Flushes
|
|
380
|
+
* Flushes queued events, OpenTelemetry spans, and log records to their destinations.
|
|
381
381
|
* Includes timeout protection to prevent hanging in serverless environments.
|
|
382
382
|
*
|
|
383
383
|
* Safe to call multiple times.
|
package/dist/index.d.ts
CHANGED
|
@@ -377,7 +377,7 @@ export declare function getEventQueue(): EventQueue | null;
|
|
|
377
377
|
/**
|
|
378
378
|
* Flush all pending telemetry
|
|
379
379
|
*
|
|
380
|
-
* Flushes
|
|
380
|
+
* Flushes queued events, OpenTelemetry spans, and log records to their destinations.
|
|
381
381
|
* Includes timeout protection to prevent hanging in serverless environments.
|
|
382
382
|
*
|
|
383
383
|
* Safe to call multiple times.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CORRELATION_ID_BAGGAGE_KEY, A as AlwaysSampler, B as extractLinksFromBatch, C as BaggageSpanProcessor, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, F as NeverSampler, G as samplingPresets, I as RandomSampler, K as createTraceContext, L as UserIdSampler, O as AUTOTEL_SAMPLING_TAIL_KEEP, Q as track, R as createLinkFromHeaders, T as AUTOTEL_DEBUG_BAGGAGE_KEY, U as markForceKept, W as resolveSamplingPreset, Z as getEventQueue, a as init, at as setCorrelationId, b as EnrichedSpanProcessor, c as lockLogger, d as Event, et as generateCorrelationId, f as getEvents, h as runInOperationContext, it as runWithCorrelationId, k as AdaptiveSampler, l as flush, m as getOperationContext, o as isInitialized, ot as setCorrelationIdInBaggage, p as resetEvents, q as defineBaggageSchema, rt as getOrCreateCorrelationId, s as isLoggerLocked, tt as getCorrelationId, u as shutdown, y as createStringRedactor } from "./init-
|
|
1
|
+
import { $ as CORRELATION_ID_BAGGAGE_KEY, A as AlwaysSampler, B as extractLinksFromBatch, C as BaggageSpanProcessor, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, F as NeverSampler, G as samplingPresets, I as RandomSampler, K as createTraceContext, L as UserIdSampler, O as AUTOTEL_SAMPLING_TAIL_KEEP, Q as track, R as createLinkFromHeaders, T as AUTOTEL_DEBUG_BAGGAGE_KEY, U as markForceKept, W as resolveSamplingPreset, Z as getEventQueue, a as init, at as setCorrelationId, b as EnrichedSpanProcessor, c as lockLogger, d as Event, et as generateCorrelationId, f as getEvents, h as runInOperationContext, it as runWithCorrelationId, k as AdaptiveSampler, l as flush, m as getOperationContext, o as isInitialized, ot as setCorrelationIdInBaggage, p as resetEvents, q as defineBaggageSchema, rt as getOrCreateCorrelationId, s as isLoggerLocked, tt as getCorrelationId, u as shutdown, y as createStringRedactor } from "./init-BtmNJzPs.js";
|
|
2
2
|
import { C as toError, _ as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord } from "./values-Dm0yEC5p.js";
|
|
3
3
|
import { getAutotelTracer, getAutotelTracerProvider, hasTracerProvider, setAutotelTracerProvider } from "./tracer-provider.js";
|
|
4
4
|
import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-UEtlg9Uu.js";
|
|
@@ -7,7 +7,7 @@ import { NORMALIZER_PATTERNS, NORMALIZER_PRESETS, SpanNameNormalizingProcessor }
|
|
|
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-naZRETyk.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-DPuMySRd.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-DVEU2MqW.js";
|
|
13
13
|
import { t as emitCorrelatedEvent } from "./correlated-events-CZFe6Z1P.js";
|
|
@@ -3733,7 +3733,7 @@ function isUnreachableEndpointError(cause, depth = 0) {
|
|
|
3733
3733
|
/**
|
|
3734
3734
|
* Flush all pending telemetry
|
|
3735
3735
|
*
|
|
3736
|
-
* Flushes
|
|
3736
|
+
* Flushes queued events, OpenTelemetry spans, and log records to their destinations.
|
|
3737
3737
|
* Includes timeout protection to prevent hanging in serverless environments.
|
|
3738
3738
|
*
|
|
3739
3739
|
* Safe to call multiple times.
|
|
@@ -3764,10 +3764,11 @@ async function flush(options) {
|
|
|
3764
3764
|
const doFlush = async () => {
|
|
3765
3765
|
const eventsQueue = getEventQueue();
|
|
3766
3766
|
if (eventsQueue) await (forShutdown ? eventsQueue.shutdown() : eventsQueue.flush());
|
|
3767
|
-
|
|
3768
|
-
const
|
|
3769
|
-
|
|
3770
|
-
|
|
3767
|
+
await Promise.allSettled([Promise.resolve().then(() => getForceFlushableProvider(getSdk())?.forceFlush()), Promise.resolve().then(() => {
|
|
3768
|
+
const provider = logs.getLoggerProvider();
|
|
3769
|
+
const forceFlush = readProperty(provider, "forceFlush");
|
|
3770
|
+
if (isFunction(forceFlush)) return forceFlush.call(provider);
|
|
3771
|
+
})]);
|
|
3771
3772
|
};
|
|
3772
3773
|
let timeoutHandle;
|
|
3773
3774
|
try {
|
|
@@ -4346,6 +4347,18 @@ function toOtelSampler(sampler) {
|
|
|
4346
4347
|
}
|
|
4347
4348
|
};
|
|
4348
4349
|
}
|
|
4350
|
+
/**
|
|
4351
|
+
* A span below another span in this process keeps its parent's decision, so a
|
|
4352
|
+
* trace stays whole. A root, or a span under a remote parent, asks Autotel's
|
|
4353
|
+
* sampler: this service decides for itself what it keeps.
|
|
4354
|
+
*/
|
|
4355
|
+
function followLocalParent(root) {
|
|
4356
|
+
return new ParentBasedSampler({
|
|
4357
|
+
root,
|
|
4358
|
+
remoteParentSampled: root,
|
|
4359
|
+
remoteParentNotSampled: root
|
|
4360
|
+
});
|
|
4361
|
+
}
|
|
4349
4362
|
let initialized = false;
|
|
4350
4363
|
let locked = false;
|
|
4351
4364
|
let config = null;
|
|
@@ -4626,7 +4639,7 @@ function init(cfg) {
|
|
|
4626
4639
|
}
|
|
4627
4640
|
const autotelSampler = mergedConfig.sampler ?? (mergedConfig.sampling ? resolveSamplingPreset(mergedConfig.sampling) : void 0);
|
|
4628
4641
|
if (autotelSampler) mergedConfig.sampler = autotelSampler;
|
|
4629
|
-
const sampler = autotelSampler ? toOtelSampler(autotelSampler) : envConfig.otelSampler ?? toOtelSampler(samplingPresets.production());
|
|
4642
|
+
const sampler = autotelSampler ? followLocalParent(toOtelSampler(autotelSampler)) : envConfig.otelSampler ?? followLocalParent(toOtelSampler(samplingPresets.production()));
|
|
4630
4643
|
const sdkOptions = {
|
|
4631
4644
|
resource,
|
|
4632
4645
|
serviceName: mergedConfig.service,
|
|
@@ -3738,7 +3738,7 @@ function isUnreachableEndpointError(cause, depth = 0) {
|
|
|
3738
3738
|
/**
|
|
3739
3739
|
* Flush all pending telemetry
|
|
3740
3740
|
*
|
|
3741
|
-
* Flushes
|
|
3741
|
+
* Flushes queued events, OpenTelemetry spans, and log records to their destinations.
|
|
3742
3742
|
* Includes timeout protection to prevent hanging in serverless environments.
|
|
3743
3743
|
*
|
|
3744
3744
|
* Safe to call multiple times.
|
|
@@ -3769,10 +3769,11 @@ async function flush(options) {
|
|
|
3769
3769
|
const doFlush = async () => {
|
|
3770
3770
|
const eventsQueue = getEventQueue();
|
|
3771
3771
|
if (eventsQueue) await (forShutdown ? eventsQueue.shutdown() : eventsQueue.flush());
|
|
3772
|
-
|
|
3773
|
-
const
|
|
3774
|
-
|
|
3775
|
-
|
|
3772
|
+
await Promise.allSettled([Promise.resolve().then(() => require_tracer_provider.getForceFlushableProvider(getSdk())?.forceFlush()), Promise.resolve().then(() => {
|
|
3773
|
+
const provider = _opentelemetry_api_logs.logs.getLoggerProvider();
|
|
3774
|
+
const forceFlush = require_values.readProperty(provider, "forceFlush");
|
|
3775
|
+
if (require_values.isFunction(forceFlush)) return forceFlush.call(provider);
|
|
3776
|
+
})]);
|
|
3776
3777
|
};
|
|
3777
3778
|
let timeoutHandle;
|
|
3778
3779
|
try {
|
|
@@ -4351,6 +4352,18 @@ function toOtelSampler(sampler) {
|
|
|
4351
4352
|
}
|
|
4352
4353
|
};
|
|
4353
4354
|
}
|
|
4355
|
+
/**
|
|
4356
|
+
* A span below another span in this process keeps its parent's decision, so a
|
|
4357
|
+
* trace stays whole. A root, or a span under a remote parent, asks Autotel's
|
|
4358
|
+
* sampler: this service decides for itself what it keeps.
|
|
4359
|
+
*/
|
|
4360
|
+
function followLocalParent(root) {
|
|
4361
|
+
return new _opentelemetry_sdk_trace_base.ParentBasedSampler({
|
|
4362
|
+
root,
|
|
4363
|
+
remoteParentSampled: root,
|
|
4364
|
+
remoteParentNotSampled: root
|
|
4365
|
+
});
|
|
4366
|
+
}
|
|
4354
4367
|
let initialized = false;
|
|
4355
4368
|
let locked = false;
|
|
4356
4369
|
let config = null;
|
|
@@ -4631,7 +4644,7 @@ function init(cfg) {
|
|
|
4631
4644
|
}
|
|
4632
4645
|
const autotelSampler = mergedConfig.sampler ?? (mergedConfig.sampling ? resolveSamplingPreset(mergedConfig.sampling) : void 0);
|
|
4633
4646
|
if (autotelSampler) mergedConfig.sampler = autotelSampler;
|
|
4634
|
-
const sampler = autotelSampler ? toOtelSampler(autotelSampler) : envConfig.otelSampler ?? toOtelSampler(samplingPresets.production());
|
|
4647
|
+
const sampler = autotelSampler ? followLocalParent(toOtelSampler(autotelSampler)) : envConfig.otelSampler ?? followLocalParent(toOtelSampler(samplingPresets.production()));
|
|
4635
4648
|
const sdkOptions = {
|
|
4636
4649
|
resource,
|
|
4637
4650
|
serviceName: mergedConfig.service,
|
package/dist/instrumentation.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
const require_node_require = require('./node-require-BotQNkYw.cjs');
|
|
4
4
|
let _opentelemetry_resources = require("@opentelemetry/resources");
|
|
5
5
|
let _opentelemetry_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getLogger, w as TailSamplingSpanProcessor } from "./init-
|
|
1
|
+
import { r as getLogger, w as TailSamplingSpanProcessor } from "./init-BtmNJzPs.js";
|
|
2
2
|
import { n as safeRequire, t as requireModule } from "./node-require-CY0YUdvZ.js";
|
|
3
3
|
import { detectResources, hostDetector, processDetector, resourceFromAttributes } from "@opentelemetry/resources";
|
|
4
4
|
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
package/dist/messaging.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
4
|
-
const require_functional = require('./functional-
|
|
4
|
+
const require_functional = require('./functional-u1L2mzVO.cjs');
|
|
5
5
|
const require_correlated_events = require('./correlated-events-wCrXVUby.cjs');
|
|
6
6
|
const require_trace_factory_validation = require('./trace-factory-validation-CHU1WcjK.cjs');
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
package/dist/messaging.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as extractLinksFromBatch, R as createLinkFromHeaders } from "./init-
|
|
1
|
+
import { B as extractLinksFromBatch, R as createLinkFromHeaders } from "./init-BtmNJzPs.js";
|
|
2
2
|
import { S as toAttributeValue, _ as nonEmptyString, b as splitNameOrOptions, c as asScalar, g as isFunction, s as asRecord, v as readProperty, y as resolveValue } from "./values-Dm0yEC5p.js";
|
|
3
|
-
import { l as withTracing } from "./functional-
|
|
3
|
+
import { l as withTracing } from "./functional-DPuMySRd.js";
|
|
4
4
|
import { t as emitCorrelatedEvent } from "./correlated-events-CZFe6Z1P.js";
|
|
5
5
|
import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
|
|
6
6
|
import { SpanKind, context, propagation } from "@opentelemetry/api";
|
package/dist/sampling.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
|
|
4
4
|
exports.AUTOTEL_DEBUG_BAGGAGE_KEY = require_init.AUTOTEL_DEBUG_BAGGAGE_KEY;
|
|
5
5
|
exports.AUTOTEL_SAMPLING_RATE = require_init.AUTOTEL_SAMPLING_RATE;
|
package/dist/sampling.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as AlwaysSampler, B as extractLinksFromBatch, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, E as AUTOTEL_SAMPLING_RATE, F as NeverSampler, G as samplingPresets, H as isForceKept, I as RandomSampler, L as UserIdSampler, M as DeterministicSampler, N as FeatureFlagSampler, O as AUTOTEL_SAMPLING_TAIL_KEEP, P as KeyTargetRateSampler, R as createLinkFromHeaders, T as AUTOTEL_DEBUG_BAGGAGE_KEY, U as markForceKept, V as hashUnitInterval, W as resolveSamplingPreset, j as CompositeSampler, k as AdaptiveSampler, z as debugCaptureRequested } from "./init-
|
|
1
|
+
import { A as AlwaysSampler, B as extractLinksFromBatch, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, E as AUTOTEL_SAMPLING_RATE, F as NeverSampler, G as samplingPresets, H as isForceKept, I as RandomSampler, L as UserIdSampler, M as DeterministicSampler, N as FeatureFlagSampler, O as AUTOTEL_SAMPLING_TAIL_KEEP, P as KeyTargetRateSampler, R as createLinkFromHeaders, T as AUTOTEL_DEBUG_BAGGAGE_KEY, U as markForceKept, V as hashUnitInterval, W as resolveSamplingPreset, j as CompositeSampler, k as AdaptiveSampler, z as debugCaptureRequested } from "./init-BtmNJzPs.js";
|
|
2
2
|
|
|
3
3
|
export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_RATE, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, CompositeSampler, DeterministicSampler, FeatureFlagSampler, KeyTargetRateSampler, NeverSampler, RandomSampler, UserIdSampler, createLinkFromHeaders, debugCaptureRequested, extractLinksFromBatch, hashUnitInterval, isForceKept, markForceKept, resolveSamplingPreset, samplingPresets };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
3
|
-
const require_functional = require('./functional-
|
|
3
|
+
const require_functional = require('./functional-u1L2mzVO.cjs');
|
|
4
4
|
const require_trace_factory_validation = require('./trace-factory-validation-CHU1WcjK.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
6
6
|
|
package/dist/semantic-helpers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as toAttributeValue, _ as nonEmptyString, s as asRecord } from "./values-Dm0yEC5p.js";
|
|
2
|
-
import { l as withTracing } from "./functional-
|
|
2
|
+
import { l as withTracing } from "./functional-DPuMySRd.js";
|
|
3
3
|
import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
|
|
4
4
|
import { SpanKind } from "@opentelemetry/api";
|
|
5
5
|
|
package/dist/webhook.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_structured_error = require('./structured-error-Ci8s_M6u.cjs');
|
|
3
|
-
const require_functional = require('./functional-
|
|
3
|
+
const require_functional = require('./functional-u1L2mzVO.cjs');
|
|
4
4
|
const require_correlated_events = require('./correlated-events-wCrXVUby.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
6
6
|
|
package/dist/webhook.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as recordStructuredError } from "./structured-error-UEtlg9Uu.js";
|
|
2
|
-
import { l as withTracing } from "./functional-
|
|
2
|
+
import { l as withTracing } from "./functional-DPuMySRd.js";
|
|
3
3
|
import { t as emitCorrelatedEvent } from "./correlated-events-CZFe6Z1P.js";
|
|
4
4
|
import { SpanKind, trace } from "@opentelemetry/api";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
3
|
-
const require_functional = require('./functional-
|
|
3
|
+
const require_functional = require('./functional-u1L2mzVO.cjs');
|
|
4
4
|
const require_correlated_events = require('./correlated-events-wCrXVUby.cjs');
|
|
5
5
|
const require_business_baggage = require('./business-baggage.cjs');
|
|
6
6
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as toError, g as isFunction } from "./values-Dm0yEC5p.js";
|
|
2
|
-
import { l as withTracing } from "./functional-
|
|
2
|
+
import { l as withTracing } from "./functional-DPuMySRd.js";
|
|
3
3
|
import { t as emitCorrelatedEvent } from "./correlated-events-CZFe6Z1P.js";
|
|
4
4
|
import { createSafeBaggageSchema } from "./business-baggage.js";
|
|
5
5
|
import { SpanKind, context, propagation } from "@opentelemetry/api";
|
package/dist/workflow.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
|
|
3
3
|
const require_values = require('./values-9A6nOyZm.cjs');
|
|
4
|
-
const require_functional = require('./functional-
|
|
4
|
+
const require_functional = require('./functional-u1L2mzVO.cjs');
|
|
5
5
|
const require_trace_helpers = require('./trace-helpers.cjs');
|
|
6
6
|
const require_correlated_events = require('./correlated-events-wCrXVUby.cjs');
|
|
7
7
|
const require_trace_factory_validation = require('./trace-factory-validation-CHU1WcjK.cjs');
|
package/dist/workflow.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as toError, S as toAttributeValue, _ as nonEmptyString, g as isFunction, l as asString, s as asRecord } from "./values-Dm0yEC5p.js";
|
|
2
|
-
import { l as withTracing } from "./functional-
|
|
2
|
+
import { l as withTracing } from "./functional-DPuMySRd.js";
|
|
3
3
|
import { getActiveSpan } from "./trace-helpers.js";
|
|
4
4
|
import { t as emitCorrelatedEvent } from "./correlated-events-CZFe6Z1P.js";
|
|
5
5
|
import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
|
package/dist/yaml-config.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-Cx2YBujN.cjs');
|
|
3
3
|
|
|
4
4
|
exports.hasYamlConfig = require_init.hasYamlConfig;
|
|
5
5
|
exports.loadYamlConfig = require_init.loadYamlConfig;
|
package/dist/yaml-config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as loadYamlConfig, g as hasYamlConfig, v as loadYamlConfigFromFile } from "./init-
|
|
1
|
+
import { _ as loadYamlConfig, g as hasYamlConfig, v as loadYamlConfigFromFile } from "./init-BtmNJzPs.js";
|
|
2
2
|
|
|
3
3
|
export { hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
|