Skip to main content

Thumbor Prometheus metrics extension

Project description

Thumbor Prometheus Metrics Plugin Build Status

Collecting Thumbor runtime metrics using the prometheus_client and exposes them via an HTTP endpoint on a configurable port.

Installation

# latest stable
pip install tc_prometheus

# master branch
pip install -e git+https://github.com/thumbor-community/prometheus.git@master#egg=tc_prometheus

Configuration

# thumbor.conf
METRICS = 'tc_prometheus.metrics.prometheus_metrics'

# optional with defaults
PROMETHEUS_SCRAPE_PORT = 8000 # Port the prometheus client should listen on

Multiprocess support

In 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.conf

Upgrade notes

from 3.x to 4.x

The 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.

from 2.x to 3.x

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.

from 1.x to 2.x

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tc_prometheus-4.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

tc_prometheus-4.0.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file tc_prometheus-4.0.0.tar.gz.

File metadata

  • Download URL: tc_prometheus-4.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tc_prometheus-4.0.0.tar.gz
Algorithm Hash digest
SHA256 89ad1142805e691f96af4482be687cdd86a8b450ad474ecd0ac0d2bc18f2d413
MD5 a2d21618ac6526d375e8f229a3e17cd1
BLAKE2b-256 2aba77c7ac0c01a65659f9f1fe6b8beb04eed677bcdfd966cbbc4595b79d4520

See more details on using hashes here.

File details

Details for the file tc_prometheus-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: tc_prometheus-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tc_prometheus-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d68ca0f3831128f5765da6d4b4f37d69d7c92be4ac5b32fc8d7f8566552caf87
MD5 0c9c1362f8ccdaa901426aed908f3c62
BLAKE2b-256 267a11bc34855feb882497d69b760c36d558b7ca9f2464492ed5fe60a0d44c6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page