Skip to main content

Prometheus Tornado Instrumentator

A Tornado-focused Prometheus instrumentation library inspired by trallnag/prometheus-fastapi-instrumentator.

The goal is to provide a Tornado-native user experience:

from prometheus_tornado_instrumentator import Instrumentator

Instrumentator().instrument(app).expose(app)

Installation

From PyPI:

pip install prometheus-tornado-instrumentator

From a local checkout:

uv pip install -e .

Quick Start

from tornado.web import Application, RequestHandler

from prometheus_tornado_instrumentator import Instrumentator


class HelloHandler(RequestHandler):
    def get(self):
        self.write({"message": "hello"})


app = Application([(r"/hello", HelloHandler)])
Instrumentator().instrument(app).expose(app)

This instruments registered Tornado handlers and exposes Prometheus scrape output at /metrics by default.

Features

  • Default Prometheus metrics for request count, request size, response size, and latency.
  • Custom sync or async instrumentation functions.
  • Custom metric namespace and subsystem.
  • Custom Prometheus CollectorRegistry.
  • Gzip support for metrics output.
  • Regex-based handler exclusions.
  • Dynamic route instrumentation for handlers added with Application.add_handlers().
  • Prometheus client multiprocess support through PROMETHEUS_MULTIPROC_DIR.

Scope

This package instruments Tornado HTTP RequestHandler routes.

It does not provide FastAPI, Starlette, ASGI mounted-app, included-router, or websocket route semantics. See docs/parity.md for the upstream semantic-parity notes.

Documentation

Development

Use uv for local development:

uv sync --extra dev
uv run --extra dev python -m pytest -q

License

This project is licensed under the ISC License. See LICENSE.

This project is inspired by trallnag/prometheus-fastapi-instrumentator, which is also licensed under the ISC License. See NOTICE for the initial upstream baseline.

Release files for prometheus-tornado-instrumentator 0.1.2

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

Source distribution (sdist)

Source distribution for prometheus-tornado-instrumentator 0.1.2
File Size Uploaded
prometheus_tornado_instrumentator-0.1.2.tar.gz 38.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prometheus-tornado-instrumentator 0.1.2
File Interpreter ABI Platform
prometheus_tornado_instrumentator-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 49.6 kB

Release files / prometheus_tornado_instrumentator-0.1.2.tar.gz

Download URL prometheus_tornado_instrumentator-0.1.2.tar.gz
Size 38.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35b55ed14a0794985beae1545bd9d8be128ccb13b624d568f71dd5d0c3dffaa8
BLAKE2b-256 checksum
How to use checksums
4eae8f5bb33ca68d847319efa51ed45871f8723e30c358acf1bc4b9b374e4c58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / prometheus_tornado_instrumentator-0.1.2-py3-none-any.whl

Download URL prometheus_tornado_instrumentator-0.1.2-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a67eca82e5d70a5eb61b1697b1537b8dd7128b2f84aa5e6b48c09867c0f66db
BLAKE2b-256 checksum
How to use checksums
adce335be3869d7feebe138fda910cbd10152856475af8dacce40ea1d3b74346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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