forked from mirror/client_golang
37 lines
695 B
Go
37 lines
695 B
Go
/*
|
|
Copyright (c) 2012, Matt T. Proud
|
|
All rights reserved.
|
|
|
|
Use of this source code is governed by a BSD-style
|
|
license that can be found in the LICENSE file.
|
|
*/
|
|
|
|
/*
|
|
main.go provides a simple skeletal example of how this instrumentation
|
|
framework is registered and invoked.
|
|
*/
|
|
package main
|
|
|
|
import (
|
|
"flag"
|
|
"github.com/matttproud/golang_instrumentation"
|
|
"net/http"
|
|
)
|
|
|
|
var (
|
|
listeningAddress string
|
|
)
|
|
|
|
func init() {
|
|
flag.StringVar(&listeningAddress, "listeningAddress", ":8080", "The address to listen to requests on.")
|
|
}
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
exporter := registry.DefaultRegistry.YieldExporter()
|
|
|
|
http.Handle("/metrics.json", exporter)
|
|
http.ListenAndServe(listeningAddress, nil)
|
|
}
|