Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PrometheusFormat is a constant that defines which prometheus format will be used // see also: https://github.com/prometheus/common/blob/6fb6fce6f8b75884b92e1889c150403fc0872c5e/expfmt/expfmt.go#L27 PrometheusFormat = expfmt.FmtText )
Variables ¶
This section is empty.
Functions ¶
func AddCustomMetricsHook ¶
func AddCustomMetricsHook(hook func() map[string]interface{})
AddCustomMetricsHook adds a new hook that will be called everytime to collect additional metrics when function WriteMetricsPrometheus or WriteMetricsJSON is called.
The hook should return map of "string to interface{}" where the "string" is a metric key and "interface{}" is the value.
func SetLogger ¶
func SetLogger(newLogger Logger)
SetLogger sets the logger to be used to report about errors
func WriteMetricsJSON ¶
WriteMetricsJSON write all the metrics via writer in JSON format.
func WriteMetricsPrometheus ¶
WriteMetricsPrometheus write all the metrics via writer in prometheus format.
Types ¶
Click to show internal directories.
Click to hide internal directories.