divviup / divviup/janus

Insert ErrorCode into aggregator API response extensions for accurate metrics labeling

Open
#4,425 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

observability
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.