open-telemetry / open-telemetry/opentelemetry-python-genai
[bedrock] Capture detailed token usage (cache write and modality breakdown)
Open
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 AWS Bedrock responses where supported.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the AWS Bedrock response handling that populates InferenceInvocation and inspect how existing token usage attributes are extracted. Add cache-write input tokens and supported modality breakdowns using the specified gen_ai.usage attributes, then verify that InferenceInvocation records them for responses where Bedrock provides the data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100