Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.
/ mixin-metrics Public archive

Extract prometheus metrics from dashboard JSON and rules YAML

License

Notifications You must be signed in to change notification settings

grafana/mixin-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

⚠️ This project has been deprecated. Please see cortextool analyse which provides the same features ⚠️

mixin-metrics

License

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 to learn more.

TODO

  • fail fast if parsing rules/dash with wrong flag
  • better docs
  • dashboard structs (no jq)
  • tests
  • binaries

About

Extract prometheus metrics from dashboard JSON and rules YAML

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages