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.
 
 
James Mills fc31c7aa2b
Fix import paths
2 weeks ago
.drone.yml Migrate to Drone CI, Codecov and Go11Modules 3 years ago
.gitignore Initial Commit 3 years ago
LICENSE Initial Commit 3 years ago
Makefile Migrate to Drone CI, Codecov and Go11Modules 3 years ago
README.md Fix import paths 2 weeks ago
go.mod Move to git.mills.io 2 weeks ago
go.sum Migrate to Drone CI, Codecov and Go11Modules 3 years ago
metrics.go Initial Commit 3 years ago
metrics_test.go Initial Commit 3 years ago

README.md

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