diff --git a/collector/beat.go b/collector/beat.go index 3caeb37..8d01a0e 100644 --- a/collector/beat.go +++ b/collector/beat.go @@ -36,6 +36,10 @@ type BeatStats struct { MemoryTotal float64 `json:"memory_total"` RSS float64 `json:"rss"` } `json:"memstats"` + + Runtime struct { + Goroutines uint64 `json:"goroutines"` + } `json:"runtime"` } type beatCollector struct { @@ -145,6 +149,17 @@ func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector { }, valType: prometheus.GaugeValue, }, + { + desc: prometheus.NewDesc( + prometheus.BuildFQName(beatInfo.Beat, "runtime", "goroutines"), + "beat.runtime.goroutines", + nil, nil, + ), + eval: func(stats *Stats) float64 { + return float64(stats.Beat.Runtime.Goroutines) + }, + valType: prometheus.GaugeValue, + }, }, } }