mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 17:20:24 +08:00
21 lines
309 B
Go
21 lines
309 B
Go
package metric
|
|
|
|
import "github.com/zeromicro/go-zero/core/prometheus"
|
|
|
|
// A VectorOpts is a general configuration.
|
|
type VectorOpts struct {
|
|
Namespace string
|
|
Subsystem string
|
|
Name string
|
|
Help string
|
|
Labels []string
|
|
}
|
|
|
|
func update(fn func()) {
|
|
if !prometheus.Enabled() {
|
|
return
|
|
}
|
|
|
|
fn()
|
|
}
|