2012-05-24 22:02:44 +04:00
|
|
|
/*
|
|
|
|
Copyright (c) 2012, Matt T. Proud
|
|
|
|
All rights reserved.
|
2012-05-21 12:43:21 +04:00
|
|
|
|
2012-05-24 22:02:44 +04:00
|
|
|
Use of this source code is governed by a BSD-style
|
|
|
|
license that can be found in the LICENSE file.
|
|
|
|
*/
|
2012-05-21 12:43:21 +04:00
|
|
|
|
2012-05-24 22:02:44 +04:00
|
|
|
/*
|
|
|
|
main.go provides a simple skeletal example of how this instrumentation
|
|
|
|
framework is registered and invoked.
|
|
|
|
*/
|
2012-05-21 12:43:21 +04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2013-01-12 01:52:36 +04:00
|
|
|
"flag"
|
2013-01-25 20:50:41 +04:00
|
|
|
"github.com/prometheus/client_golang"
|
2012-05-21 12:43:21 +04:00
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2013-01-12 01:52:36 +04:00
|
|
|
var (
|
|
|
|
listeningAddress string
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
flag.StringVar(&listeningAddress, "listeningAddress", ":8080", "The address to listen to requests on.")
|
|
|
|
}
|
|
|
|
|
2012-05-21 12:43:21 +04:00
|
|
|
func main() {
|
2013-01-12 01:52:36 +04:00
|
|
|
flag.Parse()
|
|
|
|
|
2012-05-21 12:43:21 +04:00
|
|
|
exporter := registry.DefaultRegistry.YieldExporter()
|
|
|
|
|
|
|
|
http.Handle("/metrics.json", exporter)
|
2013-01-12 01:52:36 +04:00
|
|
|
http.ListenAndServe(listeningAddress, nil)
|
2012-05-21 12:43:21 +04:00
|
|
|
}
|