Add Forgejo repository health metrics and Grafana dashboard #245

Merged
eblume merged 5 commits from feature/forgejo-metrics-dashboard into main 2026-02-22 11:16:04 -08:00
Owner

Summary

  • New forgejo_metrics Ansible role that queries the Forgejo REST API every 60s and writes Prometheus textfile metrics (open PRs, issues, languages, releases, commits, Actions runs/duration/success)
  • Grafana dashboard "Forgejo Repository Health" with 12 panels across 4 rows: overview stats, CI/CD health, repository info, and staleness tracking
  • Deletes superseded forgejo-actions-dashboard plan doc (this implementation covers a broader scope)

Deployment and Testing

  • mise run provision-indri -- --tags forgejo_metrics to deploy the collector
  • ssh indri 'cat /opt/homebrew/var/node_exporter/textfile/forgejo.prom' to verify metrics
  • argocd app sync grafana-config to deploy the dashboard
  • Check Grafana dashboard "Forgejo Repository Health" loads with data
  • mise run services-check passes
## Summary - New `forgejo_metrics` Ansible role that queries the Forgejo REST API every 60s and writes Prometheus textfile metrics (open PRs, issues, languages, releases, commits, Actions runs/duration/success) - Grafana dashboard "Forgejo Repository Health" with 12 panels across 4 rows: overview stats, CI/CD health, repository info, and staleness tracking - Deletes superseded `forgejo-actions-dashboard` plan doc (this implementation covers a broader scope) ## Deployment and Testing - [ ] `mise run provision-indri -- --tags forgejo_metrics` to deploy the collector - [ ] `ssh indri 'cat /opt/homebrew/var/node_exporter/textfile/forgejo.prom'` to verify metrics - [ ] `argocd app sync grafana-config` to deploy the dashboard - [ ] Check Grafana dashboard "Forgejo Repository Health" loads with data - [ ] `mise run services-check` passes
New forgejo_metrics Ansible role collects repo health, CI/CD, language,
and release metrics from the Forgejo API via textfile collector. Grafana
dashboard provides at-a-glance visibility into build status, staleness,
queue depth, and repository activity across all repos.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use /repos/{r}/commits (not /git/commits) — correct Forgejo API path
- Handle timezone offsets (-08:00) in jq epoch conversion
- Use Forgejo field names: workflow_id, created/stopped, duration (ns)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queries .forgejo/workflows/ (or .github/workflows/) on the default
branch and only emits run_duration and last_success metrics for
workflows found there. Prevents stale deleted workflows from showing
ever-increasing staleness in the dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The jq epoch helper was discarding timezone offsets (e.g. -08:00) and
treating local time as UTC. Now parses the offset with capture() and
applies it correctly: -08:00 adds 8h, +05:30 subtracts 5h30m.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eblume merged commit 2c081eed28 into main 2026-02-22 11:16:04 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eblume/blumeops!245
No description provided.