metric.go 317 B

1234567891011121314151617181920
  1. package metric
  2. import "github.com/wuntsong-org/go-zero-plus/core/prometheus"
  3. // A VectorOpts is a general configuration.
  4. type VectorOpts struct {
  5. Namespace string
  6. Subsystem string
  7. Name string
  8. Help string
  9. Labels []string
  10. }
  11. func update(fn func()) {
  12. if !prometheus.Enabled() {
  13. return
  14. }
  15. fn()
  16. }