Rust Error Observability
SkillMonitoring & opsUse when adding, changing, debugging, or reviewing Rust service error handling and observability, especially when separating domain errors from HTTP responses, adding thiserror/anyhow, implementing ResponseError or IntoResponse, adding tracing spans, redacting secrets, or diagnosing async failures.
Use Rust Error Observability in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Rust Error Observability and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Rust Error Observability skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
What this skill tells your AI
The instructions your AI receives, as published by hashgraph-online/awesome-codex-plugins in plugins/LVTD-LLC/skills/skills/rust-error-observability/SKILL.md and read by ahel’s review.
Use this skill to make Rust service failures understandable to operators while keeping user-facing responses safe. Treat error handling and telemetry as one design surface.
Core Workflow
- Inventory error flows: handler return types, service/repository errors, worker errors, middleware, logs, and tracing setup.
- Classify each error by purpose:
- Domain or validation outcome.
- Recoverable control flow.
- Operator diagnostic.
- User-facing HTTP response.
- Keep domain errors typed. Use
thiserrorfor expected branches that callers should match on. - Add context at infrastructure boundaries. Use
anyhowor opaque application errors when callers should not match every dependency failure. - Map errors to HTTP responses in one place per framework:
ResponseError, AxumIntoResponse, or a small adapter function. - Add structured spans before more log lines. Include stable diagnostic fields, not raw payloads or secrets.
- Ensure errors are logged once. Prefer logging at the outer boundary where request context is available.
- Test both the public response and the diagnostic path when behavior changed.
Error Boundary Rules
- Domain modules return domain errors, not HTTP status codes.
- Repository modules attach query or operation context, but do not log every error.
- Handlers convert domain outcomes into response types and let unexpected failures become a consistent 500.
- Background workers log failed job IDs, attempt counts, and next action.
- Avoid
unwrap,expect, or stringlymap_errin service paths unless the invariant is local and the panic message is useful.
Read references/error-boundaries.md when choosing between thiserror,
anyhow, opaque errors, and framework response adapters.
Tracing Rules
- Instrument request handlers, service methods, outbound clients, database operations, and worker jobs at boundaries.
- Use
#[tracing::instrument(skip(...))]for request bodies, pools, clients, passwords, tokens, and large values. - Attach fields like request ID, user ID, tenant ID, job ID, upstream name, and idempotency key when safe.
- Do not log secrets, cookies, password hashes, bearer tokens, or full PII.
Read references/tracing.md for spans, subscriber setup, and test logging.
Read references/secrets-and-pii.md before touching secret-bearing values.
HTTP Response Pattern
Keep response errors stable and intentional:
pub enum SubscribeError {
Validation(SubscribeValidationError),
Unexpected(anyhow::Error),
}
impl actix_web::ResponseError for SubscribeError {
fn status_code(&self) -> actix_web::http::StatusCode {
match self {
Self::Validation(_) => actix_web::http::StatusCode::BAD_REQUEST,
Self::Unexpected(_) => actix_web::http::StatusCode::INTERNAL_SERVER_ERROR,
}
}
}
The response body should be safe for users. The trace event should carry the diagnostic context operators need.
Reference Files
references/error-boundaries.md: choosing error types and response adapters.references/tracing.md: spans, fields, subscriber setup, and test output.references/secrets-and-pii.md: redaction rules for secrets and sensitive user data.
Signals
- GitHub stars
- 1k
- Forks
- 316
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
rust-error-observability- Source
- github.com/hashgraph-online/awesome-codex-plugins
github.com/hashgraph-online/awesome-codex-plugins
Related picks
Skill · rlaope
The pick for Rustrust-async-task-design
Skill · hashgraph-online
The pick for Rustinternal-comms
Skill · anthropics
More in Monitoring & opsagent-eval
Skill · affaan-m
More in Monitoring & opspricing
Skill · coreyhaines31
More in Monitoring & opslark-okr
Skill · larksuite
More in Monitoring & ops