Created
July 29, 2018 07:50
-
-
Save qbig/16f1a10e9cec0acd1c85c6f19ece4ade to your computer and use it in GitHub Desktop.
A Simple Prometheus Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A minimal example of how to include Prometheus instrumentation. | |
package main | |
import ( | |
"flag" | |
"log" | |
"net/http" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
) | |
var addr = flag.String("listen-address", ":8080", "The address to listen on for HTTP requests.") | |
func main() { | |
flag.Parse() | |
http.Handle("/metrics", promhttp.Handler()) | |
log.Fatal(http.ListenAndServe(*addr, nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment