metrics

package
v0.0.0-...-9d49338 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "aivenator"

	LabelOperation          = "operation"
	LabelNamespace          = "namespace"
	LabelPool               = "pool"
	LabelResourceType       = "resource_type"
	LabelStatus             = "status"
	LabelSyncState          = "synchronization_state"
	LabelProcessingReason   = "processing_reason"
	LabelSecretState        = "state"
	LabelUserNameConvention = "username_convention"
	LabelHandler            = "handler"
)

Variables

View Source
var (
	ApplicationsProcessed = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "aiven_applications_processed",
		Namespace: Namespace,
		Help:      "number of applications synchronized with aiven",
	}, []string{LabelSyncState})

	ApplicationsRequeued = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "aiven_applications_requeued",
		Namespace: Namespace,
		Help:      "number of applications requeued for synchronization",
	}, []string{LabelSyncState})

	ApplicationProcessingTime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "aiven_application_processing_time_seconds",
		Namespace: Namespace,
		Help:      "seconds from observed to synchronised successfully",
		Buckets:   prometheus.LinearBuckets(1.0, 2.0, 20),
	}, []string{LabelSyncState})

	HandlerProcessingTime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "aiven_handler_processing_time_seconds",
		Namespace: Namespace,
		Help:      "seconds spent processing by handler",
		Buckets:   prometheus.LinearBuckets(1.0, 2.0, 20),
	}, []string{LabelHandler})

	ProcessingReason = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "processing_reason",
		Namespace: Namespace,
		Help:      "reason for why this processing needs to happen",
	}, []string{LabelProcessingReason})

	ServiceUsersCreated = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "service_users_created",
		Namespace: Namespace,
		Help:      "number of service users created",
	}, []string{LabelPool})

	ServiceUsersDeleted = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "service_users_deleted",
		Namespace: Namespace,
		Help:      "number of service users deleted",
	}, []string{LabelPool})

	ServiceUsersCount = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "service_users_count",
		Namespace: Namespace,
		Help:      "total count of service users",
	}, []string{LabelPool, LabelUserNameConvention})

	AivenLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "aiven_latency",
		Namespace: Namespace,
		Help:      "latency in aiven api operations",
		Buckets:   prometheus.ExponentialBuckets(0.02, 2, 14),
	}, []string{LabelOperation, LabelStatus, LabelPool})

	KubernetesResourcesWritten = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "kubernetes_resources_written",
		Namespace: Namespace,
		Help:      "number of kubernetes resources written to the cluster",
	}, []string{LabelNamespace, LabelResourceType})

	KubernetesResourcesDeleted = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "kubernetes_resources_deleted",
		Namespace: Namespace,
		Help:      "number of kubernetes resources deleted from the cluster",
	}, []string{LabelNamespace, LabelResourceType})

	KubernetesLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "kubernetes_latency",
		Namespace: Namespace,
		Help:      "latency in kubernetes api operations",
		Buckets:   prometheus.ExponentialBuckets(0.02, 2, 14),
	}, []string{LabelOperation})

	SecretsManaged = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "secrets_managed",
		Namespace: Namespace,
		Help:      "number of secrets managed",
	}, []string{LabelSecretState})
)

Functions

func ObserveAivenLatency

func ObserveAivenLatency(operation, pool string, fun func() error) error

func ObserveKubernetesLatency

func ObserveKubernetesLatency(operation string, fun func() error) error

func Register

func Register(registry prometheus.Registerer)

Types

type Reason

type Reason string
const (
	HashChanged           Reason = "HashChanged"
	MissingSecret         Reason = "MissingSecret"
	MissingOwnerReference Reason = "MissingOwnerReference"
)

func (Reason) String

func (r Reason) String() string

Jump to

Keyboard shortcuts

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