Skip to content

metrics events: queue-depth measure routing shadows the issue_id dimension #407

Description

@leggetter

Summary

In gateway metrics events, queue-depth measure routing is checked before the issue_id dimension, so a request combining them silently goes to the queue-depth endpoint and the dimension is ignored.

Reproduce

hookdeck gateway metrics events --start ... --end ... \
  --measures queue_depth --dimensions issue_id --issue-id iss_xxx

Routes to /metrics/queue-depth. The issue_id dimension is dropped; no error.

Root cause

queryEventMetricsConsolidated in pkg/cmd/metrics_events.go evaluates route conditions in order: queue-depth measures first, then pending, then the issue_id dimension / --issue-id filter. The first match wins, so a queue-depth measure shadows a by-issue request.

Why it matters

Same family as #382 — the user asks for one thing and gets an unflagged answer to a different question. Lower impact than #382 because the combination is unusual, but the failure mode is identical: a plausible-looking number that does not answer what was asked.

Suggested fix

Treat it as a cross-route conflict, consistent with the mixed-measure rejection added in #392: refuse the combination and name both routes, rather than silently picking one. The helper introduced there (RejectMixedMeasureRoutes) already establishes the pattern and the message style.

Testing

Unit, alongside the existing routing tests in pkg/cmd/metrics_events_routing_test.go, which drive the router against an httptest server and assert the path actually requested.

Related


Filed by Claude on Phil's behalf, from release-candidate testing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions