Three lines to your first recording.
- 01
Instrument
Point any OpenTelemetry exporter at Trajekt. Spans following the GenAI semantic conventions or the Vercel AI SDK telemetry are understood as-is.
- 02
Record
Every run becomes a trajectory: steps, tool arguments and results, tokens, latency and cost, grouped per agent and version.
- 03
Replay
Open any run on a timeline, compare it with another, and see when a new version starts looping, failing or costing more.
// instrumentation.ts — standard OpenTelemetry, nothing proprietary
import { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
new NodeSDK({
serviceName: 'sentry-triage',
traceExporter: new OTLPTraceExporter({
url: 'http://localhost:3000/v1/traces',
headers: { Authorization: `Bearer ${process.env.TRAJEKT_API_KEY}` },
}),
}).start();
// With the Vercel AI SDK, turn telemetry on for each call:
await generateText({
model, prompt, tools,
experimental_telemetry: { isEnabled: true, functionId: 'sentry-triage' },
});Already have traces? @trajekt-ai/core reads them in your own code and tests:
import { normalize, computeMetrics } from '@trajekt-ai/core';
// A Langfuse export, OTLP/JSON spans or an AI SDK result
const run = normalize(trace);
const { status, costUsd, redundantToolCalls, retryCount } = computeMetrics(run);Works withOpenTelemetry · OTLP/HTTP JSON & protobufGenAI semantic conventionsVercel AI SDKOpenInference · LangChain, LlamaIndexLangfuse import