diff --git a/dashboards/github-repo-traffic-downloads.json b/dashboards/github-repo-traffic-downloads.json index 85c4e6b..30f454c 100644 --- a/dashboards/github-repo-traffic-downloads.json +++ b/dashboards/github-repo-traffic-downloads.json @@ -1,4 +1,44 @@ { + "__inputs": [], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "13.2.2" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "title": "GitHub Repo Traffic & Downloads", "uid": "github-repo-traffic-downloads", "tags": [ @@ -375,11 +415,11 @@ "type": "prometheus", "uid": "${datasource}" }, - "expr": "sum by (asset) (increase(github_release_asset_downloads{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"}[1d]))", + "expr": "sum by (asset) (label_replace(increase(github_release_asset_downloads{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"}[1d]), \"asset\", \"$1$2\", \"asset\", \"(.*?)[_-]v?[0-9]+\\\\.[0-9]+\\\\.[0-9]+(.*)\"))", "legendFormat": "{{asset}}" } ], - "description": "Release asset download_count is cumulative; this is its daily increase. History starts when the exporter first scraped the repo.", + "description": "Release asset download_count is cumulative; this is its daily increase, with the version stripped from asset names so each platform is one series. History starts when the exporter first scraped the repo.", "fieldConfig": { "defaults": { "unit": "short", @@ -1103,5 +1143,6 @@ "overrides": [] } } - ] + ], + "version": 1 }