prometrics

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRegistry *ksurveyclient.Registry

DefaultRegistry exposes the registry which is used by autosurvey.

Functions

func WrapCollector

func WrapCollector(c prometheus.Collector, whitelist map[string]string) ksurveyclient.Collector

WrapCollector takes a prometheus.Collector with a whitelist and returns a kcsurveyclient.Collector. If the provided whitelist is nil, all the metrics in the provided prometheus.Collector whill be collected. If whitelist is not nil, only the metrics found as keys will be collected. If the values of the whitelist keys is not empty, the metrics name will also be changed to that value.

func WrapRegistry

func WrapRegistry(reg *ksurveyclient.Registry, whitelist map[string]string) prometheus.Registerer

WrapRegistry wraps the provided ksurveyclient.Registry so it can register prometheus.Collectors with optional filter and aliasing with the provided whitelist map.

Example whitelist with formatting:

map[string]string{
	"rtm_distinct_users_connected_max": "usercnt_active,gauge:int",
	"rtm_group_channels_created_max":   "usercnt_room,gauge:int",
	"rtm_channels_created_max":         "usercnt_equipment,gauge:int",
	"rtm_connections_connected_max":    "usercnt_nonactive,gauge:int",
	"guest_http_logon_success_total":   "usercnt_na_user,gauge:int",
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL