Skip to content

metrics: cg_component_gate_declines_total carries events that are not declines #121

Description

@amiddavid

rep.Gate is used as a component's per-event histogram, and it surfaces through the Prometheus series cg_component_gate_declines_total{component,gate}. Several of the events it now carries are not declines:

  • extract_llm_sweep: sweep_dropped, sweep_adjudicated, sweep_offered — these count work done, not work refused.
  • extract_llm: reapplied_same_session, reapplied_cross_session — a cache hit, i.e. a success.

So a dashboard or alert reading that series as "how often did components decline to act" is reading a mixture of declines and successes, and the more a component succeeds the higher its "declines" go. Anyone summing it to reason about pipeline effectiveness gets the wrong sign.

Pre-existing and shipped, which is the reason it was not fixed in #118: the series name is in use, and renaming it is a breaking change for whatever scrapes and graphs it. extract_llm already had this shape before the sweep component existed.

The options, and why this needs a decision rather than a patch

  1. Rename the series to something honest (cg_component_gate_events_total) and keep the old name as an alias for a deprecation window. Correct, but touches every dashboard and alert that references it.
  2. Split the series — declines stay in the current name, non-decline events move to a new one. Most accurate, most work, and it means each component's gate calls have to be classified.
  3. Leave it and document the convention where it is read, not just where it is written. Cheapest; leaves a metric whose name misdescribes its contents, which is how it produced this issue.

Found by

The implementation pass for #118, which added the sweep counters and noticed they were landing in a series named for the opposite of what they measure. Flagged rather than renamed, since a shipped series is not something to change as a side effect of unrelated work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions