in metrics/go-server/cmd/server.go [77:103]
func main() {
config.SetProviderService(&GreeterProvider{})
if err := config.Load(); err != nil {
panic(err)
}
for {
// metrics refresh per second
time.Sleep(time.Second)
prometheus.IncSummary("test_summary", rand.Float64())
prometheus.IncSummaryWithLabel("test_summary_with_label", rand.Float64(), map[string]string{
"summarylabel1": "value1", // label and value for this summary
"summarylabel2": "value2",
})
prometheus.IncCounter("test_counter")
prometheus.IncCounterWithLabel("test_counter_with_label", map[string]string{
"counterlabel1": "value1", // label and value for this counter
"counterlabel2": "value2",
})
prometheus.SetGauge("test_gauge", rand.Float64())
prometheus.SetGaugeWithLabel("test_gauge_with_label", rand.Float64(), map[string]string{
"gaugelabel1": "value1",
"gaugelabel2": "value2",
})
}
}