Skip to main content

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.

Metadata

Release files for tc-prometheus 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tc-prometheus 4.0.0
File Size Uploaded Provenance Actions
tc_prometheus-4.0.0.tar.gz 5.6 kB Without provenance Details for tc_prometheus-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tc-prometheus 4.0.0
File Interpreter ABI Platform Actions
tc_prometheus-4.0.0-py3-none-any.whl Python 3 none any Details for tc_prometheus-4.0.0-py3-none-any.whl

Total release size: 11.0 kB

Release files / tc_prometheus-4.0.0.tar.gz

Download URL tc_prometheus-4.0.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
89ad1142805e691f96af4482be687cdd86a8b450ad474ecd0ac0d2bc18f2d413
BLAKE2b-256 checksum
How to use checksums
2aba77c7ac0c01a65659f9f1fe6b8beb04eed677bcdfd966cbbc4595b79d4520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / tc_prometheus-4.0.0-py3-none-any.whl

Download URL tc_prometheus-4.0.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d68ca0f3831128f5765da6d4b4f37d69d7c92be4ac5b32fc8d7f8566552caf87
BLAKE2b-256 checksum
How to use checksums
267a11bc34855feb882497d69b760c36d558b7ca9f2464492ed5fe60a0d44c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for tc-prometheus 4.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page