Skip to content

Improve error reporting - #158

Merged
OpsBotPrime merged 5 commits into
masterfrom
dyn-error
Jul 30, 2026
Merged

Improve error reporting#158
OpsBotPrime merged 5 commits into
masterfrom
dyn-error

Conversation

@radekchannable

Copy link
Copy Markdown
Contributor

No description provided.

@radekchannable radekchannable changed the title Dyn error Improve error reporting Jul 29, 2026
@radekchannable
radekchannable marked this pull request as ready for review July 29, 2026 13:48
@radekchannable
radekchannable requested a review from Copilot July 29, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_error helpers to standardize recording errors into tracing’s error field.
  • 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.

Comment thread opsqueue/src/tracing.rs
Comment thread opsqueue/src/tracing.rs
Comment thread opsqueue/src/server.rs

@ReinierMaas ReinierMaas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the improvement. Should we also set the in_app_include when initializing Sentry?

@radekchannable

Copy link
Copy Markdown
Contributor Author

@OpsBotPrime merge and tag

Approved-by: radekchannable
Priority: Normal
Auto-deploy: false
@OpsBotPrime

Copy link
Copy Markdown
Contributor

Rebased as 8284704, waiting for CI …

@OpsBotPrime

Copy link
Copy Markdown
Contributor

CI job 🟡 started.

@OpsBotPrime

Copy link
Copy Markdown
Contributor

@radekchannable I tagged your PR with v58. Please wait for the build of 8284704 to pass and don't forget to deploy it!

@OpsBotPrime
OpsBotPrime merged commit 8284704 into master Jul 30, 2026
6 of 7 checks passed
@radekchannable
radekchannable deleted the dyn-error branch July 30, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants