A little tiny Go package that makes dealing with Prometheus metrics a little easier.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1.1 KiB

observe -- Prometheus compatible convenience library for Observability

Build Status CodeCov Go Report Card GoDoc Sourcegraph

A little tiny Go package that makes dealing with Prometheus metrics a little easier.

Install

go get -u git.mills.io/prologic/observe

Usage

metrics = NewMetrics("foo")

ctime := time.Now()

// server uptime counter
metrics.NewCounterFunc(
    "server", "uptime",
    "Number of nanoseconds the server has been running",
    func() float64 {
        return float64(time.Since(ctime).Nanoseconds())
    },
)

License

MIT