Improve error reporting - #158
Conversation
b7b6041 to
44b3332
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves observability of failures by switching error logging to structured tracing fields (preserving error source chains) and by adjusting several thiserror messages to avoid flattening underlying error details into strings.
Changes:
- Added
as_dyn_error/anyhow_as_dyn_errorhelpers to standardize recording errors intotracing’serrorfield. - Updated multiple log sites across server/client components to use structured
error = ...fields instead of formatting errors into messages. - Updated several error types to rely on
#[source]/ error chaining rather than embedding the source error into the display message.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| opsqueue/src/tracing.rs | Adds helper functions for recording errors as &dyn Error in tracing, plus documentation/examples. |
| opsqueue/src/server.rs | Updates server bind/retry logging to record errors as structured fields. |
| opsqueue/src/prometheus.rs | Records metric calculation errors with structured error fields. |
| opsqueue/src/producer/server.rs | Records producer server errors with structured error fields. |
| opsqueue/src/producer/client.rs | Records retry-notify errors with structured error fields; simplifies some error messages. |
| opsqueue/src/object_store/mod.rs | Updates object store error messages and marks sources with #[source]. |
| opsqueue/src/db/mod.rs | Records DB health-check acquisition failures with structured error fields. |
| opsqueue/src/consumer/server/mod.rs | Records websocket/internal errors with structured error fields. |
| opsqueue/src/consumer/server/conn.rs | Records chunk reservation errors with structured error fields. |
| opsqueue/src/consumer/client.rs | Records connection/retry/background-task errors with structured error fields; simplifies some error messages. |
| opsqueue/src/common/submission.rs | Records periodic cleanup errors with structured error fields. |
| opsqueue/src/common/mod.rs | Refactors MaxSubmissions parsing error conversions (manual From impls). |
| opsqueue/src/common/errors.rs | Simplifies some error display messages (relying on sources for details). |
| opsqueue/app/main.rs | Records Ctrl-C waiting errors with structured error fields. |
| libs/opsqueue_python/src/errors.rs | Simplifies fatal Python exception display message. |
| libs/opsqueue_python/src/consumer.rs | Records Python consumer errors with structured error fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
44b3332 to
eaa365b
Compare
ReinierMaas
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the improvement. Should we also set the in_app_include when initializing Sentry?
1a3be77 to
6dab4e6
Compare
|
@OpsBotPrime merge and tag |
Approved-by: radekchannable Priority: Normal Auto-deploy: false
|
Rebased as 8284704, waiting for CI … |
|
CI job 🟡 started. |
|
@radekchannable I tagged your PR with v58. Please wait for the build of 8284704 to pass and don't forget to deploy it! |
No description provided.