Prometheus exporter for CircleCI. Only projects followed will be considered, this is a limitation of CircleCI's API.
All metrics can be found in src/metrics.ts
file.
At the moment, the builds time are collected in an Histogram, with these labels :
- Repository owner (owner)
- Repository (repo)
- Branch (branch)
- Success (success, "true" or "false")
- Workflow ID (workflow)
- Workflow Job ID (workflow_job)
- Workflow Upstream Jobs (upstream_jobs)
Start ts-node-dev on port 9600.
CIRCLECI_TOKEN=your-circleci-token CIRCLECI_ORGANIZATION=org yarn start
docker build . -t prometheus-exporter-circleci
docker run -e CIRCLECI_TOKEN=your-circleci-token -e CIRCLECI_ORGANIZATION=org -e LOG_LEVEL=silly -p 9600:9600 --rm -it prometheus-exporter-circleci
Server is accessible on http://localhost:9600/metrics
For development, add sources
docker run -e CIRCLECI_TOKEN=your-circleci-token -e CIRCLECI_ORGANIZATION=org -e LOG_LEVEL=silly -v $(pwd):/app -p 9600:9600 --rm --entrypoint yarn -it prometheus-exporter-circleci start
A docker-compose file provide integration with prometheus server.
export CIRCLECI_TOKEN=your-circleci-personal-token
export CIRCLECI_ORGANIZATION=org
docker-compose up
yarn lint
Value in silly
, debug
, verbose
, info
, warn
, error
.
Default info
.
See winston.
Value in json
, prettyPrint
. Some format described in winston documentation may not be working so stick with prettyPrint
or json
unless you know what you are doing.
Default json
.
See log format for more possible format.
Value in development
, production
.
Default production
.
Personal access token. Only projects followed by the user will be considered. This is a limitation of CircleCI's API. See Creating a Personal API Token.
Organisation name.
Port number the http server will listen to.
Default 9600
.
Number of builds per page. Maximum 100
.
Default 100
.
Maximum number of pages to scrape. This is mostly for testing purposes. Default Scrape all pages
The number of milliseconds to go back. Builds older than this number will be ignored.
Default 86400000
(one day).