vaadin / vaadin/observability-kit
Add error logs as events to traces
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 7
- Forks
- 5
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 25
Description
As a developer I would like to see both, unhandled and handled errors as part of a trace. Currently our instrumentations are only built to record unhandled exceptions. However a likely pattern that developers might follow in views is to run an operation due to an event, and then catch + log errors from that operation, while showing the user some error notification. With access to application logs they can still see these errors, however with our solution that would not be the case.
We should consider enriching our traces with error logs at least. Logged errors would be recorded as events on traces, ideally on the current span, rather than the root span. This would require instrumenting specific logging libraries, like log4j or logback. OTel has existing instrumentations for both which could be checked to get an idea on how to make this work.
Depending on how the error handling in an application works (catch + log, catch + log + rethrow) we might want to make this optional as otherwise the error might be recorded multiple times.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing OpenTelemetry instrumentations for log4j and logback, then examine how this project currently records unhandled exceptions. Define how handled error logs should become events on the current span, including whether recording is optional and how catch-log-rethrow avoids duplicates. Done means the supported logging paths and configuration behavior are implemented and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100