stop exporting go level metrics #956
Answered
by
beorn7
Khushbukela
asked this question in
Q&A
-
How to not export go-level metrics? |
Beta Was this translation helpful? Give feedback.
Answered by
beorn7
Jan 5, 2022
Replies: 1 comment
-
You have to use your own registry rather than the default one. Create it with https://pkg.go.dev/github.com/prometheus/[email protected]/prometheus#NewRegistry and then only register the collectors you really want (i.e. do not register https://pkg.go.dev/github.com/prometheus/[email protected]/prometheus/collectors#NewGoCollector ). |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kakkoyun
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to use your own registry rather than the default one.
Create it with https://pkg.go.dev/github.com/prometheus/[email protected]/prometheus#NewRegistry and then only register the collectors you really want (i.e. do not register https://pkg.go.dev/github.com/prometheus/[email protected]/prometheus/collectors#NewGoCollector ).