promethues

This commit is contained in:
wangchuxiao
2022-09-14 17:45:38 +08:00
parent 72d0920458
commit d534f026b0
10 changed files with 73 additions and 11 deletions
+7
View File
@@ -6,6 +6,7 @@ import (
"strconv"
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
@@ -24,3 +25,9 @@ func PrometheusHandler() gin.HandlerFunc {
h.ServeHTTP(c.Writer, c.Request)
}
}
func PromeInc(counter prometheus.Counter) {
if config.Config.Prometheus.Enable {
counter.Inc()
}
}