Insert ErrorCode into aggregator API response extensions for accurate metrics labeling
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 70
- Forks
- 16
- Avg merge
- 4h 36m
- Merged PRs (30d)
- 30
Description
As of PR #4409, the aggregator API has http_metrics_middleware wired up (shared from janus_aggregator_core), but its Error::into_response() doesn't insert ErrorCode into response extensions the way the aggregator's Error::to_response() does. This means all error responses get labeled "unknown" in the error_code metric attribute instead of a descriptive code.
Each variant in aggregator_api::Error should insert an ErrorCode into the response extensions, following the pattern in aggregator/src/aggregator/error.rs.
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 with aggregator_api::Error::into_response and compare it with the pattern in aggregator/src/aggregator/error.rs. Check each error variant and ensure its response extensions include an ErrorCode, so the error_code metric attribute reports a descriptive value instead of "unknown". Review the existing http_metrics_middleware integration to verify the response metadata is consumed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100