mirror of
https://github.com/status-im/status-go.git
synced 2025-01-14 16:56:44 +00:00
89d89681a3
It adds support for metrics (expvar and Prometheus) along with docker-compose files to run a Whisper test cluster.
18 lines
350 B
Go
18 lines
350 B
Go
// +build metrics,prometheus
|
|
|
|
package metrics
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
)
|
|
|
|
// NewMetricsServer starts a new HTTP server with prometheus handler.
|
|
func NewMetricsServer(addr string) *http.Server {
|
|
server := http.Server{Addr: addr}
|
|
http.Handle("/metrics", promhttp.Handler())
|
|
|
|
return &server
|
|
}
|