Commit 095295d4 authored by Kevin Lyda's avatar Kevin Lyda 💬

A sample prometheus config.

parent 4681baba
Pipeline #1228 passed with stage
in 1 minute and 5 seconds
......@@ -105,21 +105,21 @@ func gatherMetrics() {
log.Printf("gc.GetCPM error: %s\n", err)
errCt++
} else {
metrics.CPM.WithLabelValues(gc.Version()).Observe(float64(cpm))
metrics.CPM.WithLabelValues(gc.Serial()).Observe(float64(cpm))
}
if cps, err = gc.GetCPS(); err != nil {
log.Printf("gc.GetCPS error: %s\n", err)
errCt++
} else {
metrics.CPS.WithLabelValues(gc.Version()).Observe(float64(cps))
metrics.CPS.WithLabelValues(gc.Serial()).Observe(float64(cps))
}
if volts, err = gc.Volts(); err != nil {
log.Printf("gc.Volts error: %s\n", err)
errCt++
} else {
metrics.Volts.WithLabelValues(gc.Version()).Observe(float64(volts))
metrics.Volts.WithLabelValues(gc.Serial()).Observe(float64(volts))
}
metrics.Errors.WithLabelValues(gc.Version()).Observe(errCt)
metrics.Errors.WithLabelValues(gc.Serial()).Observe(errCt)
time.Sleep(5 * time.Second)
}
}
......
global:
scrape_interval: 10s
external_labels:
monitor: 'gqgmc-monitor'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'gqgmc'
static_configs:
- targets: ['brooklyn:8080']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment