(mirror) A lightweight monitoring solution for kiwi-scp
Find a file
Jörn-Michael Miehe afad43e792 Merge tag '0.1.5' into develop
updated project scaffold, updated dependencies
2023-12-30 17:28:17 +00:00
.devcontainer apply new devcontainer scaffold https://code.yavook.de/Yavook.de/vscode-python3 2023-12-30 17:21:42 +00:00
.vscode apply new devcontainer scaffold https://code.yavook.de/Yavook.de/vscode-python3 2023-12-30 17:21:42 +00:00
example preparation for release 0.1.0 2023-09-02 15:02:17 +00:00
kiwi_simple_metrics "black" code style 2023-12-30 17:23:55 +00:00
.drone.yml drone config 2023-09-02 16:33:46 +00:00
.flake8 apply new devcontainer scaffold https://code.yavook.de/Yavook.de/vscode-python3 2023-12-30 17:21:42 +00:00
.gitignore Initial commit 2023-08-30 20:55:48 +00:00
Dockerfile optimize Dockerfile 2023-09-02 19:20:19 +00:00
LICENSE Initial commit 2023-08-30 20:55:48 +00:00
poetry.lock "poetry up --latest" 2023-12-30 17:22:21 +00:00
pyproject.toml version bump 2023-12-30 17:27:31 +00:00
README.md relative links in README 2023-09-02 16:51:41 +00:00

kiwi-simple-metrics

Build Status

kiwi - simple, consistent, powerful

A lightweight monitoring solution for kiwi-scp, created with uptime-kuma in mind. Also on Docker Hub.

Quick start

The minimal config to add to one of your docker-compose.yml is this:

metrics:
  image: yavook/kiwi-simple-metrics:0.1
  • admittedly not useful, but it does run monitoring
  • every 600 seconds (10 minutes), metrics are evaluated
  • measures cpu, memory and swap, and disk usage at "/"
  • does not log to stdout
  • does not trigger any webhooks

Every aspect of kiwi-simple-metrics can be tweaked by environment variables, so this is a more reasonable configuration example:

metrics:
  image: yavook/kiwi-simple-metrics:0.1
  environment:
    METRICS__LOG__ENABLED: "True"
    METRICS__WEBHOOK__URL: "https://my.webhook.host/success?report={result}"
    METRICS__WEBHOOK__FAIL: "https://my.webhook.host/failure?report={result}"
  • same metrics as above
  • logs reports to stdout
  • triggers webhooks ({result} is the placeholder for the result string)

Configuration

These are the environment variables you most likely need:

  • METRICS__INTERVAL: Time in seconds between metrics evaluation (default: 600, i.e. 10 minutes)
  • METRICS__LOG__ENABLED: If truthy, logs reports to stdout (default: False)
  • METRICS__[M]__ENABLED, METRICS__[M]__THRESHOLD (with [M] from CPU, MEMORY, DISK): Enable or disable each metric, and set its failure threshold
  • METRICS__MEMORY__SWAP: How swap space is handled in the "memory" report (default: include)
  • METRICS__DISK__PATHS: At which paths the disk usage is measured (default: ["/"])
  • METRICS__EXTERNAL__ENABLED, METRICS__EXTERNAL__EXECUTABLES: Setup for external values, as further defined in metrics/external.py (default: False, [])
  • METRICS__WEBHOOK__URL, METRICS__WEBHOOK__FAIL: Which webhooks to push the reports to (default: None, None)

All settings can be found in the SETTINGS variable defined by module kiwi_simple_metrics.settings in settings/__init__.py. For default values, refer to the respective python files.

Example: The above METRICS__LOG__ENABLED refers to SETTINGS.log.enabled, defined by model LogSettings in settings/misc.py.