Skip to content

Commit

Permalink
fix(collector): fix the problem that prometheus cannot display the in…
Browse files Browse the repository at this point in the history
…dicators collected by collector (#1851)
  • Loading branch information
limowang authored Jan 15, 2024
1 parent f5efcab commit adb9d14
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions collector/webui/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit adb9d14

Please sign in to comment.