2019-04-11 17:26:20 +03:00
|
|
|
package metrics_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2024-11-09 19:32:37 +03:00
|
|
|
"go.unistack.org/metrics"
|
2019-04-11 17:26:20 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func ExampleWritePrometheus() {
|
|
|
|
// Export all the registered metrics in Prometheus format at `/metrics` http path.
|
|
|
|
http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
|
|
|
|
metrics.WritePrometheus(w, true)
|
|
|
|
})
|
|
|
|
}
|