Skip to content

Commit

Permalink
use promhttp.Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
kbudde committed Feb 4, 2019
1 parent 363d96d commit 9ec23ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"bytes"
"github.com/prometheus/client_golang/prometheus/promhttp"
"net/http"
"os"
"strings"
Expand Down Expand Up @@ -29,7 +30,7 @@ func main() {
exporter := newExporter()
prometheus.MustRegister(exporter)

http.Handle("/metrics", prometheus.Handler())
http.Handle("/metrics", promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{}))
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head><title>RabbitMQ Exporter</title></head>
Expand Down

0 comments on commit 9ec23ee

Please sign in to comment.