This exporter fetches Dependabot alerts for all repositories in a GitHub organization and exposes metrics per repository, severity, and state for consumption by Prometheus.
- Aggregates Dependabot alerts across all repositories in a GitHub organization.
- Exposes metrics by repository, severity, and alert state.
- Supports authentication via GitHub Personal Access Token or GitHub App.
- Metrics refreshed automatically every day at midnight (UTC).
- Lightweight, single binary.
The exporter exposes the following metric:
github_dependabot_alerts{repo="repo-name",severity="high",state="open"} 4
- repo: The repository name.
- severity: The alert severity (
critical,high,medium,low). - state: The alert state (
open,fixed,dismissed, etc.). - value: Number of alerts matching the labels.
go build -o github-dependabot-exporterSet the following environment variables:
LOG_LEVEL: (Opt.) The log level, defaults toinfo.LISTEN_PORT: (Opt.) The port on which the exporter will expose its metrics, defaults to9090.CRON_SCHEDULE: (Opt.) The schedule for running the exporter using standard CRON syntax (e.g.,"0 * * * *"for every hour).GITHUB_ORG: The name of your GitHub organization.
GITHUB_AUTH_MODE:patGITHUB_TOKEN: A GitHub Personal Access Token withrepoandsecurity_eventsread access.
GITHUB_AUTH_MODE:appGITHUB_APP_ID: The ID of your GitHub App (numeric).GITHUB_APP_INSTALLATION_ID: The installation ID for your org.GITHUB_APP_PRIVATE_KEY_PATH: Path to your GitHub App private key (PEM file).
./github-dependabot-exporterMetrics will be available at:
http://localhost:9090/metrics
scrape_configs:
- job_name: 'github-dependabot-exporter'
static_configs:
- targets: ['localhost:8080']# HELP github_dependabot_alerts Number of Dependabot alerts per repository, severity, and state
# TYPE github_dependabot_alerts gauge
github_dependabot_alerts{repo="my-repo",severity="high",state="open"} 2
github_dependabot_alerts{repo="my-repo",severity="medium",state="fixed"} 1
github_dependabot_alerts{repo="another-repo",severity="low",state="open"} 1
- Requires Go 1.24+.
- Run tests with:
go test- The exporter requires read access to Dependabot alerts in your organization.
- Store your tokens/keys securely and limit their permissions as much as possible.
MIT