autotel 4.2.5 → 5.0.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 +125 -103
- package/dist/analysis.cjs +87 -0
- package/dist/analysis.cjs.map +1 -0
- package/dist/analysis.d.cts +87 -0
- package/dist/analysis.d.cts.map +1 -0
- package/dist/analysis.d.ts +87 -0
- package/dist/analysis.d.ts.map +1 -0
- package/dist/analysis.js +85 -0
- package/dist/analysis.js.map +1 -0
- package/dist/{attribute-redacting-processor-DtTS9xxh.d.ts → attribute-redacting-processor-Pk7lAzWd.d.cts} +13 -8
- package/dist/attribute-redacting-processor-Pk7lAzWd.d.cts.map +1 -0
- package/dist/{attribute-redacting-processor-DtTS9xxh.d.cts → attribute-redacting-processor-Pk7lAzWd.d.ts} +13 -8
- package/dist/attribute-redacting-processor-Pk7lAzWd.d.ts.map +1 -0
- package/dist/attribute-redacting-processor.cjs +4 -4
- package/dist/attribute-redacting-processor.cjs.map +1 -1
- package/dist/attribute-redacting-processor.d.cts +1 -1
- package/dist/attribute-redacting-processor.d.ts +1 -1
- package/dist/attribute-redacting-processor.js +4 -4
- package/dist/attribute-redacting-processor.js.map +1 -1
- package/dist/attributes.d.cts +1 -1
- package/dist/attributes.d.ts +1 -1
- package/dist/auto.cjs +1 -1
- package/dist/auto.cjs.map +1 -1
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/auto.js.map +1 -1
- package/dist/business-baggage.d.cts +2 -3
- package/dist/business-baggage.d.cts.map +1 -1
- package/dist/business-baggage.d.ts +2 -3
- package/dist/business-baggage.d.ts.map +1 -1
- package/dist/{canonical-log-line-processor-xvjMgtpF.d.cts → canonical-log-line-processor-B4WgG-VS.d.cts} +2 -3
- package/dist/canonical-log-line-processor-B4WgG-VS.d.cts.map +1 -0
- package/dist/{canonical-log-line-processor-BcRuAdRk.d.ts → canonical-log-line-processor-CL_J7gb5.d.ts} +2 -3
- package/dist/canonical-log-line-processor-CL_J7gb5.d.ts.map +1 -0
- package/dist/{canonical-log-line-processor-CcrDi6TO.cjs → canonical-log-line-processor-DOjb6Kxy.cjs} +5 -5
- package/dist/canonical-log-line-processor-DOjb6Kxy.cjs.map +1 -0
- package/dist/{canonical-log-line-processor-FLezvFCB.js → canonical-log-line-processor-mKABvGP0.js} +5 -5
- package/dist/canonical-log-line-processor-mKABvGP0.js.map +1 -0
- package/dist/config.d.cts +12 -7
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.ts +12 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.d.cts +0 -1
- package/dist/correlation-id.d.cts.map +1 -1
- package/dist/correlation-id.d.ts +0 -1
- package/dist/correlation-id.d.ts.map +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/db.d.cts.map +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.cjs.map +1 -1
- package/dist/decorators.d.cts +1 -2
- package/dist/decorators.d.cts.map +1 -1
- package/dist/decorators.d.ts +1 -2
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +1 -1
- package/dist/decorators.js.map +1 -1
- package/dist/{define-event-CreknLm3.d.ts → define-event-B2z1SBe7.d.ts} +2 -3
- package/dist/define-event-B2z1SBe7.d.ts.map +1 -0
- package/dist/{define-event-HZRizPwz.d.cts → define-event-CGG048HE.d.cts} +2 -3
- package/dist/define-event-CGG048HE.d.cts.map +1 -0
- package/dist/diagnostics.cjs +10 -1
- package/dist/diagnostics.cjs.map +1 -1
- package/dist/diagnostics.d.cts +0 -1
- package/dist/diagnostics.d.cts.map +1 -1
- package/dist/diagnostics.d.ts +0 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +10 -1
- package/dist/diagnostics.js.map +1 -1
- package/dist/drain-pipeline.d.cts +12 -5
- package/dist/drain-pipeline.d.cts.map +1 -1
- package/dist/drain-pipeline.d.ts +12 -5
- package/dist/drain-pipeline.d.ts.map +1 -1
- package/dist/enrichers.d.cts.map +1 -1
- package/dist/enrichers.d.ts.map +1 -1
- package/dist/{event-rzA1X5h3.cjs → event-CwIpFdoY.cjs} +3 -3
- package/dist/event-CwIpFdoY.cjs.map +1 -0
- package/dist/{event-BEm5IJ8U.js → event-pLMF5b3d.js} +4 -4
- package/dist/event-pLMF5b3d.js.map +1 -0
- package/dist/{event-subscriber-D1XLkPzi.d.ts → event-subscriber-CWh8sTGh.d.cts} +2 -2
- package/dist/event-subscriber-CWh8sTGh.d.cts.map +1 -0
- package/dist/{event-subscriber-D1XLkPzi.d.cts → event-subscriber-CWh8sTGh.d.ts} +2 -2
- package/dist/event-subscriber-CWh8sTGh.d.ts.map +1 -0
- package/dist/event-subscriber.d.cts +1 -1
- package/dist/event-subscriber.d.ts +1 -1
- package/dist/{event-testing-CfFs3to2.d.ts → event-testing-CA2mIx1E.d.ts} +2 -3
- package/dist/event-testing-CA2mIx1E.d.ts.map +1 -0
- package/dist/{event-testing-BqRnI0z4.d.cts → event-testing-D0qWfqAy.d.cts} +2 -3
- package/dist/event-testing-D0qWfqAy.d.cts.map +1 -0
- package/dist/event-testing.d.cts +1 -1
- package/dist/event-testing.d.ts +1 -1
- package/dist/event.cjs +1 -1
- package/dist/event.d.cts +3 -4
- package/dist/event.d.cts.map +1 -1
- package/dist/event.d.ts +3 -4
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +1 -1
- package/dist/exporters.d.cts +0 -4
- package/dist/exporters.d.cts.map +1 -1
- package/dist/exporters.d.ts +0 -4
- package/dist/exporters.d.ts.map +1 -1
- package/dist/{filtering-span-processor-B8R8B7Uk.d.ts → filtering-span-processor-BpDagWNa.d.cts} +1 -2
- package/dist/filtering-span-processor-BpDagWNa.d.cts.map +1 -0
- package/dist/{filtering-span-processor-B8R8B7Uk.d.cts → filtering-span-processor-BpDagWNa.d.ts} +1 -2
- package/dist/filtering-span-processor-BpDagWNa.d.ts.map +1 -0
- package/dist/filtering-span-processor.d.cts +1 -1
- package/dist/filtering-span-processor.d.ts +1 -1
- package/dist/functional-Bit6noRu.js +840 -0
- package/dist/functional-Bit6noRu.js.map +1 -0
- package/dist/functional-Cj7PSItS.cjs +890 -0
- package/dist/functional-Cj7PSItS.cjs.map +1 -0
- package/dist/functional.cjs +2 -2
- package/dist/functional.d.cts +79 -130
- package/dist/functional.d.cts.map +1 -1
- package/dist/functional.d.ts +79 -130
- package/dist/functional.d.ts.map +1 -1
- package/dist/functional.js +2 -2
- package/dist/http.cjs +5 -5
- package/dist/http.cjs.map +1 -1
- package/dist/http.d.cts +4 -5
- package/dist/http.d.cts.map +1 -1
- package/dist/http.d.ts +4 -5
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +5 -5
- package/dist/http.js.map +1 -1
- package/dist/{index-eKuioqT1.d.cts → index-BPcxVucm.d.cts} +2 -3
- package/dist/index-BPcxVucm.d.cts.map +1 -0
- package/dist/{index-Ck06vlW2.d.ts → index-DolOVX6F.d.ts} +2 -3
- package/dist/index-DolOVX6F.d.ts.map +1 -0
- package/dist/index.cjs +10 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -14
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +14 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -16
- package/dist/index.js.map +1 -1
- package/dist/{init-BxJEJ9Tn.cjs → init-B2uvZReD.cjs} +19 -10
- package/dist/init-B2uvZReD.cjs.map +1 -0
- package/dist/{init-B7u-DjxM.d.ts → init-CTyqG9qR.d.ts} +24 -17
- package/dist/init-CTyqG9qR.d.ts.map +1 -0
- package/dist/{init-BvBB45-T.js → init-CdEWjhvl.js} +20 -11
- package/dist/init-CdEWjhvl.js.map +1 -0
- package/dist/{init-DSrRmVnz.d.cts → init-a4yPDYqC.d.cts} +24 -17
- package/dist/init-a4yPDYqC.d.cts.map +1 -0
- package/dist/instrumentation.cjs +7 -13
- package/dist/instrumentation.cjs.map +1 -1
- package/dist/instrumentation.d.cts +0 -1
- package/dist/instrumentation.d.cts.map +1 -1
- package/dist/instrumentation.d.ts +0 -1
- package/dist/instrumentation.d.ts.map +1 -1
- package/dist/instrumentation.js +8 -14
- package/dist/instrumentation.js.map +1 -1
- package/dist/{logger-BauSUhUv.d.ts → logger-CN4xpzMd.d.cts} +1 -2
- package/dist/logger-CN4xpzMd.d.cts.map +1 -0
- package/dist/{logger-BauSUhUv.d.cts → logger-CN4xpzMd.d.ts} +1 -2
- package/dist/logger-CN4xpzMd.d.ts.map +1 -0
- package/dist/logger-D3Ej3DII.js.map +1 -1
- package/dist/logger-thMPLpOG.cjs.map +1 -1
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/messaging-adapters.cjs.map +1 -1
- package/dist/messaging-adapters.d.cts +0 -1
- package/dist/messaging-adapters.d.cts.map +1 -1
- package/dist/messaging-adapters.d.ts +0 -1
- package/dist/messaging-adapters.d.ts.map +1 -1
- package/dist/messaging-adapters.js.map +1 -1
- package/dist/messaging-testing.d.cts +0 -1
- package/dist/messaging-testing.d.cts.map +1 -1
- package/dist/messaging-testing.d.ts +0 -1
- package/dist/messaging-testing.d.ts.map +1 -1
- package/dist/messaging.cjs +27 -10
- package/dist/messaging.cjs.map +1 -1
- package/dist/messaging.d.cts +6 -7
- package/dist/messaging.d.cts.map +1 -1
- package/dist/messaging.d.ts +6 -7
- package/dist/messaging.d.ts.map +1 -1
- package/dist/messaging.js +27 -10
- package/dist/messaging.js.map +1 -1
- package/dist/metric-helpers.d.cts +0 -1
- package/dist/metric-helpers.d.cts.map +1 -1
- package/dist/metric-helpers.d.ts +0 -1
- package/dist/metric-helpers.d.ts.map +1 -1
- package/dist/{metric-testing-DXdK3-Q3.d.ts → metric-testing-CWm6UhaR.d.ts} +2 -3
- package/dist/metric-testing-CWm6UhaR.d.ts.map +1 -0
- package/dist/{metric-testing-MxvzChDp.d.cts → metric-testing-CpvP3ZIa.d.cts} +2 -3
- package/dist/metric-testing-CpvP3ZIa.d.cts.map +1 -0
- package/dist/metric-testing.d.cts +1 -1
- package/dist/metric-testing.d.ts +1 -1
- package/dist/metric.d.cts +3 -4
- package/dist/metric.d.cts.map +1 -1
- package/dist/metric.d.ts +3 -4
- package/dist/metric.d.ts.map +1 -1
- package/dist/parse-error.d.cts.map +1 -1
- package/dist/parse-error.d.ts.map +1 -1
- package/dist/processors.cjs +1 -1
- package/dist/processors.d.cts +1 -1
- package/dist/processors.d.ts +1 -1
- package/dist/processors.js +1 -1
- package/dist/register.d.cts +1 -1
- package/dist/register.d.ts +1 -1
- package/dist/{sampling-DfYhDJij.d.cts → sampling-BR9fkSwx.d.cts} +127 -10
- package/dist/sampling-BR9fkSwx.d.cts.map +1 -0
- package/dist/{sampling-CR0Va1VB.d.ts → sampling-CP3e7-Yr.d.ts} +127 -10
- package/dist/sampling-CP3e7-Yr.d.ts.map +1 -0
- package/dist/sampling.cjs +160 -12
- package/dist/sampling.cjs.map +1 -1
- package/dist/sampling.d.cts +2 -2
- package/dist/sampling.d.ts +2 -2
- package/dist/sampling.js +157 -13
- package/dist/sampling.js.map +1 -1
- package/dist/security-schema.d.cts +9 -4
- package/dist/security-schema.d.cts.map +1 -1
- package/dist/security-schema.d.ts +9 -4
- package/dist/security-schema.d.ts.map +1 -1
- package/dist/semantic-conventions-FhSxv-bK.d.cts.map +1 -1
- package/dist/semantic-conventions-FhSxv-bK.d.ts.map +1 -1
- package/dist/semantic-conventions.cjs.map +1 -1
- package/dist/semantic-conventions.js.map +1 -1
- package/dist/semantic-helpers.cjs +85 -304
- package/dist/semantic-helpers.cjs.map +1 -1
- package/dist/semantic-helpers.d.cts +21 -12
- package/dist/semantic-helpers.d.cts.map +1 -1
- package/dist/semantic-helpers.d.ts +21 -12
- package/dist/semantic-helpers.d.ts.map +1 -1
- package/dist/semantic-helpers.js +85 -304
- package/dist/semantic-helpers.js.map +1 -1
- package/dist/slo.cjs +225 -0
- package/dist/slo.cjs.map +1 -0
- package/dist/slo.d.cts +97 -0
- package/dist/slo.d.cts.map +1 -0
- package/dist/slo.d.ts +97 -0
- package/dist/slo.d.ts.map +1 -0
- package/dist/slo.js +223 -0
- package/dist/slo.js.map +1 -0
- package/dist/{span-name-normalizer-8ZOGJuwv.d.ts → span-name-normalizer-CN1-8C76.d.cts} +1 -2
- package/dist/span-name-normalizer-CN1-8C76.d.cts.map +1 -0
- package/dist/{span-name-normalizer-8ZOGJuwv.d.cts → span-name-normalizer-CN1-8C76.d.ts} +1 -2
- package/dist/span-name-normalizer-CN1-8C76.d.ts.map +1 -0
- package/dist/span-name-normalizer.cjs.map +1 -1
- package/dist/span-name-normalizer.d.cts +1 -1
- package/dist/span-name-normalizer.d.ts +1 -1
- package/dist/span-name-normalizer.js.map +1 -1
- package/dist/tail-sampling-processor.d.cts +0 -1
- package/dist/tail-sampling-processor.d.cts.map +1 -1
- package/dist/tail-sampling-processor.d.ts +0 -1
- package/dist/tail-sampling-processor.d.ts.map +1 -1
- package/dist/test-span-collector.cjs +13 -1
- package/dist/test-span-collector.cjs.map +1 -1
- package/dist/test-span-collector.d.cts +8 -1
- package/dist/test-span-collector.d.cts.map +1 -1
- package/dist/test-span-collector.d.ts +8 -1
- package/dist/test-span-collector.d.ts.map +1 -1
- package/dist/test-span-collector.js +13 -1
- package/dist/test-span-collector.js.map +1 -1
- package/dist/testing.cjs +76 -11
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +30 -5
- package/dist/testing.d.cts.map +1 -1
- package/dist/testing.d.ts +30 -5
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +73 -12
- package/dist/testing.js.map +1 -1
- package/dist/{trace-context-Cijqoi6e.d.ts → trace-context-IuyoPyNq.d.cts} +9 -9
- package/dist/trace-context-IuyoPyNq.d.cts.map +1 -0
- package/dist/{trace-context-Cijqoi6e.d.cts → trace-context-IuyoPyNq.d.ts} +9 -9
- package/dist/trace-context-IuyoPyNq.d.ts.map +1 -0
- package/dist/trace-factory-validation-BjVAinz6.js +13 -0
- package/dist/trace-factory-validation-BjVAinz6.js.map +1 -0
- package/dist/trace-factory-validation-Dc8epn87.cjs +19 -0
- package/dist/trace-factory-validation-Dc8epn87.cjs.map +1 -0
- package/dist/trace-helpers.cjs +7 -7
- package/dist/trace-helpers.cjs.map +1 -1
- package/dist/trace-helpers.d.cts +6 -7
- package/dist/trace-helpers.d.cts.map +1 -1
- package/dist/trace-helpers.d.ts +6 -7
- package/dist/trace-helpers.d.ts.map +1 -1
- package/dist/trace-helpers.js +7 -7
- package/dist/trace-helpers.js.map +1 -1
- package/dist/tracer-provider.cjs +27 -0
- package/dist/tracer-provider.cjs.map +1 -1
- package/dist/tracer-provider.d.cts +19 -2
- package/dist/tracer-provider.d.cts.map +1 -1
- package/dist/tracer-provider.d.ts +19 -2
- package/dist/tracer-provider.d.ts.map +1 -1
- package/dist/tracer-provider.js +27 -1
- package/dist/tracer-provider.js.map +1 -1
- package/dist/{track-D7O7oIZa.js → track-BBcxEJEC.js} +7 -12
- package/dist/track-BBcxEJEC.js.map +1 -0
- package/dist/{track-eovhCJ-I.cjs → track-BI6dmZ2X.cjs} +6 -17
- package/dist/track-BI6dmZ2X.cjs.map +1 -0
- package/dist/validate.cjs.map +1 -1
- package/dist/validate.d.cts +1 -2
- package/dist/validate.d.cts.map +1 -1
- package/dist/validate.d.ts +1 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js.map +1 -1
- package/dist/validation-attributes.d.cts +17 -8
- package/dist/validation-attributes.d.cts.map +1 -1
- package/dist/validation-attributes.d.ts +17 -8
- package/dist/validation-attributes.d.ts.map +1 -1
- package/dist/webhook.cjs +5 -4
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +4 -4
- package/dist/webhook.d.cts.map +1 -1
- package/dist/webhook.d.ts +4 -4
- package/dist/webhook.d.ts.map +1 -1
- package/dist/webhook.js +5 -4
- package/dist/webhook.js.map +1 -1
- package/dist/workflow-distributed.cjs +5 -5
- package/dist/workflow-distributed.cjs.map +1 -1
- package/dist/workflow-distributed.d.cts +25 -15
- package/dist/workflow-distributed.d.cts.map +1 -1
- package/dist/workflow-distributed.d.ts +25 -15
- package/dist/workflow-distributed.d.ts.map +1 -1
- package/dist/workflow-distributed.js +5 -5
- package/dist/workflow-distributed.js.map +1 -1
- package/dist/workflow.cjs +24 -30
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +11 -6
- package/dist/workflow.d.cts.map +1 -1
- package/dist/workflow.d.ts +11 -6
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +24 -30
- package/dist/workflow.js.map +1 -1
- package/dist/yaml-config.d.cts +2 -3
- package/dist/yaml-config.d.cts.map +1 -1
- package/dist/yaml-config.d.ts +2 -3
- package/dist/yaml-config.d.ts.map +1 -1
- package/package.json +23 -14
- package/skills/analyze-traces/SKILL.md +42 -13
- package/skills/autotel-core/SKILL.md +24 -17
- package/skills/autotel-events/SKILL.md +1 -1
- package/skills/autotel-frameworks/SKILL.md +41 -6
- package/skills/autotel-instrumentation/SKILL.md +14 -9
- package/skills/autotel-request-logging/SKILL.md +19 -14
- package/skills/autotel-structured-errors/SKILL.md +2 -2
- package/skills/build-audit-trails/SKILL.md +11 -11
- package/skills/build-audit-trails/references/audit-queries.md +3 -3
- package/skills/debug-missing-spans/SKILL.md +12 -12
- package/skills/migrate-to-autotel/SKILL.md +20 -20
- package/skills/review-otel-patterns/SKILL.md +44 -42
- package/skills/review-otel-patterns/references/code-review.md +4 -4
- package/skills/review-otel-patterns/references/processor-pipeline.md +3 -3
- package/skills/review-otel-patterns/references/structured-errors.md +1 -1
- package/skills/review-otel-patterns/references/wide-spans.md +2 -2
- package/skills/tune-sampling/SKILL.md +91 -16
- package/dist/attribute-redacting-processor-DtTS9xxh.d.cts.map +0 -1
- package/dist/attribute-redacting-processor-DtTS9xxh.d.ts.map +0 -1
- package/dist/canonical-log-line-processor-BcRuAdRk.d.ts.map +0 -1
- package/dist/canonical-log-line-processor-CcrDi6TO.cjs.map +0 -1
- package/dist/canonical-log-line-processor-FLezvFCB.js.map +0 -1
- package/dist/canonical-log-line-processor-xvjMgtpF.d.cts.map +0 -1
- package/dist/define-event-CreknLm3.d.ts.map +0 -1
- package/dist/define-event-HZRizPwz.d.cts.map +0 -1
- package/dist/event-BEm5IJ8U.js.map +0 -1
- package/dist/event-rzA1X5h3.cjs.map +0 -1
- package/dist/event-subscriber-D1XLkPzi.d.cts.map +0 -1
- package/dist/event-subscriber-D1XLkPzi.d.ts.map +0 -1
- package/dist/event-testing-BqRnI0z4.d.cts.map +0 -1
- package/dist/event-testing-CfFs3to2.d.ts.map +0 -1
- package/dist/filtering-span-processor-B8R8B7Uk.d.cts.map +0 -1
- package/dist/filtering-span-processor-B8R8B7Uk.d.ts.map +0 -1
- package/dist/functional-BCtxvYir.cjs +0 -1315
- package/dist/functional-BCtxvYir.cjs.map +0 -1
- package/dist/functional-CrAq8Az8.js +0 -1265
- package/dist/functional-CrAq8Az8.js.map +0 -1
- package/dist/index-Ck06vlW2.d.ts.map +0 -1
- package/dist/index-eKuioqT1.d.cts.map +0 -1
- package/dist/init-B7u-DjxM.d.ts.map +0 -1
- package/dist/init-BvBB45-T.js.map +0 -1
- package/dist/init-BxJEJ9Tn.cjs.map +0 -1
- package/dist/init-DSrRmVnz.d.cts.map +0 -1
- package/dist/logger-BauSUhUv.d.cts.map +0 -1
- package/dist/logger-BauSUhUv.d.ts.map +0 -1
- package/dist/metric-testing-DXdK3-Q3.d.ts.map +0 -1
- package/dist/metric-testing-MxvzChDp.d.cts.map +0 -1
- package/dist/sampling-CR0Va1VB.d.ts.map +0 -1
- package/dist/sampling-DfYhDJij.d.cts.map +0 -1
- package/dist/span-name-normalizer-8ZOGJuwv.d.cts.map +0 -1
- package/dist/span-name-normalizer-8ZOGJuwv.d.ts.map +0 -1
- package/dist/trace-context-Cijqoi6e.d.cts.map +0 -1
- package/dist/trace-context-Cijqoi6e.d.ts.map +0 -1
- package/dist/track-D7O7oIZa.js.map +0 -1
- package/dist/track-eovhCJ-I.cjs.map +0 -1
package/dist/metric.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { s as Logger } from "./logger-
|
|
2
|
-
import { c as OutcomeStatus, n as EventAttributes, s as FunnelStatus } from "./event-subscriber-
|
|
3
|
-
import { t as MetricsCollector } from "./metric-testing-
|
|
4
|
-
|
|
1
|
+
import { s as Logger } from "./logger-CN4xpzMd.js";
|
|
2
|
+
import { c as OutcomeStatus, n as EventAttributes, s as FunnelStatus } from "./event-subscriber-CWh8sTGh.js";
|
|
3
|
+
import { t as MetricsCollector } from "./metric-testing-CWm6UhaR.js";
|
|
5
4
|
//#region src/metric.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Metrics class for tracking business metrics in OpenTelemetry
|
package/dist/metric.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metric.d.ts","names":[],"sources":["../src/metric.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"metric.d.ts","names":[],"sources":["../src/metric.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAgEiB;;EAEf;;EAEA;;EAEA;;;;;UAMe;;EAEf,SAAS;;EAET,YAAY;;;;;EAMZ;;;;;EAMA;IACE,SAAS;IACT,SAAS;IACT,WAAW;IACX,QAAQ;;;cAIC;UACH;UACA;UACA;UACA;UACA;UACA;UACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCI,YAAA,qBAAqB,UAAS;;;;;;;;;;;;;;;;;;;;;;;;EA8E1C,WAAW,mBAAmB,aAAa;;;;;;;;;;;;;;;;;;;EA4C3C,gBACE,oBACA,QAAQ,cACR,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAqDf,aACE,uBACA,QAAQ,eACR,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDf,WACE,oBACA,eACA,aAAa;;;;;;;;;;;;;;;iBAgDD,WAAW,qBAAqB,SAAS,SAAS;;;;iBAUlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-error.d.cts","names":[],"sources":["../src/parse-error.ts"],"mappings":";UAEiB
|
|
1
|
+
{"version":3,"file":"parse-error.d.cts","names":[],"sources":["../src/parse-error.ts"],"mappings":";UAEiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;EACV;;iBAwCc,WAAW,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-error.d.ts","names":[],"sources":["../src/parse-error.ts"],"mappings":";UAEiB
|
|
1
|
+
{"version":3,"file":"parse-error.d.ts","names":[],"sources":["../src/parse-error.ts"],"mappings":";UAEiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;EACV;;iBAwCc,WAAW,iBAAiB"}
|
package/dist/processors.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_canonical_log_line_processor = require('./canonical-log-line-processor-
|
|
2
|
+
const require_canonical_log_line_processor = require('./canonical-log-line-processor-DOjb6Kxy.cjs');
|
|
3
3
|
let _opentelemetry_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, 'BatchSpanProcessor', {
|
package/dist/processors.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-
|
|
1
|
+
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-B4WgG-VS.cjs";
|
|
2
2
|
import { BatchSpanProcessor, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
3
3
|
export { BatchSpanProcessor, type CanonicalLogLineOptions, CanonicalLogLineProcessor, SimpleSpanProcessor };
|
package/dist/processors.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-
|
|
1
|
+
import { n as CanonicalLogLineProcessor, t as CanonicalLogLineOptions } from "./canonical-log-line-processor-CL_J7gb5.js";
|
|
2
2
|
import { BatchSpanProcessor, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
3
3
|
export { BatchSpanProcessor, type CanonicalLogLineOptions, CanonicalLogLineProcessor, SimpleSpanProcessor };
|
package/dist/processors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CanonicalLogLineProcessor } from "./canonical-log-line-processor-
|
|
1
|
+
import { t as CanonicalLogLineProcessor } from "./canonical-log-line-processor-mKABvGP0.js";
|
|
2
2
|
import { BatchSpanProcessor, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
3
3
|
|
|
4
4
|
export { BatchSpanProcessor, CanonicalLogLineProcessor, SimpleSpanProcessor };
|
package/dist/register.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/register.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
import { s as Logger } from "./logger-
|
|
1
|
+
import { s as Logger } from "./logger-CN4xpzMd.cjs";
|
|
2
2
|
import { Attributes, Link } from "@opentelemetry/api";
|
|
3
|
-
|
|
4
3
|
//#region src/sampling.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Tail sampling attribute keys (autotel-internal, not OTel semconv)
|
|
7
6
|
*/
|
|
8
7
|
declare const AUTOTEL_SAMPLING_TAIL_KEEP = "autotel.sampling.tail.keep";
|
|
9
8
|
declare const AUTOTEL_SAMPLING_TAIL_EVALUATED = "autotel.sampling.tail.evaluated";
|
|
9
|
+
/**
|
|
10
|
+
* How many events each kept event stands for, expressed as "1 in N".
|
|
11
|
+
*
|
|
12
|
+
* A query that counts sampled spans undercounts the population. Multiplying
|
|
13
|
+
* each kept event by this rate restores the estimate. Autotel records the
|
|
14
|
+
* attribute only when N exceeds 1, so fully captured spans stay clean.
|
|
15
|
+
*/
|
|
16
|
+
declare const AUTOTEL_SAMPLING_RATE = "autotel.sampling.rate";
|
|
17
|
+
/**
|
|
18
|
+
* Map a string to a stable, evenly spread position in the unit interval.
|
|
19
|
+
*
|
|
20
|
+
* Two processes that hash the same key reach the same number, which is what
|
|
21
|
+
* lets independent services agree on one trace's sampling decision.
|
|
22
|
+
*
|
|
23
|
+
* The spread matters as much as the stability. Real sampling keys share long
|
|
24
|
+
* prefixes: `user_1000`, `user_1001`, `checkout-trace-0001`. A plain
|
|
25
|
+
* multiply-and-add hash lets that shared prefix dominate the high bits, so a
|
|
26
|
+
* whole key family lands in one narrow band and a rate of 0.1 keeps all of
|
|
27
|
+
* them or none of them. FNV-1a followed by the murmur3 finalizer mixes the
|
|
28
|
+
* low bits back through the word, so keys that differ in one character land
|
|
29
|
+
* far apart.
|
|
30
|
+
*/
|
|
31
|
+
declare function hashUnitInterval(value: string): number;
|
|
10
32
|
/**
|
|
11
33
|
* Sampler interface - return true to trace, false to skip
|
|
12
34
|
*/
|
|
@@ -34,6 +56,16 @@ interface Sampler {
|
|
|
34
56
|
* @returns true if this trace should be kept, false to drop it
|
|
35
57
|
*/
|
|
36
58
|
shouldKeepTrace?(context: SamplingContext, result: OperationResult): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* How many events a kept event represents, as "1 in N".
|
|
61
|
+
*
|
|
62
|
+
* Autotel writes the result to {@link AUTOTEL_SAMPLING_RATE} so an analyst
|
|
63
|
+
* can reweight counts. Return 1 when the sampler keeps everything.
|
|
64
|
+
*
|
|
65
|
+
* @param context - Sampling context
|
|
66
|
+
* @returns Events represented per kept event
|
|
67
|
+
*/
|
|
68
|
+
sampleRate?(context: SamplingContext): number;
|
|
37
69
|
}
|
|
38
70
|
/**
|
|
39
71
|
* Context information for sampling decisions
|
|
@@ -68,9 +100,10 @@ interface OperationResult {
|
|
|
68
100
|
* ```
|
|
69
101
|
*/
|
|
70
102
|
declare class RandomSampler implements Sampler {
|
|
71
|
-
private readonly
|
|
72
|
-
constructor(
|
|
103
|
+
private readonly rate;
|
|
104
|
+
constructor(rate: number);
|
|
73
105
|
shouldSample(_context: SamplingContext): boolean;
|
|
106
|
+
sampleRate(): number;
|
|
74
107
|
}
|
|
75
108
|
/**
|
|
76
109
|
* Always sample (100% tracing)
|
|
@@ -131,8 +164,10 @@ declare class AdaptiveSampler implements Sampler {
|
|
|
131
164
|
baselineSampleRate?: number;
|
|
132
165
|
slowThresholdMs?: number;
|
|
133
166
|
alwaysSampleErrors?: boolean;
|
|
134
|
-
alwaysSampleSlow?: boolean;
|
|
135
|
-
|
|
167
|
+
alwaysSampleSlow?: boolean;
|
|
168
|
+
/** Enable links-based sampling for event-driven architectures */
|
|
169
|
+
linksBased?: boolean;
|
|
170
|
+
/** Sampling rate for spans linked to sampled spans (0.0-1.0) */
|
|
136
171
|
linksRate?: number;
|
|
137
172
|
logger?: Logger;
|
|
138
173
|
});
|
|
@@ -200,6 +235,85 @@ declare class UserIdSampler implements Sampler {
|
|
|
200
235
|
*/
|
|
201
236
|
private hashString;
|
|
202
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Consistent sampler: every service reaches the same verdict for one trace.
|
|
240
|
+
*
|
|
241
|
+
* `RandomSampler` rolls the dice per process, so an upstream service can keep
|
|
242
|
+
* a trace that its downstream drops, leaving a waterfall with holes in it.
|
|
243
|
+
* Hashing a key that travels with the request removes the disagreement. Pass
|
|
244
|
+
* the trace id, or any identifier every hop already shares.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* new DeterministicSampler({
|
|
249
|
+
* sampleRate: 0.1,
|
|
250
|
+
* key: (context) => trace.getActiveSpan()?.spanContext().traceId,
|
|
251
|
+
* })
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
declare class DeterministicSampler implements Sampler {
|
|
255
|
+
private readonly rate;
|
|
256
|
+
private readonly key;
|
|
257
|
+
constructor(options: {
|
|
258
|
+
/** Fraction of traces to keep, 0-1. */
|
|
259
|
+
sampleRate: number;
|
|
260
|
+
/** Identifier shared by every hop of the trace. */
|
|
261
|
+
key: (context: SamplingContext) => string | undefined;
|
|
262
|
+
});
|
|
263
|
+
shouldSample(context: SamplingContext): boolean;
|
|
264
|
+
sampleRate(): number;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Per-key target-rate sampler for workloads with uneven traffic.
|
|
268
|
+
*
|
|
269
|
+
* A single rate serves a skewed workload badly: 1% floods storage with the
|
|
270
|
+
* busiest endpoint and still loses the rare tenant whose failures you need.
|
|
271
|
+
* This sampler counts traffic per key over a rolling window, then sets each
|
|
272
|
+
* key its own rate so every key contributes roughly `targetPerKey` events.
|
|
273
|
+
* Quiet keys survive intact; loud keys get thinned.
|
|
274
|
+
*
|
|
275
|
+
* The first window keeps everything, because no traffic history exists yet.
|
|
276
|
+
* Rates take effect from the second window onward.
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* ```typescript
|
|
280
|
+
* new KeyTargetRateSampler({
|
|
281
|
+
* key: (context) => context.operationName,
|
|
282
|
+
* targetPerKey: 10, // ~10 events per key per window
|
|
283
|
+
* windowMs: 30_000,
|
|
284
|
+
* })
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
declare class KeyTargetRateSampler implements Sampler {
|
|
288
|
+
private readonly key;
|
|
289
|
+
private readonly targetPerKey;
|
|
290
|
+
private readonly windowMs;
|
|
291
|
+
private readonly maxKeys;
|
|
292
|
+
private counts;
|
|
293
|
+
private rates;
|
|
294
|
+
private windowStart;
|
|
295
|
+
constructor(options: {
|
|
296
|
+
/** Groups traffic. Use the operation, route, tenant, or status. */
|
|
297
|
+
key: (context: SamplingContext) => string | undefined;
|
|
298
|
+
/** Events to keep per key per window. Default 10. */
|
|
299
|
+
targetPerKey?: number;
|
|
300
|
+
/** Length of the counting window in milliseconds. Default 30000. */
|
|
301
|
+
windowMs?: number;
|
|
302
|
+
/** Distinct keys to track before overflowing into one bucket. Default 1000. */
|
|
303
|
+
maxKeys?: number;
|
|
304
|
+
});
|
|
305
|
+
/** Turn the window's observed counts into the next window's rates. */
|
|
306
|
+
private roll;
|
|
307
|
+
/**
|
|
308
|
+
* Resolve the key, collapsing into one bucket once the map is full.
|
|
309
|
+
*
|
|
310
|
+
* An unbounded key function would otherwise grow the map without limit,
|
|
311
|
+
* which turns a sampler meant to cut cost into a memory leak.
|
|
312
|
+
*/
|
|
313
|
+
private resolveKey;
|
|
314
|
+
shouldSample(context: SamplingContext): boolean;
|
|
315
|
+
sampleRate(context: SamplingContext): number;
|
|
316
|
+
}
|
|
203
317
|
/**
|
|
204
318
|
* Composite sampler that combines multiple samplers
|
|
205
319
|
*
|
|
@@ -273,7 +387,9 @@ type SamplingPreset = 'development' | 'errors-only' | 'production' | 'off';
|
|
|
273
387
|
* ```
|
|
274
388
|
*/
|
|
275
389
|
declare const samplingPresets: {
|
|
276
|
-
/** Capture everything — best for local development and debugging */
|
|
390
|
+
/** Capture everything — best for local development and debugging */
|
|
391
|
+
development: () => AlwaysSampler;
|
|
392
|
+
/** Only bad outcomes — zero baseline, errors always kept */
|
|
277
393
|
errorsOnly: () => AdaptiveSampler;
|
|
278
394
|
/**
|
|
279
395
|
* Balanced production defaults — 10% baseline + errors + slow traces.
|
|
@@ -284,7 +400,8 @@ declare const samplingPresets: {
|
|
|
284
400
|
slowThresholdMs?: number;
|
|
285
401
|
alwaysSampleErrors?: boolean;
|
|
286
402
|
alwaysSampleSlow?: boolean;
|
|
287
|
-
}) => AdaptiveSampler;
|
|
403
|
+
}) => AdaptiveSampler;
|
|
404
|
+
/** Disable sampling entirely */
|
|
288
405
|
off: () => NeverSampler;
|
|
289
406
|
};
|
|
290
407
|
/**
|
|
@@ -347,5 +464,5 @@ declare function extractLinksFromBatch(messages: Array<{
|
|
|
347
464
|
[key: string]: unknown;
|
|
348
465
|
}>, headersKey?: string): Link[];
|
|
349
466
|
//#endregion
|
|
350
|
-
export {
|
|
351
|
-
//# sourceMappingURL=sampling-
|
|
467
|
+
export { createLinkFromHeaders as _, AlwaysSampler as a, resolveSamplingPreset as b, FeatureFlagSampler as c, OperationResult as d, RandomSampler as f, UserIdSampler as g, SamplingPreset as h, AdaptiveSampler as i, KeyTargetRateSampler as l, SamplingContext as m, AUTOTEL_SAMPLING_TAIL_EVALUATED as n, CompositeSampler as o, Sampler as p, AUTOTEL_SAMPLING_TAIL_KEEP as r, DeterministicSampler as s, AUTOTEL_SAMPLING_RATE as t, NeverSampler as u, extractLinksFromBatch as v, samplingPresets as x, hashUnitInterval as y };
|
|
468
|
+
//# sourceMappingURL=sampling-BR9fkSwx.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampling-BR9fkSwx.d.cts","names":[],"sources":["../src/sampling.ts"],"mappings":";;;;;;cA+Ba;cACA;;;;;;;;cAUA;;;;;;;;;;;;;;;iBA0BG,iBAAiB;;;;UAoBhB;;;;;;;EAOf,aAAa,SAAS;;;;;;;EAQtB;;;;;;;;;EAUA,iBAAiB,SAAS,iBAAiB,QAAQ;;;;;;;;;;EAWnD,YAAY,SAAS;;;;;UAMN;;EAEf;;EAEA;;EAEA,WAAW;;EAEX,QAAQ;;;;;UAMO;;EAEf;;EAEA;;EAEA,QAAQ;;;;;;;;;;cAWG,yBAAyB;mBACP;EAAA,YAAA;EAM7B,aAAa,UAAU;EAIvB;;;;;cAQW,yBAAyB;EACpC,aAAa,UAAU;;;;;cAQZ,wBAAwB;EACnC,aAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsCZ,2BAA2B;UAC9B;UACA;UACA;UACA;UACA;UACA;UACA;mBAGS;mBAEA;EAGf,YAAA;IACE;IACA;IACA;IACA;;IAEA;;IAEA;IACA,SAAS;;EAmBb;EAKA,aAAa,SAAS;;;;;;;;;;EAoBtB,eAAe,OAAO;;;;;;;;;;;EAoBtB,gBAAgB,SAAS,iBAAiB,QAAQ;;;;;;;;;;;;;;;;;cAuEvC,yBAAyB;UAC5B;UACA;UACA;UACA;EAEI,YAAA;IACV;IACA;IACA,gBAAgB;IAChB,SAAS;;EAQX,aAAa,SAAS;;;;EA4BtB,wBAAwB;;;;EASxB,2BAA2B;;;;UASnB;;;;;;;;;;;;;;;;;;cAqBG,gCAAgC;mBAC1B;mBACA;EAEL,YAAA;;IAEV;;IAEA,MAAM,SAAS;;EASjB,aAAa,SAAS;EAStB;;;;;;;;;;;;;;;;;;;;;;;cA6BW,gCAAgC;mBAC1B;mBACA;mBACA;mBACA;UACT;UACA;UACA;EAEI,YAAA;;IAEV,MAAM,SAAS;;IAEf;;IAEA;;IAEA;;;UAgBM;;;;;;;UAmBA;EAQR,aAAa,SAAS;EAQtB,WAAW,SAAS;;;;;;;;;;;;;;;cAkBT,4BAA4B;mBACV;EAAA,YAAA,UAAU;EAMvC,aAAa,SAAS;;;;;;;;;;;;;;;;;cAoBX,8BAA8B;UACjC;UACA;UACA;UAIA;EAEI,YAAA;IACV;IACA;IACA,eACE,iBACA,WAAW;IAEb,SAAS;;EAQX,aAAa,SAAS;;;;EAsBtB,wBAAwB;;;;EASxB,2BAA2B;;;;;;KAejB;;;;;;;;;;;;;;cAgBC;;;;;;;;;EAec,aAAA;IACvB;IACA;IACA;IACA;QACD;;;;;;;;;;iBAmBa,sBAAsB,QAAQ,iBAAiB;;;;;;;;;;;;;;;;;;;;;;iBA+C/C,sBACd,SAAS,wBACT,aAAa,aACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Ca,sBACd,UAAU;GAAS;IACnB,sBACC"}
|
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
import { s as Logger } from "./logger-
|
|
1
|
+
import { s as Logger } from "./logger-CN4xpzMd.js";
|
|
2
2
|
import { Attributes, Link } from "@opentelemetry/api";
|
|
3
|
-
|
|
4
3
|
//#region src/sampling.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Tail sampling attribute keys (autotel-internal, not OTel semconv)
|
|
7
6
|
*/
|
|
8
7
|
declare const AUTOTEL_SAMPLING_TAIL_KEEP = "autotel.sampling.tail.keep";
|
|
9
8
|
declare const AUTOTEL_SAMPLING_TAIL_EVALUATED = "autotel.sampling.tail.evaluated";
|
|
9
|
+
/**
|
|
10
|
+
* How many events each kept event stands for, expressed as "1 in N".
|
|
11
|
+
*
|
|
12
|
+
* A query that counts sampled spans undercounts the population. Multiplying
|
|
13
|
+
* each kept event by this rate restores the estimate. Autotel records the
|
|
14
|
+
* attribute only when N exceeds 1, so fully captured spans stay clean.
|
|
15
|
+
*/
|
|
16
|
+
declare const AUTOTEL_SAMPLING_RATE = "autotel.sampling.rate";
|
|
17
|
+
/**
|
|
18
|
+
* Map a string to a stable, evenly spread position in the unit interval.
|
|
19
|
+
*
|
|
20
|
+
* Two processes that hash the same key reach the same number, which is what
|
|
21
|
+
* lets independent services agree on one trace's sampling decision.
|
|
22
|
+
*
|
|
23
|
+
* The spread matters as much as the stability. Real sampling keys share long
|
|
24
|
+
* prefixes: `user_1000`, `user_1001`, `checkout-trace-0001`. A plain
|
|
25
|
+
* multiply-and-add hash lets that shared prefix dominate the high bits, so a
|
|
26
|
+
* whole key family lands in one narrow band and a rate of 0.1 keeps all of
|
|
27
|
+
* them or none of them. FNV-1a followed by the murmur3 finalizer mixes the
|
|
28
|
+
* low bits back through the word, so keys that differ in one character land
|
|
29
|
+
* far apart.
|
|
30
|
+
*/
|
|
31
|
+
declare function hashUnitInterval(value: string): number;
|
|
10
32
|
/**
|
|
11
33
|
* Sampler interface - return true to trace, false to skip
|
|
12
34
|
*/
|
|
@@ -34,6 +56,16 @@ interface Sampler {
|
|
|
34
56
|
* @returns true if this trace should be kept, false to drop it
|
|
35
57
|
*/
|
|
36
58
|
shouldKeepTrace?(context: SamplingContext, result: OperationResult): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* How many events a kept event represents, as "1 in N".
|
|
61
|
+
*
|
|
62
|
+
* Autotel writes the result to {@link AUTOTEL_SAMPLING_RATE} so an analyst
|
|
63
|
+
* can reweight counts. Return 1 when the sampler keeps everything.
|
|
64
|
+
*
|
|
65
|
+
* @param context - Sampling context
|
|
66
|
+
* @returns Events represented per kept event
|
|
67
|
+
*/
|
|
68
|
+
sampleRate?(context: SamplingContext): number;
|
|
37
69
|
}
|
|
38
70
|
/**
|
|
39
71
|
* Context information for sampling decisions
|
|
@@ -68,9 +100,10 @@ interface OperationResult {
|
|
|
68
100
|
* ```
|
|
69
101
|
*/
|
|
70
102
|
declare class RandomSampler implements Sampler {
|
|
71
|
-
private readonly
|
|
72
|
-
constructor(
|
|
103
|
+
private readonly rate;
|
|
104
|
+
constructor(rate: number);
|
|
73
105
|
shouldSample(_context: SamplingContext): boolean;
|
|
106
|
+
sampleRate(): number;
|
|
74
107
|
}
|
|
75
108
|
/**
|
|
76
109
|
* Always sample (100% tracing)
|
|
@@ -131,8 +164,10 @@ declare class AdaptiveSampler implements Sampler {
|
|
|
131
164
|
baselineSampleRate?: number;
|
|
132
165
|
slowThresholdMs?: number;
|
|
133
166
|
alwaysSampleErrors?: boolean;
|
|
134
|
-
alwaysSampleSlow?: boolean;
|
|
135
|
-
|
|
167
|
+
alwaysSampleSlow?: boolean;
|
|
168
|
+
/** Enable links-based sampling for event-driven architectures */
|
|
169
|
+
linksBased?: boolean;
|
|
170
|
+
/** Sampling rate for spans linked to sampled spans (0.0-1.0) */
|
|
136
171
|
linksRate?: number;
|
|
137
172
|
logger?: Logger;
|
|
138
173
|
});
|
|
@@ -200,6 +235,85 @@ declare class UserIdSampler implements Sampler {
|
|
|
200
235
|
*/
|
|
201
236
|
private hashString;
|
|
202
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Consistent sampler: every service reaches the same verdict for one trace.
|
|
240
|
+
*
|
|
241
|
+
* `RandomSampler` rolls the dice per process, so an upstream service can keep
|
|
242
|
+
* a trace that its downstream drops, leaving a waterfall with holes in it.
|
|
243
|
+
* Hashing a key that travels with the request removes the disagreement. Pass
|
|
244
|
+
* the trace id, or any identifier every hop already shares.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* new DeterministicSampler({
|
|
249
|
+
* sampleRate: 0.1,
|
|
250
|
+
* key: (context) => trace.getActiveSpan()?.spanContext().traceId,
|
|
251
|
+
* })
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
declare class DeterministicSampler implements Sampler {
|
|
255
|
+
private readonly rate;
|
|
256
|
+
private readonly key;
|
|
257
|
+
constructor(options: {
|
|
258
|
+
/** Fraction of traces to keep, 0-1. */
|
|
259
|
+
sampleRate: number;
|
|
260
|
+
/** Identifier shared by every hop of the trace. */
|
|
261
|
+
key: (context: SamplingContext) => string | undefined;
|
|
262
|
+
});
|
|
263
|
+
shouldSample(context: SamplingContext): boolean;
|
|
264
|
+
sampleRate(): number;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Per-key target-rate sampler for workloads with uneven traffic.
|
|
268
|
+
*
|
|
269
|
+
* A single rate serves a skewed workload badly: 1% floods storage with the
|
|
270
|
+
* busiest endpoint and still loses the rare tenant whose failures you need.
|
|
271
|
+
* This sampler counts traffic per key over a rolling window, then sets each
|
|
272
|
+
* key its own rate so every key contributes roughly `targetPerKey` events.
|
|
273
|
+
* Quiet keys survive intact; loud keys get thinned.
|
|
274
|
+
*
|
|
275
|
+
* The first window keeps everything, because no traffic history exists yet.
|
|
276
|
+
* Rates take effect from the second window onward.
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* ```typescript
|
|
280
|
+
* new KeyTargetRateSampler({
|
|
281
|
+
* key: (context) => context.operationName,
|
|
282
|
+
* targetPerKey: 10, // ~10 events per key per window
|
|
283
|
+
* windowMs: 30_000,
|
|
284
|
+
* })
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
declare class KeyTargetRateSampler implements Sampler {
|
|
288
|
+
private readonly key;
|
|
289
|
+
private readonly targetPerKey;
|
|
290
|
+
private readonly windowMs;
|
|
291
|
+
private readonly maxKeys;
|
|
292
|
+
private counts;
|
|
293
|
+
private rates;
|
|
294
|
+
private windowStart;
|
|
295
|
+
constructor(options: {
|
|
296
|
+
/** Groups traffic. Use the operation, route, tenant, or status. */
|
|
297
|
+
key: (context: SamplingContext) => string | undefined;
|
|
298
|
+
/** Events to keep per key per window. Default 10. */
|
|
299
|
+
targetPerKey?: number;
|
|
300
|
+
/** Length of the counting window in milliseconds. Default 30000. */
|
|
301
|
+
windowMs?: number;
|
|
302
|
+
/** Distinct keys to track before overflowing into one bucket. Default 1000. */
|
|
303
|
+
maxKeys?: number;
|
|
304
|
+
});
|
|
305
|
+
/** Turn the window's observed counts into the next window's rates. */
|
|
306
|
+
private roll;
|
|
307
|
+
/**
|
|
308
|
+
* Resolve the key, collapsing into one bucket once the map is full.
|
|
309
|
+
*
|
|
310
|
+
* An unbounded key function would otherwise grow the map without limit,
|
|
311
|
+
* which turns a sampler meant to cut cost into a memory leak.
|
|
312
|
+
*/
|
|
313
|
+
private resolveKey;
|
|
314
|
+
shouldSample(context: SamplingContext): boolean;
|
|
315
|
+
sampleRate(context: SamplingContext): number;
|
|
316
|
+
}
|
|
203
317
|
/**
|
|
204
318
|
* Composite sampler that combines multiple samplers
|
|
205
319
|
*
|
|
@@ -273,7 +387,9 @@ type SamplingPreset = 'development' | 'errors-only' | 'production' | 'off';
|
|
|
273
387
|
* ```
|
|
274
388
|
*/
|
|
275
389
|
declare const samplingPresets: {
|
|
276
|
-
/** Capture everything — best for local development and debugging */
|
|
390
|
+
/** Capture everything — best for local development and debugging */
|
|
391
|
+
development: () => AlwaysSampler;
|
|
392
|
+
/** Only bad outcomes — zero baseline, errors always kept */
|
|
277
393
|
errorsOnly: () => AdaptiveSampler;
|
|
278
394
|
/**
|
|
279
395
|
* Balanced production defaults — 10% baseline + errors + slow traces.
|
|
@@ -284,7 +400,8 @@ declare const samplingPresets: {
|
|
|
284
400
|
slowThresholdMs?: number;
|
|
285
401
|
alwaysSampleErrors?: boolean;
|
|
286
402
|
alwaysSampleSlow?: boolean;
|
|
287
|
-
}) => AdaptiveSampler;
|
|
403
|
+
}) => AdaptiveSampler;
|
|
404
|
+
/** Disable sampling entirely */
|
|
288
405
|
off: () => NeverSampler;
|
|
289
406
|
};
|
|
290
407
|
/**
|
|
@@ -347,5 +464,5 @@ declare function extractLinksFromBatch(messages: Array<{
|
|
|
347
464
|
[key: string]: unknown;
|
|
348
465
|
}>, headersKey?: string): Link[];
|
|
349
466
|
//#endregion
|
|
350
|
-
export {
|
|
351
|
-
//# sourceMappingURL=sampling-
|
|
467
|
+
export { createLinkFromHeaders as _, AlwaysSampler as a, resolveSamplingPreset as b, FeatureFlagSampler as c, OperationResult as d, RandomSampler as f, UserIdSampler as g, SamplingPreset as h, AdaptiveSampler as i, KeyTargetRateSampler as l, SamplingContext as m, AUTOTEL_SAMPLING_TAIL_EVALUATED as n, CompositeSampler as o, Sampler as p, AUTOTEL_SAMPLING_TAIL_KEEP as r, DeterministicSampler as s, AUTOTEL_SAMPLING_RATE as t, NeverSampler as u, extractLinksFromBatch as v, samplingPresets as x, hashUnitInterval as y };
|
|
468
|
+
//# sourceMappingURL=sampling-CP3e7-Yr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampling-CP3e7-Yr.d.ts","names":[],"sources":["../src/sampling.ts"],"mappings":";;;;;;cA+Ba;cACA;;;;;;;;cAUA;;;;;;;;;;;;;;;iBA0BG,iBAAiB;;;;UAoBhB;;;;;;;EAOf,aAAa,SAAS;;;;;;;EAQtB;;;;;;;;;EAUA,iBAAiB,SAAS,iBAAiB,QAAQ;;;;;;;;;;EAWnD,YAAY,SAAS;;;;;UAMN;;EAEf;;EAEA;;EAEA,WAAW;;EAEX,QAAQ;;;;;UAMO;;EAEf;;EAEA;;EAEA,QAAQ;;;;;;;;;;cAWG,yBAAyB;mBACP;EAAA,YAAA;EAM7B,aAAa,UAAU;EAIvB;;;;;cAQW,yBAAyB;EACpC,aAAa,UAAU;;;;;cAQZ,wBAAwB;EACnC,aAAa,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsCZ,2BAA2B;UAC9B;UACA;UACA;UACA;UACA;UACA;UACA;mBAGS;mBAEA;EAGf,YAAA;IACE;IACA;IACA;IACA;;IAEA;;IAEA;IACA,SAAS;;EAmBb;EAKA,aAAa,SAAS;;;;;;;;;;EAoBtB,eAAe,OAAO;;;;;;;;;;;EAoBtB,gBAAgB,SAAS,iBAAiB,QAAQ;;;;;;;;;;;;;;;;;cAuEvC,yBAAyB;UAC5B;UACA;UACA;UACA;EAEI,YAAA;IACV;IACA;IACA,gBAAgB;IAChB,SAAS;;EAQX,aAAa,SAAS;;;;EA4BtB,wBAAwB;;;;EASxB,2BAA2B;;;;UASnB;;;;;;;;;;;;;;;;;;cAqBG,gCAAgC;mBAC1B;mBACA;EAEL,YAAA;;IAEV;;IAEA,MAAM,SAAS;;EASjB,aAAa,SAAS;EAStB;;;;;;;;;;;;;;;;;;;;;;;cA6BW,gCAAgC;mBAC1B;mBACA;mBACA;mBACA;UACT;UACA;UACA;EAEI,YAAA;;IAEV,MAAM,SAAS;;IAEf;;IAEA;;IAEA;;;UAgBM;;;;;;;UAmBA;EAQR,aAAa,SAAS;EAQtB,WAAW,SAAS;;;;;;;;;;;;;;;cAkBT,4BAA4B;mBACV;EAAA,YAAA,UAAU;EAMvC,aAAa,SAAS;;;;;;;;;;;;;;;;;cAoBX,8BAA8B;UACjC;UACA;UACA;UAIA;EAEI,YAAA;IACV;IACA;IACA,eACE,iBACA,WAAW;IAEb,SAAS;;EAQX,aAAa,SAAS;;;;EAsBtB,wBAAwB;;;;EASxB,2BAA2B;;;;;;KAejB;;;;;;;;;;;;;;cAgBC;;;;;;;;;EAec,aAAA;IACvB;IACA;IACA;IACA;QACD;;;;;;;;;;iBAmBa,sBAAsB,QAAQ,iBAAiB;;;;;;;;;;;;;;;;;;;;;;iBA+C/C,sBACd,SAAS,wBACT,aAAa,aACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Ca,sBACd,UAAU;GAAS;IACnB,sBACC"}
|