2023-03-15 10:23:48 +01:00
|
|
|
# Prometheus Immich exporter
|
2020-09-29 11:10:15 +02:00
|
|
|
|
2023-03-15 10:23:48 +01:00
|
|
|
A prometheus exporter for Immich. Get metrics from a server and offers them in a prometheus format.
|
2020-09-29 11:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
## How to use it
|
|
|
|
|
2023-07-20 18:15:05 +02:00
|
|
|
Here is an example docker run command
|
2020-09-29 11:10:15 +02:00
|
|
|
|
|
|
|
```
|
2023-07-20 18:15:05 +02:00
|
|
|
docker run -e IMMICH_PORT=8080 -e IMMICH_HOST=192.168.178.1 -e IMMICH_API_TOKEN=TOKEN -p 8000:8000 friendlyfriend/prometheus-immich-exporter
|
2020-09-29 11:10:15 +02:00
|
|
|
```
|
2021-07-01 20:05:50 +02:00
|
|
|
Add this to your prometheus.yml
|
|
|
|
```
|
2023-07-20 18:15:05 +02:00
|
|
|
- job_name: "Immich_exporter"
|
2021-07-01 20:05:50 +02:00
|
|
|
static_configs:
|
2023-03-15 10:23:48 +01:00
|
|
|
- targets: ['yourimmichexporter:port']
|
2021-07-01 20:05:50 +02:00
|
|
|
```
|
2020-09-29 11:10:15 +02:00
|
|
|
The application reads configuration using environment variables:
|
|
|
|
|
2023-03-15 10:23:48 +01:00
|
|
|
| Environment variable | Default | Description |
|
|
|
|
|----------------------|----------|----------------------------------------------------|
|
2023-07-20 18:15:05 +02:00
|
|
|
| `IMMICH_HOST` | | Immich proxy url |
|
|
|
|
| `IMMICH_PORT` | `8080` | Immich proxy port |
|
|
|
|
| `IMMICH_API_TOKEN` | | Immich API token, created from Immich dashboard |
|
2023-03-15 10:23:48 +01:00
|
|
|
| `EXPORTER_PORT` | `8000` | Exporter listening port |
|
|
|
|
| `EXPORTER_LOG_LEVEL` | `INFO` | Log level. One of: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` |
|
|
|
|
| `METRICS_PREFIX` | `immich` | Prefix to add to all the metrics |
|
2020-09-29 11:10:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
## Metrics
|
|
|
|
|
2023-03-15 10:23:48 +01:00
|
|
|
These are the metrics this program exports, assuming the `METRICS_PREFIX` is `immich`:
|
|
|
|
|
|
|
|
|
|
|
|
| `metric name` | `description` |
|
|
|
|
|------------------------------------------|---------------------------------------------------------------------------|
|
|
|
|
| `immich_server_info_version_number` | `pings server and passes version number with the use of labels={version}` |
|
|
|
|
| `immich_server_info_diskAvailable` | `available space on disk` |
|
|
|
|
| `immich_server_info_totalDiskSize` | `total disk size` |
|
|
|
|
| `immich_server_info_diskUse` | `disk space used by your system` |
|
|
|
|
| `immich_server_info_diskUsagePercentage` | `same as above but in percentage` |
|
|
|
|
|
|
|
|
| `metric name` | `description` |
|
|
|
|
|---------------------------------------|---------------------------------------------|
|
|
|
|
| `immich_server_stats_user_count` | `number of users signed up ` |
|
|
|
|
| `immich_server_stats_photos_by_users` | `array of users and their amount of photos` |
|
|
|
|
| `immich_server_stats_photos_growth` | `sum of photos of all users` |
|
|
|
|
| `immich_server_stats_videos_by_users` | `array of users and their amount of videos` |
|
|
|
|
| `immich_server_stats_videos_growth` | `sum of all videos of all users` |
|
|
|
|
| `immich_server_stats_usage_by_users` | `the disk space each user uses` |
|
|
|
|
| `immich_server_stats_usage_growth` | `sum of disk space taken up by all users` |
|
|
|
|
|
2020-09-29 11:10:15 +02:00
|
|
|
|
2020-10-26 18:02:40 +01:00
|
|
|
## Screenshot
|
|
|
|
|
|
|
|
![](./grafana/screenshot.png)
|
|
|
|
|
|
|
|
[More info](./grafana/README.md)
|
|
|
|
|
2020-09-29 11:10:15 +02:00
|
|
|
## License
|
|
|
|
|
|
|
|
This software is released under the [GPLv3 license](LICENSE).
|