我正在使用 NewGaugeVec 来报告我的指标:


elapsed := prometheus.NewGaugeVec(prometheus.GaugeOpts{

    Name: "gogrinder_elapsed_ms",

    Help: "Current time elapsed of gogrinder teststep",

}, []string{"teststep", "user", "iteration", "timestamp"})

prometheus.MustRegister(elapsed)

一切正常,但我注意到我的自定义导出器包含来自 prometheus/go_collector.go 的所有指标:


# HELP go_gc_duration_seconds A summary of the GC invocation durations.

# TYPE go_gc_duration_seconds summary

go_gc_duration_seconds{quantile="0"} 0.00041795300000000004

go_gc_duration_seconds{quantile="0.25"} 0.00041795300000000004

go_gc_duration_seconds{quantile="0.5"} 0.00041795300000000004

...

我怀疑这是一种默认行为,但我没有在文档中找到有关如何禁用它的任何内容。关于如何配置我的自定义导出器以便这些默认指标消失的任何想法?