Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why does not export NumGC metric? #1380

Open
zhangbo1882 opened this issue Nov 13, 2023 · 3 comments
Open

why does not export NumGC metric? #1380

zhangbo1882 opened this issue Nov 13, 2023 · 3 comments
Labels

Comments

@zhangbo1882
Copy link

zhangbo1882 commented Nov 13, 2023

I note that NumGC is not exported as a metric? Is there any special reason?

@ArthurSens
Copy link
Member

Hey @zhangbo1882 , could you elaborate on what is this NumGC metric? Is it related to go standard metrics? Where could I read more about it? :)

@zhangbo1882
Copy link
Author

zhangbo1882 commented Nov 14, 2023

Currently, prometheus client_golang has added some metrics based on the golang runtime.MemStats.

func NewGoCollector() Collector {
metrics: memStatsMetrics{
}
}

So we have metrics such as go_memstats_next_gc_bytes. NumGC is a field of runtime.MemStats. We can also add a counter metric for NumGC. But now it seems that there is no.

@kakkoyun
Copy link
Member

Currently, prometheus client_golang has added some metrics based on the golang runtime.MemStats.

func NewGoCollector() Collector {
metrics: memStatsMetrics{
}
}

So we have metrics such as go_memstats_next_gc_bytes. NumGC is a field of runtime.MemStats. We can also add a counter metric for NumGC. But now it seems that there is no.

We already have those metrics.

https://github.com/prometheus/client_golang/blob/80d3f0b5b36c891016370423516e353b1a5f0a55/prometheus/collectors/go_collector_go121_test.go#L33-L35C40

Maybe you're misconfiguring your collector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants