Simple tool to summarize & show prometheus metrics via JSON api
Magnify is a simple tool to provide a JSON API based metrics resolution on top of Prometheus it heavily relies on Expr for metrics transformation.
Usage of magnify:
-c string
yaml file config path (default "config.yaml")
docker run -v ./config.yaml:/config.yaml -d w1n2k/magnify:1.0.0
Please look at Expr documentation for expressions.
prometheus:
addr: "http://localhost:4000"
expressions:
- name: goroutines
query: sum(rate(go_gc_duration_seconds{app_kubernetes_io_name="game-server"}[5m])) by (service)
expr: "float(query_result[0].Value.String()) >= 0.0 ? 'operational': 'error'"
http:
addr: ":9999"
Method: GET
Path: /
Response:
{"goroutines": "operational"}
Method: GET
Path: /key/{name}
Response:
"operational"
Method: GET
Path: /health/live and /health/ready