labels

package
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

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

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

func ForRelease(release terra.Release) map[string]string

ForRelease returns a standard set of labels for a chart release. For example:

{
  "release": "leonardo",
  "env": "dev",
  "cluster": "terra-dev",
}

func ForReleaseOrDestination

func ForReleaseOrDestination(value interface{}, extra ...map[string]string) map[string]string

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).

func Merge

func Merge(maps ...map[string]string) map[string]string

Merge N maps into a single map (last takes precedence)

func Normalize

func Normalize(labels map[string]string) map[string]string

Types

This section is empty.

Jump to

Keyboard shortcuts

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