Documentation ¶
Overview ¶
Package labels contains utility functions for generating a standard set of labels for terra.State objects Note that you cannot record two metrics with the same name and a different set of labels; if you do, the prometheus client library will panic. For that reason, we supply empty labels ("env": "") where labels don't apply.
Index ¶
- func ForDestination(dest terra.Destination) map[string]string
- func ForRelease(release terra.Release) map[string]string
- func ForReleaseOrDestination(value interface{}, extra ...map[string]string) map[string]string
- func Merge(maps ...map[string]string) map[string]string
- func Normalize(labels map[string]string) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForDestination ¶
func ForDestination(dest terra.Destination) map[string]string
ForDestination returns a standard set of labels for a destination. For example, for the dev env:
{ "env": "dev", "cluster": "", }
For the terra-dev-cluster:
{ "env": "", "cluster": "terra-dev", }
func ForRelease ¶
ForRelease returns a standard set of labels for a chart release. For example:
{ "release": "leonardo", "env": "dev", "cluster": "terra-dev", }
func ForReleaseOrDestination ¶
ForReleaseOrDestination is for metrics that could apply to either a release or a destination. (manifest rendering jobs are probably the only use case for this).
Types ¶
This section is empty.