diff --git a/ginmetrics/types.go b/ginmetrics/types.go index 8a4c5f8..e9846fc 100644 --- a/ginmetrics/types.go +++ b/ginmetrics/types.go @@ -111,6 +111,7 @@ func (m *Monitor) AddMetric(metric *Metric) error { if err := f(metric); err == nil { prometheus.MustRegister(metric.vec) m.metrics[metric.Name] = metric + return nil } } return errors.Errorf("metric type '%d' not existed.", metric.Type)