autotel 3.7.0 → 4.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/dist/{attributes-ksn4HVbd.js → attributes-CmYpdqCN.js} +2 -11
- package/dist/attributes-CmYpdqCN.js.map +1 -0
- package/dist/{attributes-D3etyRVc.cjs → attributes-PZ5doLgw.cjs} +2 -11
- package/dist/attributes-PZ5doLgw.cjs.map +1 -0
- package/dist/attributes.cjs +1 -1
- package/dist/attributes.d.cts +2 -2
- package/dist/attributes.d.ts +2 -2
- package/dist/attributes.js +1 -1
- package/dist/{index-CX0aG1Uh.d.ts → index-Ck06vlW2.d.ts} +2 -32
- package/dist/index-Ck06vlW2.d.ts.map +1 -0
- package/dist/{index-DIWZFKUS.d.cts → index-eKuioqT1.d.cts} +2 -32
- package/dist/index-eKuioqT1.d.cts.map +1 -0
- package/dist/index.cjs +2 -346
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -171
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +3 -171
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -333
- package/dist/index.js.map +1 -1
- package/dist/{registry-DfXA3R1L.js → registry-DVSmWg6Y.js} +2 -11
- package/dist/registry-DVSmWg6Y.js.map +1 -0
- package/dist/{registry-JZg2J3RZ.cjs → registry-DYgvb62e.cjs} +1 -16
- package/dist/registry-DYgvb62e.cjs.map +1 -0
- package/dist/semantic-conventions.cjs +1 -1
- package/dist/semantic-conventions.js +1 -1
- package/dist/semantic-helpers.cjs +0 -113
- package/dist/semantic-helpers.cjs.map +1 -1
- package/dist/semantic-helpers.d.cts +1 -114
- package/dist/semantic-helpers.d.cts.map +1 -1
- package/dist/semantic-helpers.d.ts +1 -114
- package/dist/semantic-helpers.d.ts.map +1 -1
- package/dist/semantic-helpers.js +1 -113
- package/dist/semantic-helpers.js.map +1 -1
- package/package.json +1 -1
- package/skills/analyze-traces/SKILL.md +14 -12
- package/skills/review-otel-patterns/SKILL.md +4 -2
- package/skills/tune-sampling/SKILL.md +8 -3
- package/src/attributes/builders.ts +2 -20
- package/src/attributes/index.ts +0 -1
- package/src/attributes/registry.ts +2 -9
- package/src/attributes/types.ts +0 -8
- package/src/index.ts +4 -41
- package/src/semantic-helpers.test.ts +2 -87
- package/src/semantic-helpers.ts +0 -146
- package/dist/attributes-D3etyRVc.cjs.map +0 -1
- package/dist/attributes-ksn4HVbd.js.map +0 -1
- package/dist/index-CX0aG1Uh.d.ts.map +0 -1
- package/dist/index-DIWZFKUS.d.cts.map +0 -1
- package/dist/registry-DfXA3R1L.js.map +0 -1
- package/dist/registry-JZg2J3RZ.cjs.map +0 -1
- package/src/gen-ai-cost.test.ts +0 -81
- package/src/gen-ai-cost.ts +0 -145
- package/src/gen-ai-events.test.ts +0 -135
- package/src/gen-ai-events.ts +0 -208
- package/src/gen-ai-metrics.test.ts +0 -96
- package/src/gen-ai-metrics.ts +0 -128
package/dist/index.cjs
CHANGED
|
@@ -19,14 +19,13 @@ const require_parse_error = require('./parse-error.cjs');
|
|
|
19
19
|
const require_drain_pipeline = require('./drain-pipeline.cjs');
|
|
20
20
|
const require_metric_helpers = require('./metric-helpers.cjs');
|
|
21
21
|
const require_semantic_helpers = require('./semantic-helpers.cjs');
|
|
22
|
-
const require_registry = require('./registry-
|
|
22
|
+
const require_registry = require('./registry-DYgvb62e.cjs');
|
|
23
23
|
const require_semantic_conventions = require('./semantic-conventions.cjs');
|
|
24
|
-
const require_attributes = require('./attributes-
|
|
24
|
+
const require_attributes = require('./attributes-PZ5doLgw.cjs');
|
|
25
25
|
const require_messaging = require('./messaging.cjs');
|
|
26
26
|
const require_business_baggage = require('./business-baggage.cjs');
|
|
27
27
|
const require_workflow = require('./workflow.cjs');
|
|
28
28
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
29
|
-
let _opentelemetry_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
30
29
|
let node_async_hooks = require("node:async_hooks");
|
|
31
30
|
|
|
32
31
|
//#region src/trace-hybrid.ts
|
|
@@ -643,334 +642,6 @@ function defineEnricher(def, options = {}) {
|
|
|
643
642
|
};
|
|
644
643
|
}
|
|
645
644
|
|
|
646
|
-
//#endregion
|
|
647
|
-
//#region src/gen-ai-metrics.ts
|
|
648
|
-
/**
|
|
649
|
-
* LLM-tuned histogram buckets.
|
|
650
|
-
*
|
|
651
|
-
* Default OpenTelemetry histogram buckets target HTTP latency (0ms–10s)
|
|
652
|
-
* and small counter values. LLM workloads have very different shapes:
|
|
653
|
-
*
|
|
654
|
-
* - **Duration**: single-token prompts can be fast (50ms), long
|
|
655
|
-
* generations and reasoning models can run for minutes. Default buckets
|
|
656
|
-
* crush everything above 10s into one bucket.
|
|
657
|
-
* - **Token usage**: heavily right-skewed. A single request can range
|
|
658
|
-
* from tens of tokens to the million-token context windows.
|
|
659
|
-
* - **Cost (USD)**: per-request values are tiny (fractions of a cent),
|
|
660
|
-
* so linear buckets waste resolution at the low end.
|
|
661
|
-
*
|
|
662
|
-
* This module exposes empirically-chosen bucket arrays and a View helper
|
|
663
|
-
* so users can apply them to their `MeterProvider` without knowing the
|
|
664
|
-
* exact instrument names emitted by OpenAI/Anthropic/Traceloop plugins.
|
|
665
|
-
*
|
|
666
|
-
* @example
|
|
667
|
-
* ```typescript
|
|
668
|
-
* import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
669
|
-
* import { genAiMetricViews } from 'autotel';
|
|
670
|
-
*
|
|
671
|
-
* const sdk = new NodeSDK({
|
|
672
|
-
* serviceName: 'my-agent',
|
|
673
|
-
* views: [...genAiMetricViews()],
|
|
674
|
-
* });
|
|
675
|
-
* sdk.start();
|
|
676
|
-
* ```
|
|
677
|
-
*/
|
|
678
|
-
/**
|
|
679
|
-
* Duration buckets for LLM operations, in **seconds**. Covers fast
|
|
680
|
-
* completions (50ms) through long-running reasoning jobs (5 min).
|
|
681
|
-
*
|
|
682
|
-
* Aligns with the OTel GenAI semantic conventions' published advice for
|
|
683
|
-
* `gen_ai.client.operation.duration`.
|
|
684
|
-
*/
|
|
685
|
-
const GEN_AI_DURATION_BUCKETS_SECONDS = Object.freeze([
|
|
686
|
-
.01,
|
|
687
|
-
.05,
|
|
688
|
-
.1,
|
|
689
|
-
.25,
|
|
690
|
-
.5,
|
|
691
|
-
1,
|
|
692
|
-
2,
|
|
693
|
-
5,
|
|
694
|
-
10,
|
|
695
|
-
20,
|
|
696
|
-
30,
|
|
697
|
-
60,
|
|
698
|
-
120,
|
|
699
|
-
300
|
|
700
|
-
]);
|
|
701
|
-
/**
|
|
702
|
-
* Token-count buckets for prompt, completion, and total token histograms.
|
|
703
|
-
* Ranges from tiny prompts to million-token context windows.
|
|
704
|
-
*
|
|
705
|
-
* Aligns with the OTel GenAI semantic conventions' published advice for
|
|
706
|
-
* `gen_ai.client.token.usage`.
|
|
707
|
-
*/
|
|
708
|
-
const GEN_AI_TOKEN_USAGE_BUCKETS = Object.freeze([
|
|
709
|
-
1,
|
|
710
|
-
4,
|
|
711
|
-
16,
|
|
712
|
-
64,
|
|
713
|
-
256,
|
|
714
|
-
1024,
|
|
715
|
-
4096,
|
|
716
|
-
16384,
|
|
717
|
-
65536,
|
|
718
|
-
262144,
|
|
719
|
-
1048576,
|
|
720
|
-
4194304
|
|
721
|
-
]);
|
|
722
|
-
/**
|
|
723
|
-
* USD cost buckets. Sub-cent resolution at the low end (fractions of a
|
|
724
|
-
* cent per small call) up to tens of dollars (batch jobs, Opus/o1 runs).
|
|
725
|
-
*/
|
|
726
|
-
const GEN_AI_COST_USD_BUCKETS = Object.freeze([
|
|
727
|
-
1e-5,
|
|
728
|
-
1e-4,
|
|
729
|
-
.001,
|
|
730
|
-
.005,
|
|
731
|
-
.01,
|
|
732
|
-
.05,
|
|
733
|
-
.1,
|
|
734
|
-
.5,
|
|
735
|
-
1,
|
|
736
|
-
5,
|
|
737
|
-
10,
|
|
738
|
-
50
|
|
739
|
-
]);
|
|
740
|
-
/**
|
|
741
|
-
* Instrument-level advice object for `createHistogram(name, advice)`.
|
|
742
|
-
* Use when you control the instrument creation (e.g. custom business
|
|
743
|
-
* LLM metrics); `genAiMetricViews()` is better when the metric comes
|
|
744
|
-
* from a third-party plugin.
|
|
745
|
-
*/
|
|
746
|
-
function llmHistogramAdvice(kind) {
|
|
747
|
-
return { advice: { explicitBucketBoundaries: [...kind === "duration" ? GEN_AI_DURATION_BUCKETS_SECONDS : kind === "tokens" ? GEN_AI_TOKEN_USAGE_BUCKETS : GEN_AI_COST_USD_BUCKETS] } };
|
|
748
|
-
}
|
|
749
|
-
/**
|
|
750
|
-
* Returns `View`s that re-bucket the standard OTel GenAI histograms. Pass
|
|
751
|
-
* the result to your `MeterProvider`'s `views` option.
|
|
752
|
-
*
|
|
753
|
-
* Matches instrument names emitted by:
|
|
754
|
-
* - OpenTelemetry GenAI autoinstrumentation
|
|
755
|
-
* - OpenInference / OpenLLMetry (traceloop)
|
|
756
|
-
* - Arize Phoenix, LangSmith, etc. that follow the OTel spec
|
|
757
|
-
*
|
|
758
|
-
* Add more instrument patterns via the `extra` argument if you emit
|
|
759
|
-
* custom LLM metrics.
|
|
760
|
-
*/
|
|
761
|
-
function genAiMetricViews(extra = []) {
|
|
762
|
-
return [...[
|
|
763
|
-
{
|
|
764
|
-
instrumentName: "gen_ai.client.operation.duration",
|
|
765
|
-
kind: "duration"
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
instrumentName: "gen_ai.client.token.usage",
|
|
769
|
-
kind: "tokens"
|
|
770
|
-
},
|
|
771
|
-
{
|
|
772
|
-
instrumentName: "gen_ai.client.cost.usd",
|
|
773
|
-
kind: "cost"
|
|
774
|
-
}
|
|
775
|
-
], ...extra].map(({ instrumentName, kind }) => ({
|
|
776
|
-
instrumentName,
|
|
777
|
-
aggregation: {
|
|
778
|
-
type: _opentelemetry_sdk_metrics.AggregationType.EXPLICIT_BUCKET_HISTOGRAM,
|
|
779
|
-
options: { boundaries: kind === "duration" ? [...GEN_AI_DURATION_BUCKETS_SECONDS] : kind === "tokens" ? [...GEN_AI_TOKEN_USAGE_BUCKETS] : [...GEN_AI_COST_USD_BUCKETS] }
|
|
780
|
-
}
|
|
781
|
-
}));
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
//#endregion
|
|
785
|
-
//#region src/gen-ai-events.ts
|
|
786
|
-
/**
|
|
787
|
-
* Record that a prompt was dispatched to the provider. Typically called
|
|
788
|
-
* before `await provider.chat.completions.create(...)`.
|
|
789
|
-
*/
|
|
790
|
-
function recordPromptSent(ctx, event = {}) {
|
|
791
|
-
require_correlated_events.emitCorrelatedEvent(ctx, "gen_ai.prompt.sent", buildPromptSentAttrs(event));
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* Record a successful provider response. Call after the response arrives
|
|
795
|
-
* (for non-streaming) or after the stream completes.
|
|
796
|
-
*/
|
|
797
|
-
function recordResponseReceived(ctx, event = {}) {
|
|
798
|
-
require_correlated_events.emitCorrelatedEvent(ctx, "gen_ai.response.received", buildResponseAttrs(event));
|
|
799
|
-
}
|
|
800
|
-
/**
|
|
801
|
-
* Record a retry attempt on an LLM call. Call *before* sleeping for
|
|
802
|
-
* `delayMs` so the event timestamp accurately marks when the retry
|
|
803
|
-
* decision was made.
|
|
804
|
-
*/
|
|
805
|
-
function recordRetry(ctx, event) {
|
|
806
|
-
require_correlated_events.emitCorrelatedEvent(ctx, "gen_ai.retry", buildRetryAttrs(event));
|
|
807
|
-
}
|
|
808
|
-
/**
|
|
809
|
-
* Record a tool / function call made in the course of an agent step.
|
|
810
|
-
* Emits an event rather than a child span because many frameworks fire
|
|
811
|
-
* several tool calls within a single provider response.
|
|
812
|
-
*/
|
|
813
|
-
function recordToolCall(ctx, event) {
|
|
814
|
-
require_correlated_events.emitCorrelatedEvent(ctx, "gen_ai.tool.call", buildToolCallAttrs(event));
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Record the time-to-first-token for a streaming response. Pair with
|
|
818
|
-
* `recordResponseReceived` at the end so the span carries both the TTFT
|
|
819
|
-
* marker and the final usage numbers.
|
|
820
|
-
*/
|
|
821
|
-
function recordStreamFirstToken(ctx, event = {}) {
|
|
822
|
-
require_correlated_events.emitCorrelatedEvent(ctx, "gen_ai.stream.first_token", buildStreamFirstTokenAttrs(event));
|
|
823
|
-
}
|
|
824
|
-
function buildPromptSentAttrs(event) {
|
|
825
|
-
const attrs = {};
|
|
826
|
-
if (event.model) attrs["gen_ai.request.model"] = event.model;
|
|
827
|
-
if (event.promptTokens !== void 0) attrs["gen_ai.usage.input_tokens"] = event.promptTokens;
|
|
828
|
-
if (event.messageCount !== void 0) attrs["gen_ai.request.message_count"] = event.messageCount;
|
|
829
|
-
if (event.operation) attrs["gen_ai.operation.name"] = event.operation;
|
|
830
|
-
return attrs;
|
|
831
|
-
}
|
|
832
|
-
function buildResponseAttrs(event) {
|
|
833
|
-
const attrs = {};
|
|
834
|
-
if (event.model) attrs["gen_ai.response.model"] = event.model;
|
|
835
|
-
if (event.promptTokens !== void 0) attrs["gen_ai.usage.input_tokens"] = event.promptTokens;
|
|
836
|
-
if (event.completionTokens !== void 0) attrs["gen_ai.usage.output_tokens"] = event.completionTokens;
|
|
837
|
-
if (event.totalTokens !== void 0) attrs["gen_ai.usage.total_tokens"] = event.totalTokens;
|
|
838
|
-
if (event.finishReasons && event.finishReasons.length > 0) attrs["gen_ai.response.finish_reasons"] = event.finishReasons.join(",");
|
|
839
|
-
return attrs;
|
|
840
|
-
}
|
|
841
|
-
function buildRetryAttrs(event) {
|
|
842
|
-
const attrs = { "retry.attempt": event.attempt };
|
|
843
|
-
if (event.reason) attrs["retry.reason"] = event.reason;
|
|
844
|
-
if (event.delayMs !== void 0) attrs["retry.delay_ms"] = event.delayMs;
|
|
845
|
-
if (event.statusCode !== void 0) attrs["http.response.status_code"] = event.statusCode;
|
|
846
|
-
return attrs;
|
|
847
|
-
}
|
|
848
|
-
function buildToolCallAttrs(event) {
|
|
849
|
-
const attrs = { "gen_ai.tool.name": event.toolName };
|
|
850
|
-
if (event.toolCallId) attrs["gen_ai.tool.call.id"] = event.toolCallId;
|
|
851
|
-
if (event.arguments) attrs["gen_ai.tool.arguments"] = event.arguments;
|
|
852
|
-
return attrs;
|
|
853
|
-
}
|
|
854
|
-
function buildStreamFirstTokenAttrs(event) {
|
|
855
|
-
const attrs = {};
|
|
856
|
-
if (event.tokensSoFar !== void 0) attrs["gen_ai.stream.tokens_so_far"] = event.tokensSoFar;
|
|
857
|
-
return attrs;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
//#endregion
|
|
861
|
-
//#region src/gen-ai-cost.ts
|
|
862
|
-
/** Span attribute key autotel sets for an estimated call cost. */
|
|
863
|
-
const GEN_AI_COST_ATTRIBUTE = "gen_ai.usage.cost.usd";
|
|
864
|
-
/**
|
|
865
|
-
* Approximate public list prices (USD per 1M tokens) at the time of writing.
|
|
866
|
-
* Prices change; treat these as convenience defaults, not a billing source of
|
|
867
|
-
* truth. Override per call via `options.pricing` or mutate this table at init.
|
|
868
|
-
* Matching is exact first, then by longest key prefix, so versioned model ids
|
|
869
|
-
* (`claude-sonnet-4-6-20251101`) resolve to a base entry (`claude-sonnet-4-6`).
|
|
870
|
-
*/
|
|
871
|
-
const MODEL_PRICING = {
|
|
872
|
-
"gpt-4o": {
|
|
873
|
-
inputPer1M: 2.5,
|
|
874
|
-
outputPer1M: 10
|
|
875
|
-
},
|
|
876
|
-
"gpt-4o-mini": {
|
|
877
|
-
inputPer1M: .15,
|
|
878
|
-
outputPer1M: .6
|
|
879
|
-
},
|
|
880
|
-
"gpt-4.1": {
|
|
881
|
-
inputPer1M: 2,
|
|
882
|
-
outputPer1M: 8
|
|
883
|
-
},
|
|
884
|
-
"gpt-4.1-mini": {
|
|
885
|
-
inputPer1M: .4,
|
|
886
|
-
outputPer1M: 1.6
|
|
887
|
-
},
|
|
888
|
-
"gpt-4.1-nano": {
|
|
889
|
-
inputPer1M: .1,
|
|
890
|
-
outputPer1M: .4
|
|
891
|
-
},
|
|
892
|
-
"o3-mini": {
|
|
893
|
-
inputPer1M: 1.1,
|
|
894
|
-
outputPer1M: 4.4
|
|
895
|
-
},
|
|
896
|
-
"claude-opus-4": {
|
|
897
|
-
inputPer1M: 15,
|
|
898
|
-
outputPer1M: 75
|
|
899
|
-
},
|
|
900
|
-
"claude-sonnet-4": {
|
|
901
|
-
inputPer1M: 3,
|
|
902
|
-
outputPer1M: 15
|
|
903
|
-
},
|
|
904
|
-
"claude-3-5-sonnet": {
|
|
905
|
-
inputPer1M: 3,
|
|
906
|
-
outputPer1M: 15
|
|
907
|
-
},
|
|
908
|
-
"claude-3-5-haiku": {
|
|
909
|
-
inputPer1M: .8,
|
|
910
|
-
outputPer1M: 4
|
|
911
|
-
},
|
|
912
|
-
"claude-3-opus": {
|
|
913
|
-
inputPer1M: 15,
|
|
914
|
-
outputPer1M: 75
|
|
915
|
-
},
|
|
916
|
-
"claude-3-haiku": {
|
|
917
|
-
inputPer1M: .25,
|
|
918
|
-
outputPer1M: 1.25
|
|
919
|
-
},
|
|
920
|
-
"gemini-1.5-pro": {
|
|
921
|
-
inputPer1M: 1.25,
|
|
922
|
-
outputPer1M: 5
|
|
923
|
-
},
|
|
924
|
-
"gemini-1.5-flash": {
|
|
925
|
-
inputPer1M: .075,
|
|
926
|
-
outputPer1M: .3
|
|
927
|
-
},
|
|
928
|
-
"gemini-2.0-flash": {
|
|
929
|
-
inputPer1M: .1,
|
|
930
|
-
outputPer1M: .4
|
|
931
|
-
}
|
|
932
|
-
};
|
|
933
|
-
function resolvePricing(table, model) {
|
|
934
|
-
const exact = table[model];
|
|
935
|
-
if (exact) return exact;
|
|
936
|
-
let best;
|
|
937
|
-
let bestLength = 0;
|
|
938
|
-
for (const key of Object.keys(table)) if (model.startsWith(key) && key.length > bestLength) {
|
|
939
|
-
best = table[key];
|
|
940
|
-
bestLength = key.length;
|
|
941
|
-
}
|
|
942
|
-
return best;
|
|
943
|
-
}
|
|
944
|
-
function round(value) {
|
|
945
|
-
return Math.round(value * 1e6) / 1e6;
|
|
946
|
-
}
|
|
947
|
-
/**
|
|
948
|
-
* Estimate the USD cost of an LLM call. Returns `undefined` when the model has
|
|
949
|
-
* no known pricing (supply one via `options.pricing`).
|
|
950
|
-
*/
|
|
951
|
-
function estimateLLMCost(model, usage, options) {
|
|
952
|
-
const price = resolvePricing(options?.pricing ? {
|
|
953
|
-
...MODEL_PRICING,
|
|
954
|
-
...options.pricing
|
|
955
|
-
} : MODEL_PRICING, model);
|
|
956
|
-
if (!price) return void 0;
|
|
957
|
-
const cachedInput = usage.cachedInputTokens ?? 0;
|
|
958
|
-
const billedInput = Math.max(0, (usage.inputTokens ?? 0) - cachedInput);
|
|
959
|
-
const output = usage.outputTokens ?? 0;
|
|
960
|
-
const cachedRate = price.cachedInputPer1M ?? price.inputPer1M;
|
|
961
|
-
return round(billedInput / 1e6 * price.inputPer1M + cachedInput / 1e6 * cachedRate + output / 1e6 * price.outputPer1M);
|
|
962
|
-
}
|
|
963
|
-
/**
|
|
964
|
-
* Estimate cost and record it on `ctx` as the `gen_ai.usage.cost.usd` span
|
|
965
|
-
* attribute. Returns the estimated cost, or `undefined` when the model is
|
|
966
|
-
* unknown (in which case no attribute is set).
|
|
967
|
-
*/
|
|
968
|
-
function recordLLMCost(ctx, model, usage, options) {
|
|
969
|
-
const cost = estimateLLMCost(model, usage, options);
|
|
970
|
-
if (cost !== void 0) ctx.setAttribute(GEN_AI_COST_ATTRIBUTE, cost);
|
|
971
|
-
return cost;
|
|
972
|
-
}
|
|
973
|
-
|
|
974
645
|
//#endregion
|
|
975
646
|
exports.AUTOTEL_SAMPLING_TAIL_EVALUATED = require_sampling.AUTOTEL_SAMPLING_TAIL_EVALUATED;
|
|
976
647
|
exports.AUTOTEL_SAMPLING_TAIL_KEEP = require_sampling.AUTOTEL_SAMPLING_TAIL_KEEP;
|
|
@@ -982,12 +653,7 @@ exports.BusinessBaggage = require_business_baggage.BusinessBaggage;
|
|
|
982
653
|
exports.CORRELATION_ID_BAGGAGE_KEY = require_track.CORRELATION_ID_BAGGAGE_KEY;
|
|
983
654
|
exports.Event = require_event.Event;
|
|
984
655
|
exports.FilteringSpanProcessor = require_filtering_span_processor.FilteringSpanProcessor;
|
|
985
|
-
exports.GEN_AI_COST_ATTRIBUTE = GEN_AI_COST_ATTRIBUTE;
|
|
986
|
-
exports.GEN_AI_COST_USD_BUCKETS = GEN_AI_COST_USD_BUCKETS;
|
|
987
|
-
exports.GEN_AI_DURATION_BUCKETS_SECONDS = GEN_AI_DURATION_BUCKETS_SECONDS;
|
|
988
|
-
exports.GEN_AI_TOKEN_USAGE_BUCKETS = GEN_AI_TOKEN_USAGE_BUCKETS;
|
|
989
656
|
exports.HTTPAttributes = require_registry.HTTPAttributes;
|
|
990
|
-
exports.MODEL_PRICING = MODEL_PRICING;
|
|
991
657
|
exports.Metric = require_metric.Metric;
|
|
992
658
|
exports.NORMALIZER_PATTERNS = require_span_name_normalizer.NORMALIZER_PATTERNS;
|
|
993
659
|
exports.NORMALIZER_PRESETS = require_span_name_normalizer.NORMALIZER_PRESETS;
|
|
@@ -1049,14 +715,12 @@ exports.defineErrorCatalog = defineErrorCatalog;
|
|
|
1049
715
|
exports.defineEvent = defineEvent;
|
|
1050
716
|
exports.defineHttpDrain = defineHttpDrain;
|
|
1051
717
|
exports.enrichWithTraceContext = require_trace_helpers.enrichWithTraceContext;
|
|
1052
|
-
exports.estimateLLMCost = estimateLLMCost;
|
|
1053
718
|
exports.extractLinksFromBatch = require_sampling.extractLinksFromBatch;
|
|
1054
719
|
exports.finalizeSpan = require_trace_helpers.finalizeSpan;
|
|
1055
720
|
exports.flattenMetadata = require_trace_helpers.flattenMetadata;
|
|
1056
721
|
exports.flattenToAttributes = require_structured_error.flattenToAttributes;
|
|
1057
722
|
exports.flush = flush;
|
|
1058
723
|
exports.formatDuration = require_canonical_log_line_processor.formatDuration;
|
|
1059
|
-
exports.genAiMetricViews = genAiMetricViews;
|
|
1060
724
|
exports.generateCorrelationId = require_track.generateCorrelationId;
|
|
1061
725
|
exports.getActiveContext = require_trace_helpers.getActiveContext;
|
|
1062
726
|
exports.getActiveSpan = require_trace_helpers.getActiveSpan;
|
|
@@ -1089,7 +753,6 @@ exports.isInWorkflow = require_workflow.isInWorkflow;
|
|
|
1089
753
|
exports.isInitialized = require_init.isInitialized;
|
|
1090
754
|
exports.isLoggerLocked = require_init.isLoggerLocked;
|
|
1091
755
|
exports.isTracing = require_trace_helpers.isTracing;
|
|
1092
|
-
exports.llmHistogramAdvice = llmHistogramAdvice;
|
|
1093
756
|
exports.lockLogger = require_init.lockLogger;
|
|
1094
757
|
exports.markAsImmediate = require_functional.markAsImmediate;
|
|
1095
758
|
exports.mergeAttrs = require_attributes.mergeAttrs;
|
|
@@ -1108,13 +771,7 @@ Object.defineProperty(exports, 'propagation', {
|
|
|
1108
771
|
return _opentelemetry_api.propagation;
|
|
1109
772
|
}
|
|
1110
773
|
});
|
|
1111
|
-
exports.recordLLMCost = recordLLMCost;
|
|
1112
|
-
exports.recordPromptSent = recordPromptSent;
|
|
1113
|
-
exports.recordResponseReceived = recordResponseReceived;
|
|
1114
|
-
exports.recordRetry = recordRetry;
|
|
1115
|
-
exports.recordStreamFirstToken = recordStreamFirstToken;
|
|
1116
774
|
exports.recordStructuredError = require_structured_error.recordStructuredError;
|
|
1117
|
-
exports.recordToolCall = recordToolCall;
|
|
1118
775
|
exports.request = require_attributes.request;
|
|
1119
776
|
exports.resetEvents = require_event.resetEvents;
|
|
1120
777
|
exports.resetMetrics = require_metric.resetMetrics;
|
|
@@ -1142,7 +799,6 @@ exports.trace = trace;
|
|
|
1142
799
|
exports.traceConsumer = require_messaging.traceConsumer;
|
|
1143
800
|
exports.traceDB = require_semantic_helpers.traceDB;
|
|
1144
801
|
exports.traceHTTP = require_semantic_helpers.traceHTTP;
|
|
1145
|
-
exports.traceLLM = require_semantic_helpers.traceLLM;
|
|
1146
802
|
exports.traceMessaging = require_semantic_helpers.traceMessaging;
|
|
1147
803
|
exports.traceProducer = require_messaging.traceProducer;
|
|
1148
804
|
exports.traceStep = require_workflow.traceStep;
|