traceloop / traceloop/openllmetry
๐ Bug Report: Errors in metrics in the instrumentation of bedrock
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 1.1k
- Avg merge
- 8d 14h
- Merged PRs (30d)
- 2
Description
Which component is this bug for?
Bedrock Instrumentation
๐ Description
Currently, the instrumentation of bedrock, the responses are not being handled properly, for example the response from amazon.titan-embed-image-v1 when not returning the 'results' field returns the error sum(int(result.get("tokenCount")) for result in response_body.get("results")), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable
๐ Reproduction steps
- Execute the model invocation: amazon.titan-embed-image-v1
๐ Expected behavior
It should correctly return the information in the trace spans and metrics
๐ Actual Behavior with Screenshots
It currently returns an exception
๐ค Python Version
3.11
๐ Provide any additional context for the Bug.
No response
๐ Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
Are you willing to submit PR?
Yes I am willing to submit a PR!
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 with the Bedrock Instrumentation handling for the amazon.titan-embed-image-v1 invocation and trace the response path that evaluates response_body.get("results"). Reproduce the missing-results response under Python 3.11, then verify that trace spans and metrics complete without an exception and report the expected information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100