Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grafana/mixin-metrics
Extract prometheus metrics from dashboard JSON and rules YAML
https://github.com/grafana/mixin-metrics
Last synced: about 1 month ago
JSON representation
Extract prometheus metrics from dashboard JSON and rules YAML
- Host: GitHub
- URL: https://github.com/grafana/mixin-metrics
- Owner: grafana
- License: apache-2.0
- Archived: true
- Created: 2021-04-23T21:51:53.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T23:20:40.000Z (about 3 years ago)
- Last Synced: 2024-09-24T09:32:55.304Z (about 1 month ago)
- Language: Go
- Size: 101 KB
- Stars: 5
- Watchers: 132
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
⚠️ **This project has been deprecated. Please see [cortextool analyse](https://github.com/grafana/cortex-tools#analyse) which provides the same features** ⚠️
# mixin-metrics
![License](https://img.shields.io/github/license/hjet/mixin-metrics?color=blue)Extract prometheus metrics from dashboard JSON and rules YAML.
## Prerequisites
- Go 1.16## Compile
```
go build mixin-metrics.go
```## Use
Parse rules configs in `DIR`
```
mixin-metrics --dir=DIR --out="metrics_out.json" rules
```
Replace `DIR` with directory containing Prometheus rules YAML files. By default will save parsed metrics in `metrics_out.json`.Parse dashboard JSON files in `DIR`
```
mixin-metrics --dir=DIR dash
```
Similar to above. Parses Grafana dashboard JSON files.Join and print parsed metrics in Prom relabel-config format
```
mixin-metrics --dir=DIR --print dash
```
Use this output with `relabel_config` to `drop` or `keep` needed metrics. See [Reducing Prometheus metrics usage with relabeling](https://grafana.com/docs/grafana-cloud/billing-and-usage/prometheus/usage-reduction/#reducing-prometheus-metrics-usage-with-relabeling) to learn more.## TODO
- [ ] fail fast if parsing rules/dash with wrong flag
- [ ] better docs
- [ ] dashboard structs (no jq)
- [ ] tests
- [ ] binaries