metrics

package
v0.0.0-...-57e6299 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RollbackLabel  = "rollback"
	DownscaleLabel = "downscale"
)
View Source
const Unknown = "unknown"

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentStatus

type DeploymentStatus float64
const CLEANUP DeploymentStatus = 200

CLEANUP Deployment is in the process of rolling back or downscaling.

const FAILING DeploymentStatus = 100

FAILING Deployment is detected as failing and currently in grace period.

const OK DeploymentStatus = 1

OK Deployment is detected as ok.

type History

type History struct {
	// contains filtered or unexported fields
}

func NewHistory

func NewHistory(influxClient influxdb2.Client, influxdbDatabase, cluster string) *History

func (*History) HistorizeDeploymentFailing

func (h *History) HistorizeDeploymentFailing(reason, team, slackChannel, name string)

func (*History) HistorizeDeploymentKilled

func (h *History) HistorizeDeploymentKilled(method, team, slackChannel, name string, armed bool)

type Metrics

type Metrics struct {
	DeploymentCleanup     *prometheus.CounterVec
	RuleActivations       *prometheus.CounterVec
	TeamNotifications     *prometheus.CounterVec
	DeploymentStatusTotal *prometheus.CounterVec
	DeploymentUpdated     *prometheus.GaugeVec
	DeploymentGraceCutoff *prometheus.GaugeVec
	SlackChannelMapping   *prometheus.GaugeVec
	// contains filtered or unexported fields
}

func Init

func Init(unleash *unleash.Client, c client.Client) Metrics

func (*Metrics) IncDeploymentCleanup

func (m *Metrics) IncDeploymentCleanup(
	deployment *appsv1.Deployment,
	armed bool,
	channel string,
	reason string)

func (*Metrics) IncRuleActivations

func (m *Metrics) IncRuleActivations(
	pod *v1.Pod,
	reason string)

func (Metrics) SetDeploymentStatus

func (m Metrics) SetDeploymentStatus(deployment *appsv1.Deployment,
	channel string, armed bool, status DeploymentStatus)

func (Metrics) SetGraceCutoff

func (m Metrics) SetGraceCutoff(deployment *appsv1.Deployment, graceCutoff time.Time)

func (*Metrics) SlackChannel

func (m *Metrics) SlackChannel(ctx context.Context, ns string) string

Jump to

Keyboard shortcuts

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