Prometheus exporter for bareos data recovery system
Usage with docker
- Create a .env file containing at least your database password using
DB_PASSWORD
variable. - Run docker image as follows
docker run --name bareos_exporter -p 9625:9625 -e DB_TYPE=mysql -e DB_NAME=bareos-dir -d vierbergenlars/bareos_exporter:latest
Default variables:
PORT
9625 (exporter)DB_TYPE
postgresDB_HOST
localhostDB_PORT
5432 (postgres)DB_USER
bareosDB_NAME
bareosSSL_MODE
disable (postgres only)ENDPOINT
/metricsJOB_DAYS
7WAIT_FOR_DB
0
docker run --name bareos_exporter -p 9625:9625 -d vierbergenlars/bareos_exporter:latest -dsn 'mysql://login:password@tcp(host:port)/dbname?parseTime=true'
docker run --name bareos_exporter -t -i --rm --entrypoint=/bin/sh vierbergenlars/bareos_exporter:latest
These metrics are aggregated across all jobs with the same name, type, client and fileset that are in the catalog.
Metrics:
bareos_jobs_run
: Total number of jobs that have run with the parameters from the labelsbareos_files_saved
: Total number of files saved during all backups with the parameters from the labelsbareos_bytes_saved
: Toal number of bytes saved during all backups with the parameters from the labels
Labels:
jobname
: Name of the jobjobtype
: Type indication of the job (B
is backup,O
is consolidate,R
is restore)client
: Name of the client of the jobfileset
: Name of the fileset of the job
These metrics are for the latest job with the same name, type, client and fileset.
The whichjob
label indicates what criterium was used to select the latest job.
Metrics:
bareos_last_job_bytes_saved
: Number of bytes saved during the latest jobbareos_last_job_files_saved
: Number of files saved during the latest jobbareos_last_job_errors
: Number of errors that occured during the latest jobbareos_last_job_start_unix_timestamp
: Timestamp of the start time of the latest jobbareos_last_job_end_unix_timestamp
: Timestamp of the end time of the latest jobbareos_last_job_status
: Current status of the latest job. This is a binary metric (0 or 1) The value will be 1 only for thestatus
label that currently applies for the job
Labels:
jobname
: Name of the jobjobtype
: Type indication of the job (B
is backup,O
is consolidate,R
is restore)client
: Name of the client of the jobfileset
: Name of the fileset of the joblast_selector
: Selector used for determining the last joblast
: The job with the highest start timelast_successful
: The job with the highest start time that terminated succesfullylast_successful_full
: The job with the highest start time that terminated succesfully and is a full backup
These metrics are aggregates for all volumes in a pool
Metrics:
bareos_pool_bytes
: Number of bytes stored in a poolbareos_pool_volumes
: Number of volumes stored in a pool
Labels:
pool
: The pool which the volumes are member ofprunable
:true
orfalse
depending on whether there are still jobs referencing the counted volumesexpired
:true
orfalse
depending on whether the volume has expired or not
Name | Description | Default |
---|---|---|
port | Bareos exporter port | 9625 |
endpoint | Bareos exporter endpoint. | "/metrics" |
dsn | Data source name of the database that is used by bareos. Protocol can be mysql:// or postgres:// . The rest of the string is passed to the database driver. |
"mysql://bareos@unix()/bareos?parseTime=true" "postgres://dbname=bareos sslmode=disable user=bareos password=bareos" "postgres://host=/var/run/postgresql dbname=bareos" |
job-discovery-days | Number of days to look in the history to discover active jobs. Only jobs that have last run this number of days will be considered for data reporting. | 7 |