Skip to content

[5/6] Add a Grafana dashboard - #392

Merged
andrew merged 4 commits into
git-pkgs:mainfrom
wickedOne:analytics-5-grafana
Oct 2, 2026
Merged

andrew merged 4 commits into
git-pkgs:mainfrom
wickedOne:analytics-5-grafana

Conversation

@wickedOne

@wickedOne wickedOne commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Grafana dashboard

Part 5 of six splitting #381 ("analytics dashboard") into reviewable pieces, as the review there asked for. #381 stays open as the umbrella and reference thread until the last of these lands; it is not meant to be merged.

Series: #388 route coverage · #389 ecosystem stats · #390 analytics page · #391 /stats breakdown · #392 Grafana dashboard · #393 source attribution

Needs #389 and #390 for the metrics it queries, and branches off #391, so until the chain merges the Files changed tab here shows those too. The last commit is this part.

A ready-made dashboard at deploy/grafana/git-pkgs-proxy.json, 33 panels across Overview, Download volume, Traffic and cache, Reliability, Storage and scanning, Cache composition and Bytes served. Import via Dashboards -> New -> Import and pick your Prometheus data source when prompted; there is no hardcoded data source UID.

Three ecosystem variables

ecosystem means three different things across /metrics, and the dashboard says so rather than papering over it.

Ecosystem filters the database-derived gauges, whose label comes from the package record and is normalized, so gem reads as rubygems.

Route filters proxy_requests_total, proxy_request_duration_seconds and proxy_response_bytes_total, whose label comes from the request path. Mostly the same names, except the Debian route reports debian where the package record says deb, and non-package paths report other.

Upstream filters proxy_upstream_fetch_duration_seconds and proxy_upstream_errors_total, whose label is the handler's own name: composer, gem and go where the other two say packagist, rubygems and golang.

#381 normalized that third set so it would join with the others. The review there asked for that to be its own PR, since renaming published series is a metric surface change that wants releasing and noting on its own; the decision is not to make it at all. So those two panels get their own variable instead. All three are query variables, so they populate from whatever labels your proxy is actually reporting.

Every proxy_* metric the JSON queries was checked against the registry output; there are no dangling panels.

@wickedOne wickedOne changed the title Analytics 5 grafana Add a Grafana dashboard Oct 1, 2026
@wickedOne wickedOne changed the title Add a Grafana dashboard [5/6] Add a Grafana dashboard Oct 1, 2026
wickedOne and others added 4 commits October 1, 2026 16:15
- Add GetEcosystemStats, aggregating packages, versions, artifacts,
  cache size, downloads and downloaded bytes per ecosystem
- Publish six proxy_ecosystem_* gauges from it on the existing
  one-minute cache-stats tick
- Set and selectively delete rather than Reset, so no scrape lands on
  a half-populated vector
- Report artifacts with no package row under "unattributed" rather
  than dropping them, so the figures still add up

Part 2 of 6 splitting git-pkgs#381 up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Ring of download size by ecosystem, cache figures, per-ecosystem
  table, vulnerability overview and a Runtime card
- Add metrics.Gather so the page can render counters that were never
  in the database
- Add proxy_response_bytes_total and response-writer byte counting
- Serve a retained snapshot behind a staleness banner when the
  aggregation fails, rather than rendering old figures as current
- Extract the security overview into a shared component

Part 3 of 6 splitting git-pkgs#381 up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Add downloaded_bytes, downloads and an ecosystems array, served from
  the snapshot the gauges and the page already share
- Add stats_unavailable so a failed aggregation is distinguishable
  from an idle proxy
- Regenerate the OpenAPI spec

Part 4 of 6 splitting git-pkgs#381 up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- 33 panels, no hardcoded data source UID
- Three ecosystem variables, because the label means three different
  things across /metrics: the package record, the request path, and
  the handler's own name

Part 5 of 6 splitting git-pkgs#381 up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wickedOne
wickedOne force-pushed the analytics-5-grafana branch from 064166b to 36fe6ab Compare October 1, 2026 14:19
@andrew
andrew merged commit 5fce187 into git-pkgs:main Oct 2, 2026
6 checks passed
@wickedOne
wickedOne deleted the analytics-5-grafana branch October 2, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants