Skip to main content

pytest-prometheus-pushgateway

Pytest report plugin for Prometheus PushGateway

Allow to send reports test results to a Prometheus PushGateway.

installation

pip install pytest-prometheus-pushgateway

Configure via env var

PROMETHEUS_PUSHGATEWAY_URL=""
PROMETHEUS_PUSHGATEWAY_JOB=""

Basic Auth:

PROMETHEUS_PUSHGATEWAY_BASIC_AUTH="true"
PROMETHEUS_PUSHGATEWAY_USERNAME=""
PROMETHEUS_PUSHGATEWAY_PASSWORD=""

Optional:

PROMETHEUS_PUSHGATEWAY_METRIC_PREFIX=""
PROMETHEUS_PUSHGATEWAY_EXTRA_LABEL="{'test':'value','test1':'value1'}"

Add labels via hook

def pytest_metrics_add_labels(session: Session, exitstatus: Union[int, ExitCode]) -> str:
    return {"html_report": report_url}

Add option to send metrics

pytest --metrics

Dev

Change version

edit

pytest_prometheus_pushgateway/__init__.py

commit

git commit -m "v0.1.0"

tag

git tag v0.1.0

Build package

python setup.py sdist bdist_wheel
pip install twine
twine upload dist/*

Test

Create endpoint on requestbin and add the url to PROMETHEUS_PUSHGATEWAY_URL to set_env fixture into conftest.py

Use the runner in Pycharm.

pytest test_pytest_prometheus.py::TestPrometheus

Metadata

Release files for pytest-prometheus-pushgateway 0.3.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 pytest-prometheus-pushgateway 0.3.2
File Size Uploaded
pytest-prometheus-pushgateway-0.3.2.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-prometheus-pushgateway 0.3.2
File Interpreter ABI Platform
pytest_prometheus_pushgateway-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 30.2 kB

Release files / pytest-prometheus-pushgateway-0.3.2.tar.gz

Download URL pytest-prometheus-pushgateway-0.3.2.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a75761f6502518803f14efdae2a3d3eccb6007265701d66a3c6afc05b6e3612d
BLAKE2b-256 checksum
How to use checksums
a24e8013c2b232f1c88eda2e0350dd4b0d7a4576075a416c862c41c2436cb1a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Release files / pytest_prometheus_pushgateway-0.3.2-py3-none-any.whl

Download URL pytest_prometheus_pushgateway-0.3.2-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cd2b0c660a073975b44217af2c5b172b8a60cb6f45159c1929c446b5c1912b6
BLAKE2b-256 checksum
How to use checksums
35ebad9e155aada56042a0d3b62049a002f28f2d87e479a11381fbe58e415ad0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

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