Skip to main content
# Flake8 prometheus metric name plugin

Flake8 plugin to check metrics name prefix for official client https://github.com/prometheus/client_python.

## Installation
```bash
pip install flake8-prometheus-metrics-name
```

## Usage
Imagine we have python module `some_module.py`:
```python
from prometheus_client import Counter

Counter(name='kek_values', documentation='some doc')
Counter(name='some_name1', documentation='some doc')
Counter(name='some_name2', documentation='some doc') # noqa: PRM902
Counter(name='some_name3', documentation='some doc')
Counter(name='lol_values', documentation='some doc')
```

Add valid metrics name prefixes to `setup.cfg`:
```buildoutcfg
[flake8]
prometheus-metrics-name-prefixes =
kek_
lol_
```

Run flake8 `flake8 some_modue.py` cause following warnings:
```bash
some_module.py:4:1: PRM902: Metric name should start with one of following prefixes: "kek_", "lol_", got "some_name1" instead
some_module.py:6:1: PRM902: Metric name should start with one of following prefixes: "kek_", "lol_", got "some_name3" instead
```

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-prometheus-metrics-name-0.1.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file flake8-prometheus-metrics-name-0.1.2.tar.gz.

File metadata

File hashes

Hashes for flake8-prometheus-metrics-name-0.1.2.tar.gz
Algorithm Hash digest
SHA256 afa697cd9d47a41aa9ca4f89599127e9c03a0c1cfca5b7879242882becf44fc4
MD5 b44776146325ed26a9511cd2c2a7ae7e
BLAKE2b-256 79434f12674a033e5e74e9d7214ae3f5315721ef642f8a7301b38b83c5301454

See more details on using hashes here.

File details

Details for the file flake8_prometheus_metrics_name-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_prometheus_metrics_name-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e4da9349a837f3f0f99c70986c2d7a04fd062afbc0c746ed89ed5817de45d25d
MD5 f735e7a8bbd90bc4b150fc6479fdeac0
BLAKE2b-256 c09749e54150dd5b0c2f6ee08223e5f09d676cd4061b540a7a8bcc6ee0067e5e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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