Skip to content

[BUG]: no token count on langgraph instrumentation #2463

@mgathena

Description

@mgathena

Where do you use Phoenix

Self-hosted

What version of Phoenix are you using?

12.14.2

What happened?

total tokens (and hence cost) is 0

the relevant snippet

exporter = OTLPSpanExporter(
    endpoint=f"{os.getenv('PHOENIX_COLLECTOR_ENDPOINT')}/v1/traces",
    headers={"Authorization": f"Bearer {os.getenv('PHOENIX_API_KEY')}"},
)
tracer_provider.add_span_processor(SimpleSpanProcessor(exporter))

LangChainInstrumentor().instrument(tracer_provider=tracer_provider)
Image

I even tried adding OpenAIInstrumentor but that too does not log token count etc. My model is gpt-4.1 (which maps to gpt-4.1-2025-04-14)

Additional information

openinference-instrumentation-langchain==0.1.55

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions