openllmetry icon indicating copy to clipboard operation
openllmetry copied to clipboard

🐛 Bug Report: Errors are not logged

Open nirga opened this issue 1 year ago • 16 comments

Which component is this bug for?

All Packages

📜 Description

If an HTTP error is returned from a foundation model API, we don't properly log it as a failed span.

👟 Reproduction steps

N/A

👍 Expected behavior

N/A

👎 Actual Behavior with Screenshots

N/A

🤖 Python Version

No response

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • [X] I checked and didn't find similar issue

Are you willing to submit PR?

None

nirga avatar Feb 08 '24 14:02 nirga

Hi @nirga. Could you specify which components or packages within the project interact directly with foundation model APIs? This information will help narrow down the search to the relevant parts of the codebase.

Also, could you provide insight into how a 'failed span' is defined or identified within the context of the project? This will aid in accurately logging the relevant events as failed spans.

HappyLife2 avatar Feb 25 '24 22:02 HappyLife2

Hey @HappyLife2! These are opentelemetry-instrumentatin-openai, -anthropic, -cohere, -replicate, -bedrock, -vertexai and -transformers.

This is how a failed span should be logged: https://opentelemetry.io/docs/languages/python/instrumentation/#record-exceptions-in-spans

nirga avatar Feb 26 '24 08:02 nirga

I can be assigned to this one if no one wants it.

epg323 avatar May 02 '24 14:05 epg323

That would be great @epg323 :) I assume @HappyLife2 is not actively working on this since it's been 2 months.

nirga avatar May 02 '24 22:05 nirga

Is the issue still open ?

akhilk2802 avatar Jul 03 '24 13:07 akhilk2802

Yes @akhilk2802! Appreciate any help :)

nirga avatar Jul 03 '24 13:07 nirga

okay, looking into it

akhilk2802 avatar Jul 06 '24 10:07 akhilk2802

Is this issue still open or resolved ?

Huzaifa666 avatar Jul 20 '24 15:07 Huzaifa666

Yes this is still open, not sure what's the status of @akhilk2802 though

nirga avatar Jul 20 '24 15:07 nirga

Hey @nirga

I was able to setup a sample project and can see the spans in my dashboard Screenshot from 2024-07-20 23-20-42

I produced a 401 error code by inputting incorrect API_KEY

Screenshot from 2024-07-20 23-23-54

You want this error to be logged as a span Correct me if I am wrong here

Huzaifa666 avatar Jul 20 '24 17:07 Huzaifa666

Exactly @Huzaifa666!

nirga avatar Jul 20 '24 18:07 nirga

Screenshot from 2024-07-20 23-51-53

Is this acceptable ? Was able to show the error in the logged span @nirga

Huzaifa666 avatar Jul 20 '24 18:07 Huzaifa666

Looks good, let's look at the code

nirga avatar Jul 20 '24 18:07 nirga

Have linked the PR with the issue Shared in the slack channel as well

Huzaifa666 avatar Jul 20 '24 19:07 Huzaifa666

Is this still open by chance? I'd love to give it a go.

If it is, I would like to clarify please: Is it for all packages everywhere or just all packages for the ones referenced earlier? opentelemetry-instrumentatin-openai, -anthropic, -cohere, -replicate, -bedrock, -vertexai and -transformers

Bommy32 avatar Aug 29 '24 00:08 Bommy32

@Bommy32 yes it's still open :) It's for all packages, except for the SDK and the sample app

nirga avatar Aug 29 '24 12:08 nirga