Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-perfstat/prometheus

Prometheus exporter for go-perfstat.

The collector exposes all registered go-perfstat statistics as Prometheus metrics with type and name labels.

Register collector

prometheus.MustRegister(perfstat.NewPerfStatMetricsCollector())

With custom constant labels:

prometheus.MustRegister(
	perfstat.NewPerfStatMetricsCollectorWithLabels(prometheus.Labels{
		"application": "my-service",
	}),
)

Default aggregation period is 15s.

Expose /metrics

http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(":9090", nil))

Metrics

The collector exports global and aggregation-period statistics:

perfstat_minTimeMs
perfstat_minTimeSampleMs
perfstat_avgTimeMs
perfstat_avgTimeSampleMs
perfstat_maxTimeMs
perfstat_maxTimeSampleMs
perfstat_totalTimeSec
perfstat_leapsCount
perfstat_leapsCountSample
perfstat_peersCount

Each metric has the following labels:

type
name

Grafana dashboard

A ready-to-import Grafana dashboard is available here:

https://github.com/go-perfstat/prometheus/blob/main/dashboard/PerfStat.json

About

Observability bridge

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages