Skip to content

Observability: log line only, or also a Prometheus metric on trigger? #61

Description

@weselben

Status

Options A/B/C posted in a follow-up comment. Waiting on user reply.

Status

Options A/B/C posted in a follow-up comment. Waiting on user reply.

Question

Question

The prototype logs slog.Warn on trigger. Should we also expose a counter (e.g. gomodel_stream_repetition_triggers_total{provider,model}) so operators can alert on looping models?

Activity

  1. weselben commented on Sep 1, 2026

    @weselben
    OwnerAuthor

    Phone-friendly options (reply with a letter; unblocked by your #57 answer):

    • A: log only (current). slog.Warn on trigger. Zero new surface.
    • B (recommended): log + Prometheus counter gomodel_stream_repetition_triggers_total{provider,model}. Alertable; matches how every other gateway labels loop aborts (vLLM uses finished_reason labels).
    • C: log + counter + per-choice histogram of repeat counts. Richest; most code for marginal value.

    Grill note: the counter is what makes the guard tunable later — without it you cannot see which providers actually loop.

  2. weselben commented on Sep 1, 2026

    @weselben
    OwnerAuthor

    B

  3. weselben commented on Sep 1, 2026

    @weselben
    OwnerAuthor

    Resolved: B. Log line + Prometheus counter gomodel_stream_repetition_triggers_total{provider,model} on every trigger, alongside the existing slog.Warn. Counter makes the guard tunable later (shows which providers actually loop). Implementation note: reuse the gateway's existing metrics registry pattern; no histogram for v1.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions