Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ scrape.
| `github_runner_busy` | `runner`, `os` | 1 if the runner is currently executing a job, 0 if idle |
| `github_org_up` | | 1 if the last org/repo stats poll succeeded, 0 if a stale cache is being served or the first poll is still running (about a minute after startup at ~25 repos) |
| `github_org_info` | `org` | Always 1; the org this exporter watches. The dashboard reads it to link to github.com |
| `github_org_repos_total` | `visibility` | Number of non-archived repos, by `public`/`private` |
| `github_org_repos` | `visibility` | Number of non-archived repos, by `public`/`private` |
| `github_rate_limit_remaining` | | Remaining core API budget in the scarcest active window: the one that runs out first |
| `github_rate_limit_limit` | | Total core API budget of that window |
| `github_rate_limit_window_remaining` | `reset` | Remaining budget per active core window, labelled with its reset time. GitHub counts per region, so one token can have several windows at once, and which one a call counts against depends on the endpoint. A window's series disappears once it resets |
Expand All @@ -56,6 +56,8 @@ scrape.
| `github_workflow_runs_total` | `repo`, `workflow`, `conclusion` | Counter: completed workflow runs, once per run attempt |
| `github_repo_dependabot_alerts_open` | `repo`, `severity` | Open Dependabot alerts by severity. Absent for a severity with zero open alerts |

> **Renamed:** `github_org_repos_total` is now `github_org_repos` (it is a gauge, and `_total` is reserved for counters), and `github_release_asset_downloads` is now the counter `github_release_asset_downloads_total`. Update custom queries and re-import the dashboards.

## Run history

Each org refresh lists every repo's runs created since a per-repo
Expand Down Expand Up @@ -112,7 +114,7 @@ traffic; nothing is collected from the tracked project's users.
| --- | --- | --- |
| `github_adoption_up` | | 1 if the last poll succeeded, 0 if stale |
| `github_repo_stars`, `_forks`, `_watchers`, `_open_issues` | `repo` | Counts; open issues exclude PRs |
| `github_release_asset_downloads` | `repo`, `tag`, `asset` | Cumulative `download_count` per release asset (drafts skipped). Chart with `increase()` |
| `github_release_asset_downloads_total` | `repo`, `tag`, `asset` | Cumulative `download_count` per release asset (drafts skipped). Chart with `increase()` |
| `github_repo_traffic_ok` | `repo` | 0 if the token lacks push access, so the traffic metrics below are absent |
| `github_repo_traffic_views_daily`, `_view_uniques_daily`, `_clones_daily`, `_clone_uniques_daily` | `repo`, `date` | One series per UTC day; today's is partial |
| `github_repo_traffic_referrer_views`, `_referrer_uniques` | `repo`, `referrer` | Top 10 referrers, last 14 days |
Expand Down
4 changes: 2 additions & 2 deletions dashboards/github-actions-runner-exporter.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
},
"targets": [
{
"expr": "max by (visibility) (github_org_repos_total{visibility=\"public\"})",
"expr": "max by (visibility) (github_org_repos{visibility=\"public\"})",
"instant": true,
"range": false,
"refId": "A"
Expand Down Expand Up @@ -629,7 +629,7 @@
},
"targets": [
{
"expr": "max by (visibility) (github_org_repos_total{visibility=\"private\"})",
"expr": "max by (visibility) (github_org_repos{visibility=\"private\"})",
"instant": true,
"range": false,
"refId": "A"
Expand Down
10 changes: 5 additions & 5 deletions dashboards/github-repo-traffic-downloads.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"expr": "sum(github_release_asset_downloads{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"})",
"expr": "sum(github_release_asset_downloads_total{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"})",
"instant": true,
"range": false
}
Expand Down Expand Up @@ -355,7 +355,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"expr": "sum(increase(github_release_asset_downloads{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"}[$__range]))",
"expr": "sum(increase(github_release_asset_downloads_total{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"}[$__range]))",
"instant": true,
"range": false
}
Expand Down Expand Up @@ -415,7 +415,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"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]+(.*)\"))",
"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}}"
}
],
Expand Down Expand Up @@ -465,7 +465,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"expr": "sum by (tag) (github_release_asset_downloads{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"})",
"expr": "sum by (tag) (github_release_asset_downloads_total{repo=~\"$repo\",asset!~\".*(checksums|\\\\.sbom|\\\\.sig|\\\\.pem|\\\\.json).*\"})",
"instant": true,
"range": false,
"format": "table"
Expand Down Expand Up @@ -534,7 +534,7 @@
"type": "prometheus",
"uid": "${datasource}"
},
"expr": "sum by (tag, asset) (github_release_asset_downloads{repo=~\"$repo\"})",
"expr": "sum by (tag, asset) (github_release_asset_downloads_total{repo=~\"$repo\"})",
"instant": true,
"range": false,
"format": "table"
Expand Down
4 changes: 2 additions & 2 deletions internal/collector/adoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewAdoption(f *fetch.Fetcher[adoption.Summary], ttl time.Duration) *Adoptio
forks: d("repo", "forks", "Forks.", "repo"),
watchers: d("repo", "watchers", "Watchers (subscribers).", "repo"),
openIssues: d("repo", "open_issues", "Open issues, excluding pull requests.", "repo"),
downloads: d("release", "asset_downloads", "Cumulative download count of a release asset. Chart with increase(), not raw.",
downloads: d("release", "asset_downloads_total", "Cumulative download count of a release asset. Chart with increase(), not raw.",
"repo", "tag", "asset"),

trafficOK: d("repo", "traffic_ok", "Whether the traffic API answered (1) or the token lacks push access (0).", "repo"),
Expand Down Expand Up @@ -79,7 +79,7 @@ func (a *Adoption) Collect(ch chan<- prometheus.Metric) {
g(a.watchers, float64(r.Watchers), r.Name)
g(a.openIssues, float64(r.OpenIssues), r.Name)
for _, x := range r.Downloads {
g(a.downloads, float64(x.Count), r.Name, x.Tag, x.Asset)
ch <- prometheus.MustNewConstMetric(a.downloads, prometheus.CounterValue, float64(x.Count), r.Name, x.Tag, x.Asset)
}

if !r.TrafficOK {
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func New(org string, runnerFetcher *fetch.Fetcher[runners.Summary], orgFetcher *
// lets dashboards build github.com links without a hand-set variable
orgInfo: desc("org", "info",
"Always 1; the GitHub org this exporter watches is in the org label.", []string{"org"}),
reposTotal: desc("org", "repos_total",
reposTotal: desc("org", "repos",
"Number of non-archived repos in the org."+orgNote, []string{"visibility"}),
rateLimit: desc("rate_limit", "remaining",
"Remaining core API rate-limit budget, as of the latest GitHub response.", nil),
Expand Down
Loading