Documentation
¶
Index ¶
- func AnyToLabels(a interface{}) (map[string]string, error)
- func KubeAnnotationsToLabels(labels map[string]string) ([]string, []string)
- func KubeLabelsToLabels(labels map[string]string) ([]string, []string)
- func KubePrependQualifierToLabels(m map[string]string, qualifier string) ([]string, []string)
- func LabelNamesFrom(labels map[string]string) []string
- func MapToLabels(m interface{}) map[string]string
- func SanitizeLabelName(s string) string
- func SanitizeLabels(labels map[string]string) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToLabels ¶
AnyToLabels will create prometheus labels based on the fields of the interface passed. Note that this method is quite expensive and should only be used when absolutely necessary.
func KubeAnnotationsToLabels ¶
Converts kubernetes annotations into prometheus labels.
func KubeLabelsToLabels ¶
Converts kubernetes labels into prometheus labels.
func KubePrependQualifierToLabels ¶
Prepends a qualifier string to the keys provided in the m map and returns the new keys and values.
func LabelNamesFrom ¶
LabelNamesFrom accepts a mapping of labels to values and returns the label names.
func MapToLabels ¶
MapToLabels accepts a map type, and will return a new map containing all the nested fields separated by _ with string versions of the values.
func SanitizeLabelName ¶
Replaces all illegal prometheus label characters with _
func SanitizeLabels ¶
SanitizeLabels sanitizes all label names in the given map. This may cause collisions, which is intentional as collisions that are not caught prior to attempted emission will cause fatal errors. In the case of a collision, the last value seen will be set, and all previous values will be overwritten.
Types ¶
This section is empty.