This seems to be implemented based on the `runtime.metrics` package, but I 
don't see any metrics related to gomaxprocs in 
https://golang.bg/src/runtime/metrics/description.go

在2022年9月13日星期二 UTC+8 17:38:16<sup...@gmail.com> 写道:

> This is available in the new Go runtime metrics, you can enable it in your 
> application with a runtime metrics filter.
>
>
> https://github.com/prometheus/client_golang/blob/9801a4e3ceb49d24dfaf4fa6fc8c2d58aa3b2dc9/prometheus/collectors/go_collector_latest_test.go#L284
>
> You'll probably want `/sched/gomaxprocs:threads` as your custom rule.
>
> On Tue, Sep 13, 2022 at 11:31 AM 'damianqin' via Prometheus Developers <
> prometheus...@googlegroups.com> wrote:
>
>> Hello folks!
>>     When we maintain the golang service on k8s, we will automatically set 
>> the GOMAXPROCS environment variable equal to the Pod limit in the cd 
>> process to reduce the occurrence of cpu throttling, but other developers 
>> may use runtime.GOMAXPROCS <https://pkg.go.dev/runtime#GOMAXPROCS> to 
>> override the parameters, resulting in application performance down. I think 
>> client_golang can use the runtime.GOMAXPROCS(0) method to expose the 
>> current indicator value.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Prometheus Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to prometheus-devel...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-developers/1db181d7-950a-4437-b69c-aa5cc329ae9fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-developers/1db181d7-950a-4437-b69c-aa5cc329ae9fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/d0078f6b-f8e8-4e78-8123-fcd76d2df1f2n%40googlegroups.com.

Reply via email to