Go语言Prometheus Operator自定义监控1. Operator实现package operator import ( github.com/prometheus/client_golang/prometheus ) var ( CustomMetric promauto.NewGauge(prometheus.GaugeOpts{ Name: custom_metric, Help: A custom metric, }) ) func RecordCustomMetric(value float64) { CustomMetric.Set(value) }2. 总结Prometheus Operator简化了K8s环境下的监控配置Go应用可以方便地集成自定义指标。