diff --git a/cmd/converge/converge.go b/cmd/converge/converge.go index 93d7c89..53b8c55 100644 --- a/cmd/converge/converge.go +++ b/cmd/converge/converge.go @@ -5,6 +5,7 @@ import ( "fmt" "git.wamblee.org/converge/pkg/models" "git.wamblee.org/converge/pkg/server/matchmaker" + "git.wamblee.org/converge/pkg/server/prometheus" "git.wamblee.org/converge/pkg/support/websocketutil" "log" "net" @@ -130,7 +131,7 @@ func main() { websessions := matchmaker.NewWebSessions(notifications.webNotificationChannel) // monitoring prometheusMux := http.NewServeMux() - setupPrometheus(prometheusMux, notifications.prometheusNotificationChannel) + prometheus.SetupPrometheus(prometheusMux, notifications.prometheusNotificationChannel) go func() { log.Fatal(http.ListenAndServe(":8001", prometheusMux)) }() diff --git a/cmd/converge/prometheus.go b/pkg/server/prometheus/prometheus.go similarity index 99% rename from cmd/converge/prometheus.go rename to pkg/server/prometheus/prometheus.go index 53c69af..b4369b3 100644 --- a/cmd/converge/prometheus.go +++ b/pkg/server/prometheus/prometheus.go @@ -1,4 +1,4 @@ -package main +package prometheus import ( "git.wamblee.org/converge/pkg/models" @@ -179,7 +179,7 @@ func clientActive(client *models.Client) { Set(float64(time.Now().Sub(client.StartTime).Seconds())) } -func setupPrometheus(mux *http.ServeMux, notifications chan *models.State) { +func SetupPrometheus(mux *http.ServeMux, notifications chan *models.State) { // go routine that handles incoming events so we don't need to serialize access in some // other way. go func() {