@autter/otlp-ingester 1.0.0 → 1.2.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 +23 -2
- package/dist/clickhouse.d.ts +2 -1
- package/dist/clickhouse.js +62 -1
- package/dist/config.d.ts +6 -0
- package/dist/config.js +8 -0
- package/dist/fingerprint.d.ts +22 -0
- package/dist/fingerprint.js +216 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -1
- package/dist/llm-pricing.d.ts +20 -0
- package/dist/llm-pricing.js +120 -0
- package/dist/llm.d.ts +20 -0
- package/dist/llm.js +131 -0
- package/dist/migrations.js +37 -0
- package/dist/normalize-browser.js +41 -9
- package/dist/normalize-otlp.d.ts +3 -1
- package/dist/normalize-otlp.js +79 -5
- package/dist/otlp-proto.js +1 -1
- package/dist/server.d.ts +3 -0
- package/dist/server.js +42 -43
- package/dist/sink.d.ts +103 -0
- package/dist/sink.js +314 -0
- package/dist/stack-fixtures.d.ts +25 -0
- package/dist/stack-fixtures.js +231 -0
- package/dist/types.d.ts +33 -0
- package/package.json +3 -2
package/dist/types.d.ts
CHANGED
|
@@ -62,6 +62,39 @@ export interface RuntimeSpanRow {
|
|
|
62
62
|
attributes: Record<string, unknown> | null;
|
|
63
63
|
startedAt: Date;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* One LLM provider call (chat, completion, embedding, …) extracted from a
|
|
67
|
+
* span carrying GenAI/Vercel-AI/Autter attributes — see llm.ts. Stored per
|
|
68
|
+
* call, not rolled up: LLM traffic is orders of magnitude smaller than
|
|
69
|
+
* HTTP, and spend analysis needs every call. Tokens and cost are resolved
|
|
70
|
+
* at ingest so usage/spend queries are plain aggregates.
|
|
71
|
+
*/
|
|
72
|
+
export interface RuntimeLlmCall {
|
|
73
|
+
service: string;
|
|
74
|
+
environment: string;
|
|
75
|
+
release: string | null;
|
|
76
|
+
traceId: string;
|
|
77
|
+
spanId: string;
|
|
78
|
+
/** gen_ai.provider.name / gen_ai.system / ai.model.provider — "openai", … */
|
|
79
|
+
provider: string;
|
|
80
|
+
model: string;
|
|
81
|
+
/** gen_ai.operation.name — "chat", "embeddings", "generateText", … */
|
|
82
|
+
operation: string;
|
|
83
|
+
inputTokens: number;
|
|
84
|
+
outputTokens: number;
|
|
85
|
+
costUsd: number;
|
|
86
|
+
/** reported = SDK sent the exact cost; estimated = built-in pricing table. */
|
|
87
|
+
costSource: "reported" | "estimated" | "none";
|
|
88
|
+
durationMs: number;
|
|
89
|
+
status: "ok" | "error";
|
|
90
|
+
/** Provider exception type for failed calls ("RateLimitError", …); "" when ok. */
|
|
91
|
+
errorType: string;
|
|
92
|
+
/** Opaque end-user id for per-user usage/cost attribution. */
|
|
93
|
+
userId: string;
|
|
94
|
+
sessionId: string;
|
|
95
|
+
attributes: Record<string, string> | null;
|
|
96
|
+
startedAt: Date;
|
|
97
|
+
}
|
|
65
98
|
/** One 60-second usage rollup bucket. */
|
|
66
99
|
export interface RuntimeMetricPoint {
|
|
67
100
|
service: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autter/otlp-ingester",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Self-hostable OTLP + browser-error ingest service for Autter Runtime: normalises telemetry into a per-repo ClickHouse data model",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"dev": "tsx watch src/index.ts",
|
|
16
16
|
"start": "node dist/index.js",
|
|
17
|
-
"build": "tsc -p tsconfig.json"
|
|
17
|
+
"build": "tsc -p tsconfig.json",
|
|
18
|
+
"test": "tsx --test src/*.test.ts"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@clickhouse/client": "^1.12.0",
|