https://github.com/borisputerka-zz/github_billing_exporter
Billing exporter for GitHub organizations
https://github.com/borisputerka-zz/github_billing_exporter
billing github metrics monitoring prometheus prometheus-exporter prometheus-metrics
Last synced: 20 days ago
JSON representation
Billing exporter for GitHub organizations
- Host: GitHub
- URL: https://github.com/borisputerka-zz/github_billing_exporter
- Owner: borisputerka-zz
- License: apache-2.0
- Created: 2020-12-24T04:58:35.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-31T15:47:28.000Z (over 3 years ago)
- Last Synced: 2024-06-19T16:47:21.059Z (over 1 year ago)
- Topics: billing, github, metrics, monitoring, prometheus, prometheus-exporter, prometheus-metrics
- Language: Go
- Homepage:
- Size: 61.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub billing exporter
[](https://github.com/borisputerka/github_billing_exporter/releases)
[](https://goreportcard.com/report/github.com/borisputerka/github_billing_exporter)
This expoter exposes [Prometheus](https://prometheus.io/) metrics from GitHub billing API [endpoint](https://docs.github.com/en/free-pro-team@latest/rest/reference/billing).
## Building and running
## Token privileges
Token needs to have access to read billing data.
### Build
make
### Running
Running using an environment variable:
export GITHUB_ORGS="ORG1,ORG2,..."
export GITHUB_TOKEN="example_token"
./github_billing_exporter
Running using args:
./github_billing_exporter \
--github-orgs="ORG1,ORG2,..." \
--github-token="example_token"
## Collectors
There are three collectors (`actions`, `packages` and `storage`) all enabled by default. Disabling collector(s) can be done using arg `--no-collector.`.
### List of collectors
Name | Description | Enabled
---------|-------------------------------------------------------------------------------|--------
actions | Exposes billing statistics from `/orgs/{org}/settings/billing/actions` | `true`
packages | Exposes billing statistics from `/orgs/{org}/settings/billing/packages` | `true`
storage | Exposes billing statistics from `/orgs/{org}/settings/billing/shared-storage` | `true`
## Environment variables / args reference
Version | Env | Arg | Description | Default
-----------|-----------------------|-------------------------|--------------------------------------------|---------
=`0.1.0` | `DISABLED_COLLECTORS` | `--disabled-collectors` | Collectors to disable | `""`
\>=`0.1.0` | `GITHUB_ORGS` | `--github-orgs` | GitHub organizations to scrape metrics for | `""`
\>=`0.1.0` | `GITHUB_TOKEN` | `--github-token` | GitHub token with billind read privileges | `""`
\>=`0.1.0` | `LISTEN_ADDRESS` | `--web.listen-address` | Address on which to expose metrics. | `:9776`
\>=`0.1.0` | `METRICS_PATH` | `--web.telemetry-path` | Path under which to expose metrics. | `/metrics`