Skip to content

feat(dlq): per-job-type dead-letter breakdown helper for the DLQ dashboard #2082

Description

@JSONbored

countRecentDeadLetters (src/db/repositories.ts:2133) returns a single total from the github_app.dlq_dead_lettered audit events, but the planned DLQ management UI (#1208) needs the breakdown BY jobType to know what's failing. Add a repository helper countRecentDeadLettersByType(env, sinceIso): Record<string,number> that GROUP BYs the jobType stored in the audit metadata. Pure read-only aggregation; does not touch the merge/close decision path.

Deliverables

  • Add countRecentDeadLettersByType in src/db/repositories.ts alongside countRecentDeadLetters, reading the jobType from the audit metadata
  • Return an empty object (not null) when there are no dead letters since sinceIso
  • Sort/normalize keys deterministically; unknown jobType falls back to "unknown"
  • Unit tests: multiple types, single type, none (empty-object branch), and the unknown-fallback branch

References

  • src/db/repositories.ts:2131
  • src/db/repositories.ts:2133
  • src/queue/dlq.ts:39

Part of #1208.


size: S · gittensor:feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions