go-zero/core/metric/metric.go

21 lines
309 B
Go
Raw Normal View History

2020-07-26 17:09:05 +08:00
package metric
import "github.com/zeromicro/go-zero/core/prometheus"
// A VectorOpts is a general configuration.
2020-07-26 17:09:05 +08:00
type VectorOpts struct {
Namespace string
Subsystem string
Name string
Help string
Labels []string
}
func update(fn func()) {
if !prometheus.Enabled() {
return
}
fn()
}