No traces appear at all
The SDK ran, but nothing reached AgentMark.The env vars weren’t loaded when the app ran
AGENTMARK_API_KEY / AGENTMARK_APP_ID decide where traces go, and Node does not load .env by itself. If the process started without them, the SDK has nowhere to send to.
console.log(!!process.env.AGENTMARK_API_KEY) right before new AgentMarkSDK(...)). In local development, agentmark dev receives traces at http://localhost:9418 automatically — no key needed.
A short-lived script exited before spans flushed
Spans are batched, so a CLI, serverless handler, or cron job can exit before the batch is sent. Disable batching and flush on the way out:- TypeScript
- Python
Traces appear, but the model span is missing
You see your custom spans (span(), observe()), but the generation span — model name, token usage, input/output — is absent. Two causes, often together.
registerGlobally: true is missing
The AI SDK emits the model span through the global OpenTelemetry tracer. AgentMark’s tracer stays isolated by default so it never clobbers an existing OTel setup in your app — which means that without registerGlobally: true, the model span goes to a no-op tracer and silently vanishes while your custom spans keep working.
(Vercel AI SDK) telemetry isn’t enabled on the call
EverygenerateText / streamText / generateObject call must opt in, or it emits no spans:
format() and pass the result straight through:
Quick checklist
- Nothing at all? → env vars loaded when the process started; for scripts,
disableBatch: true+await tracer.shutdown(). - Custom spans but no model span? →
registerGlobally: true, and (Vercel AI SDK)experimental_telemetry: { isEnabled: true }on every call. - Local dev? → traces go to
http://localhost:9418; make sureagentmark devis running.
Still stuck?
For errors with an explicit message (model not registered, 401, MCP server not found, …), see the error reference. Otherwise open an issue on GitHub with your SDK versions and a minimal reproduction.Have Questions?
We’re here to help! Choose the best way to reach us:
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions