https://github.com/josh/github_exporter
Prometheus exporter for GitHub metrics
https://github.com/josh/github_exporter
github metrics monitoring prometheus prometheus-exporter
Last synced: 10 months ago
JSON representation
Prometheus exporter for GitHub metrics
- Host: GitHub
- URL: https://github.com/josh/github_exporter
- Owner: josh
- License: mit
- Created: 2024-12-27T02:25:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-04T18:28:32.000Z (11 months ago)
- Last Synced: 2025-08-04T20:58:36.274Z (11 months ago)
- Topics: github, metrics, monitoring, prometheus, prometheus-exporter
- Language: Go
- Homepage:
- Size: 292 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Prometheus Exporter
A Prometheus exporter that collects metrics from GitHub, including:
- Issue and pull request counts
- Notification counts
- Workflow run states and numbers
## Usage
The exporter requires a GitHub personal access token to function. Set it via the `GITHUB_TOKEN` environment variable or using the `--token` flag.
### Serve Mode
Run as a Prometheus metrics endpoint:
```bash
github_exporter serve [options]
Options:
-h, --host Host address to listen on (default: ":9448")
-i, --interval Metrics collection interval (default: 15m)
```
Metrics will be available at `http://localhost:9448/metrics`
### Generate Mode
Generate metrics once and exit:
```bash
github_exporter generate [options]
Options:
-o, --output Output file path (defaults to stdout if not specified)
-p, --pushgateway Pushgateway URL to send metrics to
-r, --pushgateway-retries Number of retries for Pushgateway requests (default: 1)
```
### Environment Variables
All CLI options can be configured via environment variables:
- `GITHUB_TOKEN`: GitHub personal access token (required)
- `GITHUB_EXPORTER_VERBOSE`: Enable verbose logging
- `GITHUB_EXPORTER_HOST`: Host address for serve mode
- `GITHUB_EXPORTER_INTERVAL`: Collection interval for serve mode
- `GITHUB_EXPORTER_OUTPUT`: Output file path for generate mode
- `GITHUB_EXPORTER_PUSHGATEWAY_URL`: Pushgateway URL for generate mode
- `GITHUB_EXPORTER_PUSHGATEWAY_RETRIES`: Number of retries for Pushgateway requests (default: 1)