This page covers the problems that come up when an APM agent sends LLM data. Work through it in order: the first two sections explain almost every case of missing data.

No LLM data arrives at all

Check that tracing is on

This is the most common cause. LLM data travels on the agent’s tracing transport, and if tracing is off that transport is never built. The agent detects this at startup, turns LLM monitoring back off, and logs:
Set both options, not just the LLM one:

Check that instrumentation loaded

The agent logs which libraries it instrumented when it starts. Raise the log level to see it:
A healthy start logs the list of libraries. If instead you see a line saying no LLM instrumentation was loaded, one of these is true:
  • atatus-nodejs-llm is not installed. The agent says so directly when this is the case. Run npm install atatus-nodejs-llm.
  • Your runtime is too old. LLM monitoring needs Node.js 18.19 or newer, even though the agent itself supports older versions. On an older runtime nothing is traced and the agent starts normally.
  • You narrowed the list with ATATUS_LLMOBS_INSTRUMENTS or excluded a library with ATATUS_LLMOBS_BLOCK_INSTRUMENTS.

One library is not traced, but the others are

The list logged at startup names the instrumentation that loaded, not the libraries you actually call. A library that is installed at a version the instrumentation cannot trace gets a warning of its own:
Pin a version in the supported range to trace that library now. Everything else keeps working. If there is no such warning and the library still produces no spans, check that you load it with require rather than import. See ES modules.

Check the agent starts first

Instrumentation has to be in place before your LLM library is loaded. If you call require('atatus-nodejs').start(...) after importing the library, nothing is patched. Put the agent first in your entry file, or preload it:

Check you are looking in the right place

An application appears under LLM only after its first LLM span reaches Atatus. Until then it shows under APM only. Make a call through a traced library, then look again.

Spans appear but tokens and cost are zero

Cost is calculated from token counts, so no tokens always means no cost.

Streamed OpenAI chat completions

OpenAI does not report usage on a streamed response unless you ask for it. Ask for it:
The agent then records the token counts and cost for streamed calls just as it does for non-streamed ones.
With include_usage, OpenAI sends one extra chunk at the end carrying only the usage, with an empty choices array. If your code reads chunk.choices[0] without checking, guard it: chunk.choices?.[0]?.delta?.content.
Streaming with Anthropic reports usage without any extra option.

Other causes

  • A proxy or gateway stripped the usage fields. Compare against a direct call to the provider.
  • The model is not in the pricing table. Token counts appear but cost stays zero. This happens with self-hosted or newly released models.

A failed LLM call shows no span

When a call to the model fails, for example on a rate limit or a server error, no LLM span is recorded. The failure is still visible as a failed outgoing HTTP span in APM, but LLM error rates read as zero. This is a limitation of the instrumentation: it records an error only when the call throws immediately, and an API error arrives later as a rejected promise instead. To see these failures today, look at the outgoing HTTP spans to your model provider in APM rather than at the LLM pages.

Prompts or completions are cut short

Long fields are sent up to longFieldMaxLength, which defaults to 10,000 characters. A prompt longer than that is cut at the limit. Raise it if you need the whole thing:

Prompts and completions are missing

Some libraries record only the final input and output rather than each message. In that case you see one prompt and one completion instead of the full conversation. This is a limit of what the library reports, not of the agent. If you see nothing at all under prompts and completions, check whether your calls go through a wrapper that the instrumentation does not recognise, such as a custom client built directly on fetch instead of the provider’s SDK.

The trace tree is flat

Nested calls should form a tree: an agent span with its tool and model calls beneath it. If they all appear side by side instead, check that you are on agent version 3.6.0 or newer. Earlier versions did not carry the parent relationship through the LLM libraries’ spans.

Spans appear twice

A framework calling a provider is expected, and cost is still correct. These are traced independently, so one model call through a framework produces a span for the framework step and another for the provider call underneath it: ChatOpenAI and OpenAI Chat Completions, for example. Tokens and cost are recorded on the framework span only, so nothing is counted twice. The provider span shows zero tokens for that reason. To hide the second span, and only if you never call that provider directly:
Your own OpenTelemetry setup instrumenting the same library. This one does double the counts. Remove the instrumentation from your own setup, or exclude that library from the agent with the same option.

One LLM span shows zero tokens

If the same call also appears as a framework span (ChatOpenAI above OpenAI Chat Completions, for instance), this is deliberate. The counts belong to the framework span so that the call is only counted once. See Spans appear twice. If there is no such pair, see Spans appear but tokens and cost are zero.

Nothing is traced when the application uses ES modules

Libraries loaded with import are only patched when the agent’s loader is running. Start the application with it:
Requires atatus-nodejs 3.6.0 or newer. Earlier versions could not patch ES modules at all, whatever was passed on the command line. A line reading import-in-the-middle failed to wrap ...index-incubating.js is harmless: that one file cannot be rewritten, and everything else still traces.

Still stuck

Collect the agent’s startup logs at info level and the name and version of the LLM library, then contact support.