traceloop / traceloop/openllmetry

๐Ÿ› Bug Report: Errors in metrics in the instrumentation of bedrock

Open
#2,138 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
  1. 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
image

๐Ÿค– 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.