25 lines
401 B
Go
25 lines
401 B
Go
package metrics
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
"net/http"
|
|
)
|
|
|
|
type Prometheus struct {
|
|
}
|
|
|
|
func NewPrometheus() *Prometheus {
|
|
return &Prometheus{}
|
|
}
|
|
|
|
func (receiver *Prometheus) Metrics(w http.ResponseWriter, r *http.Request) {
|
|
receiver.updateMetrics()
|
|
handler := promhttp.Handler()
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
func (receiver *Prometheus) updateMetrics() {
|
|
|
|
}
|