metrics/metrics_example_test.go
Vasiliy Tolstov 6aa41f4081 change import path
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-11-09 19:32:47 +03:00

15 lines
309 B
Go

package metrics_test
import (
"net/http"
"go.unistack.org/metrics"
)
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)
})
}