{ "__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": [ "github", "adoption", "prometheus" ], "description": "Adoption signals for GitHub repos tracked by github-actions-runner-exporter (ADOPTION_REPOS): release asset downloads, stars, forks, watchers, open issues and repo traffic (views, clones, referrers, popular paths). Traffic needs Administration (read) on the exporter token.", "refresh": "1h", "time": { "from": "now-30d", "to": "now" }, "schemaVersion": 39, "timezone": "browser", "editable": true, "links": [], "templating": { "list": [ { "name": "datasource", "label": "Prometheus", "type": "datasource", "query": "prometheus", "current": {}, "hide": 0, "refresh": 1 }, { "name": "repo", "label": "Repo", "type": "query", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "query": { "query": "label_values(github_repo_stars, repo)", "refId": "repo" }, "definition": "label_values(github_repo_stars, repo)", "refresh": 2, "multi": true, "includeAll": true, "allValue": ".*", "current": {} } ] }, "panels": [ { "id": 1, "type": "row", "title": "Right now", "collapsed": false, "gridPos": { "x": 0, "y": 0, "w": 24, "h": 1 }, "panels": [] }, { "id": 2, "type": "stat", "title": "Stars", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 1, "w": 4, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_stars{repo=~\"$repo\"})", "instant": true, "range": false } ], "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "area", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "-" }, "overrides": [] } }, { "id": 3, "type": "stat", "title": "Forks", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 4, "y": 1, "w": 4, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_forks{repo=~\"$repo\"})", "instant": true, "range": false } ], "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "area", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "-" }, "overrides": [] } }, { "id": 4, "type": "stat", "title": "Watchers", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 8, "y": 1, "w": 4, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_watchers{repo=~\"$repo\"})", "instant": true, "range": false } ], "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "area", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "-" }, "overrides": [] } }, { "id": 5, "type": "stat", "title": "Open issues", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 12, "y": 1, "w": 4, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_open_issues{repo=~\"$repo\"})", "instant": true, "range": false } ], "description": "Excludes pull requests.", "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "area", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "-" }, "overrides": [] } }, { "id": 6, "type": "stat", "title": "Downloads (all time)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 16, "y": 1, "w": 4, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_release_asset_downloads_total{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"})", "instant": true, "range": false } ], "description": "Binary archives and packages only (checksums, SBOMs and signatures excluded). Includes automated fetches such as the Homebrew cask's own installs and CI.", "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "area", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "-" }, "overrides": [] } }, { "id": 7, "type": "stat", "title": "Downloads (dashboard range)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 20, "y": 1, "w": 4, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(increase(github_release_asset_downloads_total{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"}[$__range]))", "instant": true, "range": false } ], "description": "Increase over the selected time range. A release published inside the range counts from its first scrape, not from zero.", "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "area", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "-", "decimals": 0 }, "overrides": [] } }, { "id": 8, "type": "row", "title": "Downloads", "collapsed": false, "gridPos": { "x": 0, "y": 5, "w": 24, "h": 1 }, "panels": [] }, { "id": 9, "type": "timeseries", "title": "Downloads per day by asset", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 6, "w": 16, "h": 9 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum by (asset) (label_replace(increase(github_release_asset_downloads_total{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, 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", "custom": { "drawStyle": "bars", "fillOpacity": 80, "stacking": { "mode": "normal" } } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 10, "type": "table", "title": "Downloads by release", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 16, "y": 6, "w": 8, "h": 9 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum by (tag) (github_release_asset_downloads_total{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"})", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "tag": "release", "Value": "downloads" }, "indexByName": { "tag": 0, "Value": 1 } } }, { "id": "sortBy", "options": { "sort": [ { "field": "downloads", "desc": true } ] } } ], "options": { "showHeader": true, "cellHeight": "sm" }, "fieldConfig": { "defaults": {}, "overrides": [] } }, { "id": 11, "type": "table", "title": "Downloads by asset", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 15, "w": 24, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum by (tag, asset) (github_release_asset_downloads_total{repo=~\"$repo\"})", "instant": true, "range": false, "format": "table" } ], "description": "Cumulative, every asset including checksums.", "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "tag": "release", "asset": "asset", "Value": "downloads" }, "indexByName": { "tag": 0, "asset": 1, "Value": 2 } } }, { "id": "sortBy", "options": { "sort": [ { "field": "downloads", "desc": true } ] } } ], "options": { "showHeader": true, "cellHeight": "sm" }, "fieldConfig": { "defaults": {}, "overrides": [] } }, { "id": 12, "type": "row", "title": "Community", "collapsed": false, "gridPos": { "x": 0, "y": 23, "w": 24, "h": 1 }, "panels": [] }, { "id": 13, "type": "timeseries", "title": "Stars, forks, watchers", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 24, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_stars{repo=~\"$repo\"})", "legendFormat": "stars" }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_forks{repo=~\"$repo\"})", "legendFormat": "forks" }, { "refId": "C", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_watchers{repo=~\"$repo\"})", "legendFormat": "watchers" } ], "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "spanNulls": true } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 14, "type": "timeseries", "title": "Open issues", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 12, "y": 24, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_open_issues{repo=~\"$repo\"})", "legendFormat": "open issues" }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(github_repo_open_prs{repo=~\"$repo\"})", "legendFormat": "open PRs" } ], "description": "Open PRs come from the org-wide stats poll.", "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "spanNulls": true } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 15, "type": "row", "title": "Repo traffic (GitHub keeps 14 days; Prometheus keeps the rest)", "collapsed": false, "gridPos": { "x": 0, "y": 32, "w": 24, "h": 1 }, "panels": [] }, { "id": 16, "type": "stat", "title": "Traffic API", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 33, "w": 4, "h": 3 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "min(github_repo_traffic_ok{repo=~\"$repo\"})", "instant": true, "range": false } ], "description": "1 = reading traffic. 0 = the exporter token lacks Administration (read) on the repo, so the panels below stay empty.", "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "background", "graphMode": "none", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "none", "noValue": "-", "mappings": [ { "type": "value", "options": { "0": { "text": "no access", "color": "red" }, "1": { "text": "ok", "color": "green" } } } ] }, "overrides": [] } }, { "id": 17, "type": "barchart", "title": "Views per day", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 4, "y": 33, "w": 10, "h": 9 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "max by (date) (max_over_time(github_repo_traffic_views_daily{repo=~\"$repo\"}[$__range]))", "instant": true, "range": false, "format": "table" }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "max by (date) (max_over_time(github_repo_traffic_view_uniques_daily{repo=~\"$repo\"}[$__range]))", "instant": true, "range": false, "format": "table" } ], "description": "Repo page views. Today is partial (UTC).", "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true, "repo": true }, "renameByName": { "Value #A": "views", "Value #B": "unique visitors" }, "indexByName": { "date": 0 } } }, { "id": "sortBy", "options": { "sort": [ { "field": "date" } ] } } ], "options": { "xField": "date", "orientation": "auto", "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" }, "xTickLabelRotation": -45 }, "fieldConfig": { "defaults": { "custom": { "fillOpacity": 80 } }, "overrides": [] } }, { "id": 18, "type": "barchart", "title": "Clones per day", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 14, "y": 33, "w": 10, "h": 9 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "max by (date) (max_over_time(github_repo_traffic_clones_daily{repo=~\"$repo\"}[$__range]))", "instant": true, "range": false, "format": "table" }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "max by (date) (max_over_time(github_repo_traffic_clone_uniques_daily{repo=~\"$repo\"}[$__range]))", "instant": true, "range": false, "format": "table" } ], "description": "git clones, including CI and `go install` fetches.", "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true, "repo": true }, "renameByName": { "Value #A": "clones", "Value #B": "unique cloners" }, "indexByName": { "date": 0 } } }, { "id": "sortBy", "options": { "sort": [ { "field": "date" } ] } } ], "options": { "xField": "date", "orientation": "auto", "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" }, "xTickLabelRotation": -45 }, "fieldConfig": { "defaults": { "custom": { "fillOpacity": 80 } }, "overrides": [] } }, { "id": 19, "type": "table", "title": "Top referrers (last 14 days)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 42, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum by (referrer) (github_repo_traffic_referrer_views{repo=~\"$repo\"})", "instant": true, "range": false, "format": "table" }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum by (referrer) (github_repo_traffic_referrer_uniques{repo=~\"$repo\"})", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "Value #A": "views", "Value #B": "uniques" }, "indexByName": { "referrer": 0, "Value #A": 1, "Value #B": 2 } } }, { "id": "sortBy", "options": { "sort": [ { "field": "views", "desc": true } ] } } ], "options": { "showHeader": true, "cellHeight": "sm" }, "fieldConfig": { "defaults": {}, "overrides": [] } }, { "id": 20, "type": "table", "title": "Popular content (last 14 days)", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 12, "y": 42, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum by (path) (github_repo_traffic_path_views{repo=~\"$repo\"})", "instant": true, "range": false, "format": "table" }, { "refId": "B", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum by (path) (github_repo_traffic_path_uniques{repo=~\"$repo\"})", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true }, "renameByName": { "Value #A": "views", "Value #B": "uniques" }, "indexByName": { "path": 0, "Value #A": 1, "Value #B": 2 } } }, { "id": "sortBy", "options": { "sort": [ { "field": "views", "desc": true } ] } } ], "options": { "showHeader": true, "cellHeight": "sm" }, "fieldConfig": { "defaults": {}, "overrides": [] } }, { "id": 21, "type": "stat", "title": "Views (selected range)", "description": "Sum of daily views over the selected range.", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 36, "w": 4, "h": 3 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(max by (repo, date) (max_over_time(github_repo_traffic_views_daily{repo=~\"$repo\"}[$__range])))", "instant": true, "range": false } ], "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "none", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "short", "noValue": "-" }, "overrides": [] } }, { "id": 22, "type": "stat", "title": "Clones (selected range)", "description": "Sum of daily clones over the selected range.", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "gridPos": { "x": 0, "y": 39, "w": 4, "h": 3 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${datasource}" }, "expr": "sum(max by (repo, date) (max_over_time(github_repo_traffic_clones_daily{repo=~\"$repo\"}[$__range])))", "instant": true, "range": false } ], "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "none", "graphMode": "none", "textMode": "value" }, "fieldConfig": { "defaults": { "unit": "short", "noValue": "-" }, "overrides": [] } } ], "version": 1 }