autotel 7.1.0 → 7.3.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/README.md +41 -14
- package/dist/analysis.cjs +17 -0
- package/dist/analysis.d.cts +9 -1
- package/dist/analysis.d.ts +9 -1
- package/dist/analysis.js +17 -1
- package/dist/auto.cjs +2 -3
- package/dist/auto.js +1 -2
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.d.cts +1 -1
- package/dist/decorators.d.ts +1 -1
- package/dist/decorators.js +1 -1
- package/dist/event.cjs +1 -1
- package/dist/event.js +1 -1
- package/dist/{functional-Cub1ku-C.js → functional-C4js2vTM.js} +44 -7
- package/dist/{functional-CJn2zY4o.d.cts → functional-CgWcRXGX.d.cts} +12 -5
- package/dist/{functional-BhhP4Er_.cjs → functional-DHlD7V0x.cjs} +47 -10
- package/dist/{functional-DXy1cHFF.d.ts → functional-RFFpQzAV.d.ts} +12 -5
- package/dist/functional.cjs +1 -1
- package/dist/functional.d.cts +1 -1
- package/dist/functional.d.ts +1 -1
- package/dist/functional.js +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +53 -15
- package/dist/index.d.cts +24 -4
- package/dist/index.d.ts +24 -4
- package/dist/index.js +40 -5
- package/dist/{init-DrlL1eis.d.cts → init-8GSy2bza.d.cts} +1 -1
- package/dist/{init-DDyaLzeg.js → init-CsKK9vZO.js} +2196 -1298
- package/dist/{init-C5aHRqi2.cjs → init-DmM7dprX.cjs} +2356 -1300
- package/dist/{init-BgnYi2sm.d.ts → init-UnKrXhpq.d.ts} +1 -1
- package/dist/instrumentation.cjs +2 -3
- package/dist/instrumentation.js +1 -2
- package/dist/messaging.cjs +5 -5
- package/dist/messaging.js +2 -2
- package/dist/{sampling-CM5S2Lp3.d.ts → sampling-DBng4Foa.d.ts} +20 -1
- package/dist/{sampling-CmRdnXUi.d.cts → sampling-Er217Mge.d.cts} +20 -1
- package/dist/sampling.cjs +22 -601
- package/dist/sampling.d.cts +2 -2
- package/dist/sampling.d.ts +2 -2
- package/dist/sampling.js +2 -585
- package/dist/semantic-helpers.cjs +1 -1
- package/dist/semantic-helpers.js +1 -1
- package/dist/tail-sampling-processor.cjs +2 -26
- package/dist/tail-sampling-processor.js +1 -25
- package/dist/testing.cjs +32 -0
- package/dist/testing.d.cts +26 -1
- package/dist/testing.d.ts +26 -1
- package/dist/testing.js +32 -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 +4 -248
- package/dist/yaml-config.d.cts +2 -2
- package/dist/yaml-config.d.ts +2 -2
- package/dist/yaml-config.js +1 -242
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as AttributeRedactorPreset, r as AttributeRedactorConfig } from "./attribute-redacting-processor-CvBE0z1p.js";
|
|
2
2
|
import { s as Logger } from "./logger-S1Fgl0g3.js";
|
|
3
|
-
import {
|
|
3
|
+
import { g as SamplingPreset, m as Sampler } from "./sampling-DBng4Foa.js";
|
|
4
4
|
import { o as EventSubscriber } from "./event-subscriber-DMACQA-1.js";
|
|
5
5
|
import { r as SpanFilterPredicate } from "./filtering-span-processor-BpDagWNa.js";
|
|
6
6
|
import { r as Policy } from "./policy-CbpP4tFH.js";
|
package/dist/instrumentation.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-DmM7dprX.cjs');
|
|
3
3
|
const require_node_require = require('./node-require-EifOMikz.cjs');
|
|
4
|
-
const require_tail_sampling_processor = require('./tail-sampling-processor.cjs');
|
|
5
4
|
let _opentelemetry_sdk_node = require("@opentelemetry/sdk-node");
|
|
6
5
|
let _opentelemetry_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
7
6
|
let _opentelemetry_resources = require("@opentelemetry/resources");
|
|
@@ -119,7 +118,7 @@ async function initInstrumentation(config) {
|
|
|
119
118
|
});
|
|
120
119
|
let instrumentations = config.instrumentations || [];
|
|
121
120
|
if (config.selectiveInstrumentation === false) instrumentations = [require_node_require.requireModule("@opentelemetry/auto-instrumentations-node").getNodeAutoInstrumentations()];
|
|
122
|
-
const spanProcessor = new
|
|
121
|
+
const spanProcessor = new require_init.TailSamplingSpanProcessor(new _opentelemetry_sdk_trace_base.BatchSpanProcessor(new _opentelemetry_exporter_trace_otlp_http.OTLPTraceExporter({
|
|
123
122
|
url: `${config.otlpEndpoint || "http://localhost:4318"}/v1/traces`,
|
|
124
123
|
headers: otlpHeaders
|
|
125
124
|
})));
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as getLogger, x as TailSamplingSpanProcessor } from "./init-CsKK9vZO.js";
|
|
2
2
|
import { n as safeRequire, t as requireModule } from "./node-require-DSPjaw_l.js";
|
|
3
|
-
import { TailSamplingSpanProcessor } from "./tail-sampling-processor.js";
|
|
4
3
|
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
5
4
|
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
6
5
|
import { detectResources, hostDetector, processDetector, resourceFromAttributes } from "@opentelemetry/resources";
|
package/dist/messaging.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_values = require('./values-DApyq53y.cjs');
|
|
3
|
-
const
|
|
4
|
-
const require_functional = require('./functional-
|
|
3
|
+
const require_init = require('./init-DmM7dprX.cjs');
|
|
4
|
+
const require_functional = require('./functional-DHlD7V0x.cjs');
|
|
5
5
|
const require_correlated_events = require('./correlated-events-CcuknWnU.cjs');
|
|
6
6
|
const require_trace_factory_validation = require('./trace-factory-validation-Dc8epn87.cjs');
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -531,7 +531,7 @@ async function extractAndAddLinks(ctx, config, args, linkStorage) {
|
|
|
531
531
|
if (config.batchMode && Array.isArray(args[0])) {
|
|
532
532
|
const messages = args[0];
|
|
533
533
|
if (config.headersFrom) {
|
|
534
|
-
const batchLinks =
|
|
534
|
+
const batchLinks = require_init.extractLinksFromBatch(messages.map((msg) => {
|
|
535
535
|
return { headers: extractHeaders(config.headersFrom, msg) };
|
|
536
536
|
}), "headers");
|
|
537
537
|
links.push(...batchLinks);
|
|
@@ -539,7 +539,7 @@ async function extractAndAddLinks(ctx, config, args, linkStorage) {
|
|
|
539
539
|
if (config.customContextExtractor && config.headersFrom) for (const msg of messages) {
|
|
540
540
|
const headers = extractHeaders(config.headersFrom, msg);
|
|
541
541
|
if (headers) {
|
|
542
|
-
if (!
|
|
542
|
+
if (!require_init.createLinkFromHeaders(headers)) {
|
|
543
543
|
const customContext = config.customContextExtractor(headers);
|
|
544
544
|
if (customContext) links.push({
|
|
545
545
|
context: customContext,
|
|
@@ -553,7 +553,7 @@ async function extractAndAddLinks(ctx, config, args, linkStorage) {
|
|
|
553
553
|
const msg = args[0];
|
|
554
554
|
const headers = config.headersFrom ? extractHeaders(config.headersFrom, msg) : void 0;
|
|
555
555
|
if (headers) {
|
|
556
|
-
const w3cLink =
|
|
556
|
+
const w3cLink = require_init.createLinkFromHeaders(headers);
|
|
557
557
|
if (w3cLink) links.push(w3cLink);
|
|
558
558
|
else if (config.customContextExtractor) {
|
|
559
559
|
const customContext = config.customContextExtractor(headers);
|
package/dist/messaging.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as readProperty, b as toAttributeValue, c as asScalar, g as nonEmptyString, h as isFunction, s as asRecord, v as resolveValue, y as splitNameOrOptions } from "./values-BenyvWKz.js";
|
|
2
|
-
import { createLinkFromHeaders, extractLinksFromBatch } from "./
|
|
3
|
-
import { c as withTracing } from "./functional-
|
|
2
|
+
import { F as createLinkFromHeaders, L as extractLinksFromBatch } from "./init-CsKK9vZO.js";
|
|
3
|
+
import { c as withTracing } from "./functional-C4js2vTM.js";
|
|
4
4
|
import { t as emitCorrelatedEvent } from "./correlated-events-DwMMbItg.js";
|
|
5
5
|
import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
|
|
6
6
|
import { SpanKind, context, propagation } from "@opentelemetry/api";
|
|
@@ -15,6 +15,23 @@ declare const AUTOTEL_SAMPLING_TAIL_EVALUATED = "autotel.sampling.tail.evaluated
|
|
|
15
15
|
* attribute only when N exceeds 1, so fully captured spans stay clean.
|
|
16
16
|
*/
|
|
17
17
|
declare const AUTOTEL_SAMPLING_RATE = "autotel.sampling.rate";
|
|
18
|
+
/**
|
|
19
|
+
* Spans an explicit `forceKeep()` claimed.
|
|
20
|
+
*
|
|
21
|
+
* The tracing wrapper writes the sampler's tail verdict once the body has
|
|
22
|
+
* run, which is after any `forceKeep()` inside it. Without this the verdict
|
|
23
|
+
* overwrites the override and the span the caller insisted on is dropped.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Baggage key that turns on full-fidelity capture for a request.
|
|
27
|
+
*
|
|
28
|
+
* Baggage arrives on the request and propagates, so a gateway, a proxy, a
|
|
29
|
+
* feature flag or a curl can turn this on for one user and it follows them
|
|
30
|
+
* across every service. Nobody deploys anything to debug a live problem.
|
|
31
|
+
*/
|
|
32
|
+
declare const AUTOTEL_DEBUG_BAGGAGE_KEY = "autotel.debug";
|
|
33
|
+
declare function markForceKept(span: object): void;
|
|
34
|
+
declare function isForceKept(span: object): boolean;
|
|
18
35
|
/**
|
|
19
36
|
* Map a string to a stable, evenly spread position in the unit interval.
|
|
20
37
|
*
|
|
@@ -462,5 +479,7 @@ declare function createLinkFromHeaders(headers: Record<string, string>, attribut
|
|
|
462
479
|
* ```
|
|
463
480
|
*/
|
|
464
481
|
declare function extractLinksFromBatch(messages: UnknownRecord[], headersKey?: string): Link[];
|
|
482
|
+
/** True when the request in flight asked for full-fidelity capture. */
|
|
483
|
+
declare function debugCaptureRequested(): boolean;
|
|
465
484
|
//#endregion
|
|
466
|
-
export {
|
|
485
|
+
export { markForceKept as C, isForceKept as S, samplingPresets as T, UserIdSampler as _, AdaptiveSampler as a, extractLinksFromBatch as b, DeterministicSampler as c, NeverSampler as d, OperationResult as f, SamplingPreset as g, SamplingContext as h, AUTOTEL_SAMPLING_TAIL_KEEP as i, FeatureFlagSampler as l, Sampler as m, AUTOTEL_SAMPLING_RATE as n, AlwaysSampler as o, RandomSampler as p, AUTOTEL_SAMPLING_TAIL_EVALUATED as r, CompositeSampler as s, AUTOTEL_DEBUG_BAGGAGE_KEY as t, KeyTargetRateSampler as u, createLinkFromHeaders as v, resolveSamplingPreset as w, hashUnitInterval as x, debugCaptureRequested as y };
|
|
@@ -15,6 +15,23 @@ declare const AUTOTEL_SAMPLING_TAIL_EVALUATED = "autotel.sampling.tail.evaluated
|
|
|
15
15
|
* attribute only when N exceeds 1, so fully captured spans stay clean.
|
|
16
16
|
*/
|
|
17
17
|
declare const AUTOTEL_SAMPLING_RATE = "autotel.sampling.rate";
|
|
18
|
+
/**
|
|
19
|
+
* Spans an explicit `forceKeep()` claimed.
|
|
20
|
+
*
|
|
21
|
+
* The tracing wrapper writes the sampler's tail verdict once the body has
|
|
22
|
+
* run, which is after any `forceKeep()` inside it. Without this the verdict
|
|
23
|
+
* overwrites the override and the span the caller insisted on is dropped.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Baggage key that turns on full-fidelity capture for a request.
|
|
27
|
+
*
|
|
28
|
+
* Baggage arrives on the request and propagates, so a gateway, a proxy, a
|
|
29
|
+
* feature flag or a curl can turn this on for one user and it follows them
|
|
30
|
+
* across every service. Nobody deploys anything to debug a live problem.
|
|
31
|
+
*/
|
|
32
|
+
declare const AUTOTEL_DEBUG_BAGGAGE_KEY = "autotel.debug";
|
|
33
|
+
declare function markForceKept(span: object): void;
|
|
34
|
+
declare function isForceKept(span: object): boolean;
|
|
18
35
|
/**
|
|
19
36
|
* Map a string to a stable, evenly spread position in the unit interval.
|
|
20
37
|
*
|
|
@@ -462,5 +479,7 @@ declare function createLinkFromHeaders(headers: Record<string, string>, attribut
|
|
|
462
479
|
* ```
|
|
463
480
|
*/
|
|
464
481
|
declare function extractLinksFromBatch(messages: UnknownRecord[], headersKey?: string): Link[];
|
|
482
|
+
/** True when the request in flight asked for full-fidelity capture. */
|
|
483
|
+
declare function debugCaptureRequested(): boolean;
|
|
465
484
|
//#endregion
|
|
466
|
-
export {
|
|
485
|
+
export { markForceKept as C, isForceKept as S, samplingPresets as T, UserIdSampler as _, AdaptiveSampler as a, extractLinksFromBatch as b, DeterministicSampler as c, NeverSampler as d, OperationResult as f, SamplingPreset as g, SamplingContext as h, AUTOTEL_SAMPLING_TAIL_KEEP as i, FeatureFlagSampler as l, Sampler as m, AUTOTEL_SAMPLING_RATE as n, AlwaysSampler as o, RandomSampler as p, AUTOTEL_SAMPLING_TAIL_EVALUATED as r, CompositeSampler as s, AUTOTEL_DEBUG_BAGGAGE_KEY as t, KeyTargetRateSampler as u, createLinkFromHeaders as v, resolveSamplingPreset as w, hashUnitInterval as x, debugCaptureRequested as y };
|