This exporter serves a Prometheus-compatible /metrics/ endpoint. It pulls information from a Comet Server on-demand.
This exporter is made available under the terms of the MIT license. You are free to use and modify this script for any purpose as long as you retain the copyright notice in the LICENSE file and/or elsewhere in this repository.
# Build Docker image
docker build . -t comet-prometheus-exporter:latest
# Run container instance against target Comet Server
docker run -d --restart=always -e COMET_SERVER_URL="http://127.0.0.1/" -e COMET_ADMIN_USER="admin" -e COMET_ADMIN_PASS="admin" -p 80:80 comet-prometheus-exporter:latest- Install necessary dependencies
php,php-curl
- Configure web server to host
/wwwrootdirectory - Configure web server to set configuration environment variables
Add the exporter's URL to prometheus.yml in the scrape_configs > static_configs > targets array.
To develop the exporter, run a development container that bind-mounts your Git checkout directory:
# Replace /c/repos/comet-prometheus-exporter/ with the path to your Git checkout
docker run --rm \
-v /c/repos/comet-prometheus-exporter/approot:/approot \
-e COMET_SERVER_URL="http://127.0.0.1/" \
-e COMET_ADMIN_USER="admin" \
-e COMET_ADMIN_PASS="admin" \
-p 12000:80 \
comet-prometheus-exporter:latestYou can then visit the development instance in a web browser on http://127.0.0.1:12000/metrics/ for development and troubleshooting.
If you've made a change to the exporter that you think would be useful for other partners too, we'd love to incorporate it - please submit a pull request on GitHub or send your modifications via the CometBackup.com ticket system.
This exporter produces the following metrics:
cometserver_api_lookup_duration(Gauge)- The time required to retrieve data from the Comet Server (ms)
cometserver_users_total(Gauge)- Total number of users on this Comet Server
cometserver_recentjobs_total(Gauge)- Labels:
status - Total number of jobs in the last 24 hours
- Labels:
cometserver_device_is_current(Gauge)- Labels:
username,device_id,device_name - Whether each online device is running the current software version (x.x.x)
- Labels:
cometserver_device_is_online(Gauge)- Labels:
username,device_id,device_name - The online/offline status of each registered device
- Labels:
cometserver_lastbackup_download_size_bytes(Gauge)- Labels:
username,protected_item_id,protected_item_name,device_id,device_name - The size (bytes) downloaded during most recent completed backup job for this Protected Item
- Labels:
cometserver_lastbackup_end_time(Gauge)- Labels:
username,protected_item_id,protected_item_name,device_id,device_name - The end time of the most recent completed backup job for this Protected Item
- Labels:
cometserver_lastbackup_file_count(Gauge)- Labels:
username,protected_item_id,protected_item_name,device_id,device_name - The number of files in the most recent completed backup job for this Protected Item
- Labels:
cometserver_lastbackup_file_size_bytes(Gauge)- Labels:
usernameprotected_item_id,protected_item_name,device_id,device_name - The size (bytes) of the data selected for backup on disk, as of the most recent completed backup job for this Protected Item
- Labels:
cometserver_lastbackup_status(Gauge)- Labels:
username,protected_item_id,protected_item_name,device_id,device_name,status - The status of the most recent completed backup job for this Protected Item
- Labels:
cometserver_lastbackup_start_time(Gauge)- Labels:
username,protected_item_id,protected_item_name,device_id,device_name - The start time of the most recent completed backup job for this Protected Item
- Labels:
cometserver_lastbackup_upload_size_bytes(Gauge)- Labels:
username,protected_item_id,protected_item_name,device_id,device_name - The size (bytes) uploaded during most recent completed backup job for this Protected Item
- Labels:
cometserver_storagevault_size_bytes(Gauge)- Labels:
username,vault_id,vault_name,vault_type - The last measured size (in bytes) of each Storage Vault
- Labels:
cometserver_storagevault_quota_bytes(Gauge)- Labels:
username,vault_id,vault_name,vault_type - The quota limit for each Storage Vault, if one is set
- Labels:
cometserver_storagerole_buckets_total(Gauge)- The total number of Storage Role buckets on this Comet Server
cometserver_selfbackup_time_since(Gauge)- Labels:
selfbackup_index - The time since this Server Self-Backup configuration last ran
- Labels:
cometserver_selfbackup_filesize(Gauge)- Labels:
selfbackup_index - The generated file size of the last Server Self-Backup job
- Labels:
cometserver_selfbackup_success(Gauge)- Labels:
selfbackup_index - Whether the most recent Server Self-Backup job was successful (1/0)
- Labels: