artifactory-prometheus-exporter
artifactory-prometheus-exporter copied to clipboard
Prometheus exporter for Artifactory
Exposes metrics for Artifactory from its REST API to Prometheus endpoint.
This project is heavily inspired by https://github.com/m4h/prometheus.
Configuration
This exporter needs following environment variables to run correctly:
Required
-
ARTIFACTORY_URL
- URL of Artifactory instance e.g.https://acme.jfrog.io/acme
. -
ARTIFACTORY_USER
- Artifactory user. -
ARTIFACTORY_PASSWORD
- Artifactory password.
Optional
-
APP_PORT
- the port on which exporter listens, defaults ot 9600. -
APP_INTERVAL
- interval in seconds for getting metrics from Artifactory REST API. -
APP_LOG_LEVEL
- log level.
Docker
Run from Docker Hub:
docker run -p 9600:9600 -e ARTIFACTORY_URL=http://artifactory -e ARTIFACTORY_USER=admin -e ARTIFACTORY_PASSWORD=admin petrjurasek/artifactory-prometheus-exporter
Build and run docker image:
docker build -t <image-name> .
docker run -p 9600:9600 -e ARTIFACTORY_URL=http://artifactory -e ARTIFACTORY_USER=admin -e ARTIFACTORY_PASSWORD=admin <image-name>
Metrics
Metrics are then available on listening port and examples can be found in METRICS page.
Development
Requirements
- python 3.5 is required.
- pipenv to be installed (
pip install pipenv
). - run
pipenv shell
to switch to virtual env, then runpipenv install
.
Formatting code
Install dev dependcies pipenv install --dev
and run yapf
formatter - yapf -r . --in-place
.