Skip to main content

Echo tqdm progress to a prometheus endpoint

Project description

Prometheus exporter for tqdm

Publish your pretty CLI stats for monitoring elsewhere

Usage

There are no security or authentication mechanisms provided, be careful exposing the host more widely

Initalise the proxy

proxy = TqdmPromProxy(http_host='[::1]', http_port=3000)
proxy.start()

Use the proxy

Replace tqdm initalisers with proxy.tqdm.

for item in proxy.tqdm(range(100), desc='My first bar')
    item.doathing()

with proxy.tqdm(range(100), desc='My second bar') as f:
    f.update(50)

# etc

If you require tqdm.write for sticky console output,

from tqdm import tqdm as tqdm_og
tqdm_og.write('Job done')
curl http://[::1]:3000/metrics

[!WARNING]
For windows users ensure you add this to your __main__ block, and before any initialisation of TqdmPrometheusProxy

from multiprocessing import freeze_support
freeze_support()

Overview

---
Conceptual Overview
---
flowchart LR

    Queue@{ shape: das, label: "Update buffer" }
    TQDM@{ shape: process, label: "(your) faux TQDM instance"}
    Bucketting@{ shape: process, label: "Metric extraction & aggregation"}

    TQDM -- "Periodic Updates" --> Queue
    Queue --> Bucketting
    Bucketting -- "Expose aggregate metrics" --> HttpServer

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

tqdm_prometheus_exporter-0.1.10.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tqdm_prometheus_exporter-0.1.10-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file tqdm_prometheus_exporter-0.1.10.tar.gz.

File metadata

File hashes

Hashes for tqdm_prometheus_exporter-0.1.10.tar.gz
Algorithm Hash digest
SHA256 c0c631417a6c1bad241dd32496307761de487cb1bffcce7b855efe6d8c240f1b
MD5 405e7dc8d520dad7b0dc1e306d26ede0
BLAKE2b-256 fd9c240cb2a3b12b35ab947f4778736e39aa55e0cf628b3a3168eb40f79d7b30

See more details on using hashes here.

Provenance

The following attestation bundles were made for tqdm_prometheus_exporter-0.1.10.tar.gz:

Publisher: python-publish.yml on arrowed/tqdm-prometheus-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tqdm_prometheus_exporter-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for tqdm_prometheus_exporter-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e663c8c36c228ac7c924cace84b9f64f0ff1f5993e1aa82508bb652707fb4e67
MD5 7500f0e28454bc1a995e78e85d972096
BLAKE2b-256 f8780c636542cfe6e8d13bccb598896cf055f5ce7de6dbee10fe7533ffda6240

See more details on using hashes here.

Provenance

The following attestation bundles were made for tqdm_prometheus_exporter-0.1.10-py3-none-any.whl:

Publisher: python-publish.yml on arrowed/tqdm-prometheus-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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