metrics

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PollingInterval = 30 * time.Second
View Source
var Retention = 14 * 24 * time.Hour

Retention is the default time and date for obtaining operations by the database query For performance reasons, it is not possible to query entire operations database table, so instead KEB queries the database for last 14 days worth of data and then for deltas during the ellapsed time

Functions

func RegisterAll

func RegisterAll(sub event.Subscriber, operationStatsGetter OperationsStatsGetter, instanceStatsGetter InstancesStatsGetter)

func StartOpsMetricService

func StartOpsMetricService(ctx context.Context, db operationsGetter, logger logrus.FieldLogger)

Types

type InstancesCollector

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

func NewInstancesCollector

func NewInstancesCollector(statsGetter InstancesStatsGetter) *InstancesCollector

func (*InstancesCollector) Collect

func (c *InstancesCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (*InstancesCollector) Describe

func (c *InstancesCollector) Describe(ch chan<- *prometheus.Desc)

type InstancesStatsGetter

type InstancesStatsGetter interface {
	GetInstanceStats() (internal.InstanceStats, error)
	GetERSContextStats() (internal.ERSContextStats, error)
}

InstancesStatsGetter provides number of all instances failed, succeeded or orphaned

(instance exists but the cluster was removed manually from the gardener):

- compass_keb_instances_total - total number of all instances - compass_keb_global_account_id_instances_total - total number of all instances per global account - compass_keb_ers_context_license_type_total - count of instances grouped by license types

type LastOperationState

type LastOperationState = domain.LastOperationState
const (
	Pending   LastOperationState = "pending"
	Canceling LastOperationState = "canceling"
	Canceled  LastOperationState = "canceled"
	Retrying  LastOperationState = "retrying"
)

type OperationDurationCollector

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

OperationDurationCollector provides histograms which describes the time of provisioning/deprovisioning operations: - compass_keb_provisioning_duration_minutes - compass_keb_deprovisioning_duration_minutes

func NewOperationDurationCollector

func NewOperationDurationCollector() *OperationDurationCollector

func (*OperationDurationCollector) Collect

func (c *OperationDurationCollector) Collect(ch chan<- prometheus.Metric)

func (*OperationDurationCollector) Describe

func (c *OperationDurationCollector) Describe(ch chan<- *prometheus.Desc)

func (*OperationDurationCollector) OnDeprovisioningStepProcessed

func (c *OperationDurationCollector) OnDeprovisioningStepProcessed(ctx context.Context, ev interface{}) error

func (*OperationDurationCollector) OnOperationStepProcessed

func (c *OperationDurationCollector) OnOperationStepProcessed(ctx context.Context, ev interface{}) error

func (*OperationDurationCollector) OnOperationSucceeded

func (c *OperationDurationCollector) OnOperationSucceeded(ctx context.Context, ev interface{}) error

func (*OperationDurationCollector) OnProvisioningSucceeded

func (c *OperationDurationCollector) OnProvisioningSucceeded(ctx context.Context, ev interface{}) error

type OperationResultCollector

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

OperationResultCollector provides the following metrics: - compass_keb_provisioning_result{"operation_id", "instance_id", "global_account_id", "plan_id"} - compass_keb_deprovisioning_result{"operation_id", "instance_id", "global_account_id", "plan_id"} - compass_keb_upgrade_result{"operation_id", "instance_id", "global_account_id", "plan_id"} These gauges show the status of the operation. The value of the gauge could be: 0 - Failed 1 - Succeeded 2 - In progress 3 - Pending 4 - Canceling 5 - Canceled

func NewOperationResultCollector

func NewOperationResultCollector() *OperationResultCollector

func (*OperationResultCollector) Collect

func (c *OperationResultCollector) Collect(ch chan<- prometheus.Metric)

func (*OperationResultCollector) Describe

func (c *OperationResultCollector) Describe(ch chan<- *prometheus.Desc)

func (*OperationResultCollector) OnDeprovisioningStepProcessed

func (c *OperationResultCollector) OnDeprovisioningStepProcessed(ctx context.Context, ev interface{}) error

func (*OperationResultCollector) OnOperationStepProcessed

func (c *OperationResultCollector) OnOperationStepProcessed(ctx context.Context, ev interface{}) error

func (*OperationResultCollector) OnOperationSucceeded

func (c *OperationResultCollector) OnOperationSucceeded(ctx context.Context, ev interface{}) error

func (*OperationResultCollector) OnProvisioningStepProcessed

func (c *OperationResultCollector) OnProvisioningStepProcessed(ctx context.Context, ev interface{}) error

func (*OperationResultCollector) OnProvisioningSucceeded

func (c *OperationResultCollector) OnProvisioningSucceeded(ctx context.Context, ev interface{}) error

func (*OperationResultCollector) OnUpgradeClusterStepProcessed

func (c *OperationResultCollector) OnUpgradeClusterStepProcessed(ctx context.Context, ev interface{}) error

func (*OperationResultCollector) OnUpgradeKymaStepProcessed

func (c *OperationResultCollector) OnUpgradeKymaStepProcessed(ctx context.Context, ev interface{}) error

type OperationStat

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

func (*OperationStat) Describe

func (c *OperationStat) Describe(ch chan<- *prometheus.Desc)

type OperationsCollector

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

func NewOperationsCollector

func NewOperationsCollector(statsGetter OperationsStatsGetter) *OperationsCollector

func (*OperationsCollector) Collect

func (c *OperationsCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (*OperationsCollector) Describe

func (c *OperationsCollector) Describe(ch chan<- *prometheus.Desc)

type OperationsStatsGetter

type OperationsStatsGetter interface {
	GetOperationStatsByPlan() (map[string]internal.OperationStats, error)
}

type StepResultCollector

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

StepResultCollector provides the following metrics: - compass_keb_provisioning_step_result{"operation_id", "instance_id", "step_name", "global_account_id", "plan_id"} - compass_keb_deprovisioning_step_result{"operation_id", "instance_id", "step_name", "global_account_id", "plan_id"} These gauges show the status of the operation step. The value of the gauge could be: 0 - Failed 1 - Succeeded 2 - In progress

func NewStepResultCollector

func NewStepResultCollector() *StepResultCollector

func (*StepResultCollector) Collect

func (c *StepResultCollector) Collect(ch chan<- prometheus.Metric)

func (*StepResultCollector) Describe

func (c *StepResultCollector) Describe(ch chan<- *prometheus.Desc)

func (*StepResultCollector) OnDeprovisioningStepProcessed

func (c *StepResultCollector) OnDeprovisioningStepProcessed(ctx context.Context, ev interface{}) error

func (*StepResultCollector) OnOperationStepProcessed

func (c *StepResultCollector) OnOperationStepProcessed(ctx context.Context, ev interface{}) error

func (*StepResultCollector) OnProvisioningStepProcessed

func (c *StepResultCollector) OnProvisioningStepProcessed(ctx context.Context, ev interface{}) error

Jump to

Keyboard shortcuts

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