Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.21 KB

README.md

File metadata and controls

57 lines (45 loc) · 1.21 KB

Magnify 🔎

Simple tool to summarize & show prometheus metrics via JSON api

logo

About

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

Usage of magnify:
  -c string
        yaml file config path (default "config.yaml")

Docker usage

docker run -v ./config.yaml:/config.yaml -d w1n2k/magnify:1.0.0 

Example configuration

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"

Endpoints

Cache

Method: GET
Path: /

Response:

{"goroutines": "operational"}

Key

Method: GET
Path: /key/{name}

Response:

"operational"

Live & Ready endpoints

Method: GET
Path: /health/live and /health/ready