Skip to content

🐛 Bug Report: Errors in metrics in the instrumentation of bedrock #2138

Open
@naghost-dev

Description

@naghost-dev

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions