This is an automated email from the ASF dual-hosted git repository.
wangdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new adb9d145a fix(collector): fix the problem that prometheus cannot
display the indicators collected by collector (#1851)
adb9d145a is described below
commit adb9d145ac33661d365ea7100db38d9cb07887ca
Author: Wang Guangshuo <[email protected]>
AuthorDate: Mon Jan 15 16:07:44 2024 +0800
fix(collector): fix the problem that prometheus cannot display the
indicators collected by collector (#1851)
---
collector/webui/webserver.go | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/collector/webui/webserver.go b/collector/webui/webserver.go
index 8c13dda9c..8783f0cac 100644
--- a/collector/webui/webserver.go
+++ b/collector/webui/webserver.go
@@ -21,12 +21,22 @@ import (
"context"
"time"
+ "github.com/apache/incubator-pegasus/collector/metrics"
"github.com/kataras/iris/v12"
+ "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
// StartWebServer starts an iris-powered HTTP server.
func StartWebServer() {
+ registry := prometheus.NewRegistry()
+ for _, cV := range metrics.CounterMetricsMap {
+ registry.MustRegister(cV)
+ }
+ for _, gV := range metrics.GaugeMetricsMap {
+ registry.MustRegister(gV)
+ }
+
app := iris.New()
app.Get("/", indexHandler)
app.Get("/tables", tablesHandler)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]