openllmetry
openllmetry copied to clipboard
🐛 Bug Report: Errors are not logged
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
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.
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
I can be assigned to this one if no one wants it.
That would be great @epg323 :) I assume @HappyLife2 is not actively working on this since it's been 2 months.
Is the issue still open ?
Yes @akhilk2802! Appreciate any help :)
okay, looking into it
Is this issue still open or resolved ?
Yes this is still open, not sure what's the status of @akhilk2802 though
Hey @nirga
I was able to setup a sample project and can see the spans in my dashboard
I produced a 401 error code by inputting incorrect API_KEY
You want this error to be logged as a span Correct me if I am wrong here
Exactly @Huzaifa666!
Is this acceptable ? Was able to show the error in the logged span @nirga
Looks good, let's look at the code
Have linked the PR with the issue Shared in the slack channel as well
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 yes it's still open :) It's for all packages, except for the SDK and the sample app