Skip to content

feat(observability): add Grafana panel + alert for gittensory_ai_review_onmerge_clamped_total #3901

Description

@JSONbored

Context

src/services/ai-review.ts increments gittensory_ai_review_onmerge_clamped_total whenever a repo's .gittensory.yml tries to loosen the operator's onMerge/combine/reviewer-count floor and gets clamped back — per its own surrounding comment, this exists so "a fired clamp increments a metric so it is surfaced, not silently ignored." The metric is registered in src/selfhost/metrics.ts and increments correctly, but no Grafana panel queries it and no Prometheus alert references it.

This event represents a repo attempting to bypass an operator-set review-strictness floor — a governance/security-relevant condition, not routine operational noise. A counter nobody scrapes into a dashboard or alert is functionally silent for an operator who isn't manually curling /metrics. Notably, the sibling metric this code explicitly cross-references, gittensory_ai_review_inconclusive_total, DOES have a Prometheus alert already — confirming this is a real asymmetric gap.

Requirements

  • Add a Grafana panel (near the existing AI-review reliability row) for increase(gittensory_ai_review_onmerge_clamped_total[1d]) broken down by repo.
  • Add a low-severity Prometheus alert (e.g. increase(...[1h]) > 0) so an attempted floor-bypass is actually seen, not just counted.

Acceptance criteria

  • The metric is visible on the maintainer dashboard and pages/alerts when it fires, matching the treatment already given to its sibling _inconclusive_total metric.

Parent: #1667

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions