Skip to content

Commit

Permalink
metrics: Add go_* metrics and go_build_info metrics
Browse files Browse the repository at this point in the history
Prometheus provides metrics collectors that expose go runtime and go build
information, which can be useful to server administrators, lets expose
them.

Signed-off-by: Chance Zibolski <chance.zibolski@gmail.com>
  • Loading branch information
chancez authored and ldelossa committed Mar 17, 2022
1 parent 2f08d4d commit 6c5e2d6
Show file tree
Hide file tree
Showing 9 changed files with 377 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"net/http"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
dto "github.com/prometheus/client_model/go"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -1414,9 +1415,8 @@ func NewBPFMapPressureGauge(mapname string, threshold float64) *GaugeWithThresho
}

func init() {
MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{Namespace: Namespace}))
// TODO: Figure out how to put this into a Namespace
// MustRegister(prometheus.NewGoCollector())
MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{Namespace: Namespace}))
MustRegister(collectors.NewGoCollector())
MustRegister(newStatusCollector())
MustRegister(newbpfCollector())
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c5e2d6

Please sign in to comment.