Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrometheusHook ¶
type PrometheusHook struct {
// contains filtered or unexported fields
}
PrometheusHook exposes Prometheus counters for each of klog severity levels.
func MustNewPrometheusHook ¶
func MustNewPrometheusHook( metricPrefix string, severityLevel string) *PrometheusHook
MustNewPrometheusHook creates a new instance of PrometheusHook which exposes Prometheus counters for various log levels. Contrarily to NewPrometheusHook, it does not return any error to the caller, but panics instead. Use MustNewPrometheusHook if you want a less verbose hook creation. Use NewPrometheusHook if you want more control.
func NewPrometheusHook ¶
func NewPrometheusHook( metricPrefix string, severityLevel string) (*PrometheusHook, error)
NewPrometheusHook creates a new instance of PrometheusHook which exposes Prometheus counters for various severity. Contrarily to MustNewPrometheusHook, it returns an error to the caller in case of issue. Use NewPrometheusHook if you want more control. Use MustNewPrometheusHook if you want a less verbose hook creation.
func (*PrometheusHook) Fire ¶
func (hook *PrometheusHook) Fire(s string, args ...interface{}) error
Fire increments the appropriate Prometheus counter
func (*PrometheusHook) SeverityLevel ¶
func (hook *PrometheusHook) SeverityLevel() string
SeverityLevel can be "INFO", "WARNING", "ERROR" or "FATAL" Hook will be fired in all the cases when severity is greater than or equal to the severity level