Collecting Thumbor runtime metrics using the prometheus_client and exposes them via an HTTP endpoint on a configurable port.
# latest stable
pip install tc_prometheus
# master branch
pip install -e git+https://github.com/thumbor-community/prometheus.git@master#egg=tc_prometheus# thumbor.conf
METRICS = 'tc_prometheus.metrics.prometheus_metrics'
# optional with defaults
PROMETHEUS_SCRAPE_PORT = 8000 # Port the prometheus client should listen onIn case thumbor is to be started with multiple processes using the --processes argument, the prometheus
client can handle that by the administrator setting the environment variable PROMETHEUS_MULTIPROC_DIR.
Please read the corresponding documentation to
understand the implications of that.
Basic example:
set -e
export PROMETHEUS_MULTIPROC_DIR=/tmp/thumbor/proc_dir
mkdir -p "$PROMETHEUS_MULTIPROC_DIR"
rm -rf "$PROMETHEUS_MULTIPROC_DIR"/* # this is crucial on the 2nd and following runs, but check the documentation
thumbor --processes `nproc` -c /path/to/thumbor.confThe metric with the name original_image.fetch was renamed to two different ones with the names
original_image.fetch.count and original_image.fetch.latency.
This requires at least thumbor in version 7.7.5
Please make sure to adjust all recording rules, alerting rules and dashboards which are relying on these metrics.
All metrics of type counter have had before an enforced postfix of _incr which is now gone. Therefore
all metrics of type counter are renamed and will not match with previously recorded metrics anymore.
Please make sure to adjust all recording rules, alerting rules and dashboards which are relying on these counters.
The switch from 1.x to 2.x is not requiring any change within thumbors configuration or the plugin itself. The crucial difference is, that some metrics will be renamed, so that you might need to update your monitoring/alarming. Also be aware that you will get a lot more metrics until the old ones cease to exit which can be okay but on big installation it might create issues by itself.