-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Implement error recording on opentelemetry-appender-tracing #2150
Comments
@Yamakaky That's a fair ask. Would you like to contribute? |
Sure. Some things I'm not sure about: let error = ...;
error!(error);
error!(error, "some error happened");
error!(error, "some error happened: {}", error);
|
@Yamakaky . Regarding: let error = ...;
error!(error);
error!(error, "some error happened");
error!(error, "some error happened: {}", error); I am confused as none of the above you shared are the valid error calls. They won't compile. I can think of below scenarios:
And in 4th case above, we don't need any default message. Just the Also, we don't need to support semconv for exception for now, as they are still experimental. |
I was doing something like that: let e = anyhow::anyhow!("pote").context("prout");
error!(error = e.as_ref() as &dyn std::error::Error); It works, but its a bit verbose to have to cast at each error point (to be fair, not help by anyhow::Error not implementing Error). |
Yes, it is but the otel semantic conventions crate will take a while to get stable, and till then we would like to avoid using it in the crates which will get stable sooner. Can we stick to implementing record_error for handling attribute values? |
@Yamakaky wondering if you have any further questions on this? |
Sorry, priorities changed at work, I haven't had the chance to look at it for now. |
Related Problems?
No response
Describe the solution you'd like:
Currently,
opentelemetry-appender-tracing
records errors using theirDebug
implementation. The cause chain has to be added manually, which is a pain to do at every log point.I believe this would be done in https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-appender-tracing/src/layer.rs#L72.
Otel conventions for errors: https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-logs/
tracing-opentelemetry
implementation for reference: https://github.com/tokio-rs/tracing-opentelemetry/blob/v0.1.x/src/layer.rs#L297Considered Alternatives
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: