Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ var (

// Handler is a convenience wrapper around [promhttp.Handler] that returns an
// HTTP handler serving metrics from the default Prometheus gatherer.
//
// Deprecated: use [promhttp.Handler] directly.
//
//go:fix inline
func Handler() http.Handler {
return promhttp.Handler()
}
Expand Down
8 changes: 8 additions & 0 deletions register.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ import "github.com/prometheus/client_golang/prometheus"

// Register is a convenience wrapper around [prometheus.MustRegister] that
// registers all metrics in n with the default Prometheus registry.
//
// Deprecated: use [prometheus.MustRegister] directly.
//
//go:fix inline
func Register(n *Namespace) {
prometheus.MustRegister(n)
}

// Deregister is a convenience wrapper around [prometheus.Unregister] that
// unregisters all metrics in n from the default Prometheus registry.
//
// Deprecated: use [prometheus.Unregister] directly.
//
//go:fix inline
func Deregister(n *Namespace) {
prometheus.Unregister(n)
}