Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeya24/promlinter
https://github.com/yeya24/promlinter
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yeya24/promlinter
- Owner: yeya24
- License: apache-2.0
- Created: 2020-07-21T02:08:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T19:15:59.000Z (7 months ago)
- Last Synced: 2024-10-14T20:52:12.728Z (28 days ago)
- Language: Go
- Size: 2.13 MB
- Stars: 87
- Watchers: 5
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# promlinter
A linter for checking Prometheus metrics name via promlint.
![usage](assets/promlinter.gif)
## Installation
### Go Get
go get github.com/yeya24/promlinter/cmd/promlinter
### Download from release
Please go to https://github.com/yeya24/promlinter/releases.
### Build from source
#### Requirements
- Go >= 1.13
- make``` bash
git clone https://github.com/yeya24/promlinter.git
make build
```Then you can find the `promlinter` binary file in the `./bin` directory.
## Usage
``` bash
usage: promlinter [] [ ...]Prometheus metrics linter for Go code.
This tool can cover most of the patterns of metrics naming issues, but it cannot detect metric values that can only be determined in the runtime.
By default it doesn't output parsing failures, if you want to see them, you can add --strict flag to enable it.
It is also supported to disable the lint functions using repeated flag --disable. Current supported functions are:
[Help]: Help detects issues related to the help text for a metric.
[MetricUnits]: MetricUnits detects issues with metric unit names.
[Counter]: Counter detects issues specific to counters, as well as patterns that should only be used with counters.
[HistogramSummaryReserved]: HistogramSummaryReserved detects when other types of metrics use names or labels reserved for use by histograms and/or summaries.
[MetricTypeInName]: MetricTypeInName detects when metric types are included in the metric name.
[ReservedChars]: ReservedChars detects colons in metric names.
[CamelCase]: CamelCase detects metric names and label names written in camelCase.
[UnitAbbreviations]: UnitAbbreviations detects abbreviated units in the metric name.
Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
--version Show application version.Commands:
help [...]
Show help.list [] [...]
List metrics name.lint [] [...]
Lint metrics via promlint.```
## Run tests
``` bash
make test
```