open-telemetry / open-telemetry/opentelemetry-python-genai

[anthropic] Capture detailed token usage (cache write and modality breakdown)

Open
#604 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39
Forks
63
Avg merge
1d 15h
Merged PRs (30d)
175

Description

Extract and record detailed token usage attributes (gen_ai.usage.cache_write.input_tokens, modality breakdowns) on InferenceInvocation from Anthropic API responses where supported.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Anthropic API responses populate InferenceInvocation and how existing token usage attributes are recorded. Done means capturing cache-write input tokens and supported modality breakdowns under the specified gen_ai.usage attributes, with coverage for supported response cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.