-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2093 from jzelinskie/spicedbinfo
metrics: spicedb_environment_info from telemetry
- Loading branch information
Showing
3 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package promutil | ||
|
||
import "github.com/prometheus/client_golang/prometheus" | ||
|
||
var _ prometheus.Collector = (CollectorFunc)(nil) | ||
|
||
// CollectorFunc is a convenient way to implement a Prometheus Collector | ||
// without interface boilerplate. | ||
// | ||
// This implementation relies on prometheus.DescribeByCollect; familiarize | ||
// yourself with that documentation before using. | ||
type CollectorFunc func(ch chan<- prometheus.Metric) | ||
|
||
func (c CollectorFunc) Collect(ch chan<- prometheus.Metric) { c(ch) } | ||
func (c CollectorFunc) Describe(ch chan<- *prometheus.Desc) { prometheus.DescribeByCollect(c, ch) } |