Python programmable Prometheus exporter
This repo should help any DevOps to quickstart its Prometheus exporter development base on Python. It is a POC which shows how different packages and libraries can be put together to create your own exporter for Prometheus.
The project is based on Flask as web framework and Prometheus python-client. We also provide a simple Dockerfile to enable you to build a Docker container image for your exporter as well as let it run as a simple program.
install and run locally
To install the p3exporter package you simply run the following command inside the project directory:
$ pip install -e .
Obtaining file:///home/nero/Development/p3exporter
...
Installing collected packages: p3exporter
Running setup.py develop for p3exporter
Successfully installed p3exporter
From now you can run it with:
$ p3exporter
INFO:root:Start exporter, listen on 5876
available command line options
Do determine the available command line options you can call the online help:
$ p3exporter --help
usage: p3exporter [-h] [-c CONFIG] [-p PORT]
Python programmable Prometheus exporter.
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
path to configuration file.
-p PORT, --port PORT exporter exposed port
build image and run in docker
To let the exporter run in docker you have to do the following:
$ docker build -t codeaffen/p3exporter .
Sending build context to Docker daemon 181.8kB
...
Successfully built a6bdf60489f5
Successfully tagged codeaffen/p3exporter:latest
Now you can start the container. Don't forget to expose the port to your network.
$ docker run -d -p 5876:5876 --name p3e codeaffen/p3exporter
03e287d50cce595cec6ee66d75a663a094ba7688c761303e7e1e9ad39bde695c
access exporter
If your exporter run either as local program or as docker container you can access it with your webbrowser.
Metadata
Release files for p3exporter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| p3exporter-1.0.0.tar.gz | 5.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| p3exporter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / p3exporter-1.0.0.tar.gz
| Download URL | p3exporter-1.0.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69ba404ba08dd024eb6e5aa521d2fb2bae7dfafe5e525f7db7eb72c1ab28b2ac
|
|
BLAKE2b-256 checksum How to use checksums |
51838e34da805b3489ae88f583d286d4c24042ba26dc7926a921d5ea62d02d12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Release files / p3exporter-1.0.0-py3-none-any.whl
| Download URL | p3exporter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 19.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e019bbf62cf048ae2417310e6e9150de4d770f90b8bb13939dd8966a773b7b8
|
|
BLAKE2b-256 checksum How to use checksums |
fbe637b054070b16c5e93c889d76a2c394c4b5b803df69392656d4796e25a0a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Security for p3exporter 1.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.