metricscollector

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterTriggerAuthenticationResource = "cluster_trigger_authentication"
	TriggerAuthenticationResource        = "trigger_authentication"
	ScaledObjectResource                 = "scaled_object"
	ScaledJobResource                    = "scaled_job"
	CloudEventSourceResource             = "cloudevent_source"

	DefaultPromMetricsNamespace = "keda"
)

Variables

This section is empty.

Functions

func BuildInfoCallback added in v2.13.0

func BuildInfoCallback(_ context.Context, obsrv api.Int64Observer) error

func CloudeventQueueStatusCallback added in v2.13.0

func CloudeventQueueStatusCallback(_ context.Context, obsrv api.Float64Observer) error

func DecrementCRDTotal

func DecrementCRDTotal(crdType, namespace string)

func DecrementTriggerTotal

func DecrementTriggerTotal(triggerType string)

func GetServerMetrics added in v2.14.0

func GetServerMetrics() *grpcprom.ServerMetrics

Returns the ServerMetrics object for GRPC Server metrics. Used to initialize the GRPC server with the proper intercepts Currently, only Prometheus metrics are supported.

func IncrementCRDTotal

func IncrementCRDTotal(crdType, namespace string)

func IncrementTriggerTotal

func IncrementTriggerTotal(triggerType string)

func NewMetricsCollectors

func NewMetricsCollectors(enablePrometheusMetrics bool, enableOpenTelemetryMetrics bool)

func PausedStatusCallback added in v2.14.0

func PausedStatusCallback(_ context.Context, obsrv api.Float64Observer) error

func RecordBuildInfo

func RecordBuildInfo()

RecordBuildInfo publishes information about KEDA version and runtime info through an info metric (gauge).

func RecordCloudEventEmitted added in v2.13.0

func RecordCloudEventEmitted(namespace string, cloudeventsource string, eventsink string)

RecordCloudEventEmitted counts the number of cloudevent that emitted to user's sink

func RecordCloudEventEmittedError added in v2.13.0

func RecordCloudEventEmittedError(namespace string, cloudeventsource string, eventsink string)

RecordCloudEventEmittedError counts the number of errors occurred in trying emit cloudevent

func RecordCloudEventQueueStatus added in v2.13.0

func RecordCloudEventQueueStatus(namespace string, value int)

RecordCloudEventQueueStatus record the number of cloudevents that are waiting for emitting

func RecordScalableObjectLatency

func RecordScalableObjectLatency(namespace string, name string, isScaledObject bool, value time.Duration)

RecordScalableObjectLatency create a measurement of the latency executing scalable object loop

func RecordScaledJobError added in v2.13.0

func RecordScaledJobError(namespace string, scaledJob string, err error)

RecordScaledJobError counts the number of errors with the scaled job

func RecordScaledObjectError

func RecordScaledObjectError(namespace string, scaledObject string, err error)

RecordScaledObjectError counts the number of errors with the scaled object

func RecordScaledObjectPaused added in v2.13.0

func RecordScaledObjectPaused(namespace string, scaledObject string, active bool)

RecordScaledObjectPaused marks whether the current ScaledObject is paused.

func RecordScalerActive

func RecordScalerActive(namespace string, scaledObject string, scaler string, triggerIndex int, metric string, isScaledObject bool, active bool)

RecordScalerActive create a measurement of the activity of the scaler

func RecordScalerError

func RecordScalerError(namespace string, scaledObject string, scaler string, triggerIndex int, metric string, isScaledObject bool, err error)

RecordScalerError counts the number of errors occurred in trying to get an external metric used by the HPA

func RecordScalerLatency

func RecordScalerLatency(namespace string, scaledObject string, scaler string, triggerIndex int, metric string, isScaledObject bool, value time.Duration)

RecordScalerLatency create a measurement of the latency to external metric

func RecordScalerMetric

func RecordScalerMetric(namespace string, scaledObject string, scaler string, triggerIndex int, metric string, isScaledObject bool, value float64)

RecordScalerMetric create a measurement of the external metric used by the HPA

func ScalableObjectLatencyCallback added in v2.13.0

func ScalableObjectLatencyCallback(_ context.Context, obsrv api.Float64Observer) error

func ScalableObjectLatencyCallbackDeprecated added in v2.14.0

func ScalableObjectLatencyCallbackDeprecated(_ context.Context, obsrv api.Float64Observer) error

func ScalerActiveCallback added in v2.13.0

func ScalerActiveCallback(_ context.Context, obsrv api.Float64Observer) error

func ScalerMetricValueCallback added in v2.13.0

func ScalerMetricValueCallback(_ context.Context, obsrv api.Float64Observer) error

func ScalerMetricsLatencyCallback added in v2.13.0

func ScalerMetricsLatencyCallback(_ context.Context, obsrv api.Float64Observer) error

func ScalerMetricsLatencyCallbackDeprecated added in v2.14.0

func ScalerMetricsLatencyCallbackDeprecated(_ context.Context, obsrv api.Float64Observer) error

Types

type MetricsCollector

type MetricsCollector interface {
	RecordScalerMetric(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, value float64)

	// RecordScalerLatency create a measurement of the latency to external metric
	RecordScalerLatency(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, value time.Duration)

	// RecordScalableObjectLatency create a measurement of the latency executing scalable object loop
	RecordScalableObjectLatency(namespace string, name string, isScaledObject bool, value time.Duration)

	// RecordScalerActive create a measurement of the activity of the scaler
	RecordScalerActive(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, active bool)

	// RecordScaledObjectPaused marks whether the current ScaledObject is paused.
	RecordScaledObjectPaused(namespace string, scaledObject string, active bool)

	// RecordScalerError counts the number of errors occurred in trying to get an external metric used by the HPA
	RecordScalerError(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, err error)

	// RecordScaledObjectError counts the number of errors with the scaled object
	RecordScaledObjectError(namespace string, scaledObject string, err error)

	// RecordScaledJobError counts the number of errors with the scaled job
	RecordScaledJobError(namespace string, scaledJob string, err error)

	IncrementTriggerTotal(triggerType string)

	DecrementTriggerTotal(triggerType string)

	IncrementCRDTotal(crdType, namespace string)

	DecrementCRDTotal(crdType, namespace string)

	// RecordCloudEventEmitted counts the number of cloudevent that emitted to user's sink
	RecordCloudEventEmitted(namespace string, cloudeventsource string, eventsink string)

	// RecordCloudEventEmittedError counts the number of errors occurred in trying emit cloudevent
	RecordCloudEventEmittedError(namespace string, cloudeventsource string, eventsink string)

	// RecordCloudEventQueueStatus record the number of cloudevents that are waiting for emitting
	RecordCloudEventQueueStatus(namespace string, value int)
}

type OtelMetricFloat64Val added in v2.13.0

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

type OtelMetricInt64Val added in v2.13.0

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

type OtelMetrics

type OtelMetrics struct {
}

func NewOtelMetrics

func NewOtelMetrics(options ...metric.Option) *OtelMetrics

func (*OtelMetrics) DecrementCRDTotal

func (o *OtelMetrics) DecrementCRDTotal(crdType, namespace string)

func (*OtelMetrics) DecrementTriggerTotal

func (o *OtelMetrics) DecrementTriggerTotal(triggerType string)

func (*OtelMetrics) IncrementCRDTotal

func (o *OtelMetrics) IncrementCRDTotal(crdType, namespace string)

func (*OtelMetrics) IncrementTriggerTotal

func (o *OtelMetrics) IncrementTriggerTotal(triggerType string)

func (*OtelMetrics) RecordBuildInfo

func (o *OtelMetrics) RecordBuildInfo()

RecordBuildInfo publishes information about KEDA version and runtime info through an info metric (gauge).

func (*OtelMetrics) RecordCloudEventEmitted added in v2.13.0

func (o *OtelMetrics) RecordCloudEventEmitted(namespace string, cloudeventsource string, eventsink string)

RecordCloudEventEmitted counts the number of cloudevent that emitted to user's sink

func (*OtelMetrics) RecordCloudEventEmittedError added in v2.13.0

func (o *OtelMetrics) RecordCloudEventEmittedError(namespace string, cloudeventsource string, eventsink string)

RecordCloudEventEmittedError counts the number of errors occurred in trying emit cloudevent

func (*OtelMetrics) RecordCloudEventQueueStatus added in v2.13.0

func (o *OtelMetrics) RecordCloudEventQueueStatus(namespace string, value int)

RecordCloudEventQueueStatus record the number of cloudevents that are waiting for emitting

func (*OtelMetrics) RecordScalableObjectLatency

func (o *OtelMetrics) RecordScalableObjectLatency(namespace string, name string, isScaledObject bool, value time.Duration)

RecordScalableObjectLatency create a measurement of the latency executing scalable object loop

func (*OtelMetrics) RecordScaledJobError added in v2.13.0

func (o *OtelMetrics) RecordScaledJobError(namespace string, scaledJob string, err error)

RecordScaledJobError counts the number of errors with the scaled job

func (*OtelMetrics) RecordScaledObjectError

func (o *OtelMetrics) RecordScaledObjectError(namespace string, scaledObject string, err error)

RecordScaledObjectError counts the number of errors with the scaled object

func (*OtelMetrics) RecordScaledObjectPaused added in v2.13.0

func (o *OtelMetrics) RecordScaledObjectPaused(namespace string, scaledObject string, active bool)

RecordScaledObjectPaused marks whether the current ScaledObject is paused.

func (*OtelMetrics) RecordScalerActive

func (o *OtelMetrics) RecordScalerActive(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, active bool)

RecordScalerActive create a measurement of the activity of the scaler

func (*OtelMetrics) RecordScalerError

func (o *OtelMetrics) RecordScalerError(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, err error)

RecordScalerError counts the number of errors occurred in trying to get an external metric used by the HPA

func (*OtelMetrics) RecordScalerLatency

func (o *OtelMetrics) RecordScalerLatency(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, value time.Duration)

RecordScalerLatency create a measurement of the latency to external metric

func (*OtelMetrics) RecordScalerMetric

func (o *OtelMetrics) RecordScalerMetric(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, value float64)

type PromMetrics

type PromMetrics struct {
}

func NewPromMetrics

func NewPromMetrics() *PromMetrics

func (*PromMetrics) DecrementCRDTotal

func (p *PromMetrics) DecrementCRDTotal(crdType, namespace string)

func (*PromMetrics) DecrementTriggerTotal

func (p *PromMetrics) DecrementTriggerTotal(triggerType string)

func (*PromMetrics) IncrementCRDTotal

func (p *PromMetrics) IncrementCRDTotal(crdType, namespace string)

func (*PromMetrics) IncrementTriggerTotal

func (p *PromMetrics) IncrementTriggerTotal(triggerType string)

func (*PromMetrics) RecordCloudEventEmitted added in v2.13.0

func (p *PromMetrics) RecordCloudEventEmitted(namespace string, cloudeventsource string, eventsink string)

RecordCloudEventEmitted counts the number of cloudevent that emitted to user's sink

func (*PromMetrics) RecordCloudEventEmittedError added in v2.13.0

func (p *PromMetrics) RecordCloudEventEmittedError(namespace string, cloudeventsource string, eventsink string)

RecordCloudEventEmittedError counts the number of errors occurred in trying emit cloudevent

func (*PromMetrics) RecordCloudEventQueueStatus added in v2.13.0

func (p *PromMetrics) RecordCloudEventQueueStatus(namespace string, value int)

RecordCloudEventQueueStatus record the number of cloudevents that are waiting for emitting

func (*PromMetrics) RecordScalableObjectLatency

func (p *PromMetrics) RecordScalableObjectLatency(namespace string, name string, isScaledObject bool, value time.Duration)

RecordScalableObjectLatency create a measurement of the latency executing scalable object loop

func (*PromMetrics) RecordScaledJobError added in v2.13.0

func (p *PromMetrics) RecordScaledJobError(namespace string, scaledJob string, err error)

RecordScaledJobError counts the number of errors with the scaled job

func (*PromMetrics) RecordScaledObjectError

func (p *PromMetrics) RecordScaledObjectError(namespace string, scaledObject string, err error)

RecordScaledObjectError counts the number of errors with the scaled object

func (*PromMetrics) RecordScaledObjectPaused added in v2.13.0

func (p *PromMetrics) RecordScaledObjectPaused(namespace string, scaledObject string, active bool)

RecordScaledObjectPaused marks whether the current ScaledObject is paused.

func (*PromMetrics) RecordScalerActive

func (p *PromMetrics) RecordScalerActive(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, active bool)

RecordScalerActive create a measurement of the activity of the scaler

func (*PromMetrics) RecordScalerError

func (p *PromMetrics) RecordScalerError(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, err error)

RecordScalerError counts the number of errors occurred in trying to get an external metric used by the HPA

func (*PromMetrics) RecordScalerLatency

func (p *PromMetrics) RecordScalerLatency(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, value time.Duration)

RecordScalerLatency create a measurement of the latency to external metric

func (*PromMetrics) RecordScalerMetric

func (p *PromMetrics) RecordScalerMetric(namespace string, scaledResource string, scaler string, triggerIndex int, metric string, isScaledObject bool, value float64)

RecordScalerMetric create a measurement of the external metric used by the HPA

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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