metrics

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuccessTrue indicates that the operation was successful.
	SuccessTrue string = "true"
	// SuccessFalse indicates that the operation was not successful.
	SuccessFalse string = "false"

	// SuccessKey defines the key of the metric label indicating success/failure of an operation.
	SuccessKey string = "success"
)
View Source
const (
	// ProtocolDBLess indicates that configuration was sent to Kong using the DB-less protocol (POST /config).
	ProtocolDBLess Protocol = "db-less"
	// ProtocolDeck indicates that configuration was sent to Kong using the DB mode protocol (deck sync).
	ProtocolDeck Protocol = "deck"

	// ProtocolKey defines the key of the metric label indicating which protocol KIC used to configure Kong.
	ProtocolKey string = "protocol"
)
View Source
const (
	// FailureReasonConflict indicates that the config push failed due to configuration conflicts.
	FailureReasonConflict string = "conflict"

	// FailureReasonNetwork indicates that the config push failed due to network issues.
	FailureReasonNetwork string = "network"

	// FailureReasonOther indicates that the config push failed due to other reasons.
	FailureReasonOther string = "other"

	// FailureReasonKey defines the key of the metric label indicating failure reason.
	FailureReasonKey string = "failure_reason"
)
View Source
const (
	MetricNameConfigPushCount            = "ingress_controller_configuration_push_count"
	MetricNameConfigPushBrokenResources  = "ingress_controller_configuration_push_broken_resource_count"
	MetricNameConfigPushSuccessTime      = "ingress_controller_configuration_push_last_successful"
	MetricNameTranslationCount           = "ingress_controller_translation_count"
	MetricNameTranslationBrokenResources = "ingress_controller_translation_broken_resource_count"
	MetricNameTranslationDuration        = "ingress_controller_translation_duration_milliseconds"
	MetricNameConfigPushDuration         = "ingress_controller_configuration_push_duration_milliseconds"
)

Regular config push metrics names.

View Source
const (
	MetricNameFallbackTranslationCount           = "ingress_controller_fallback_translation_count"
	MetricNameFallbackTranslationBrokenResources = "ingress_controller_fallback_translation_broken_resource_count"
	MetricNameFallbackTranslationDuration        = "ingress_controller_fallback_translation_duration_milliseconds"
	MetricNameFallbackConfigPushCount            = "ingress_controller_fallback_configuration_push_count"
	MetricNameFallbackConfigPushSuccessTime      = "ingress_controller_fallback_configuration_push_last"
	MetricNameFallbackConfigPushDuration         = "ingress_controller_fallback_configuration_push_duration_milliseconds"
	MetricNameFallbackConfigPushBrokenResources  = "ingress_controller_fallback_configuration_push_broken_resource_count"
	MetricNameFallbackCacheGenerationDuration    = "ingress_controller_fallback_cache_generation_duration_milliseconds"
	MetricNameProcessedConfigSnapshotCacheHit    = "ingress_controller_processed_config_snapshot_cache_hit"
	MetricNameProcessedConfigSnapshotCacheMiss   = "ingress_controller_processed_config_snapshot_cache_miss"
)

Fallback config push metrics names.

View Source
const (
	// DataplaneKey defines the name of the metric label indicating which dataplane this time series is relevant for.
	DataplaneKey string = "dataplane"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CtrlFuncMetrics

type CtrlFuncMetrics struct {
	// Regular config push metrics.
	ConfigPushCount            *prometheus.CounterVec
	ConfigPushBrokenResources  *prometheus.GaugeVec
	TranslationCount           *prometheus.CounterVec
	TranslationBrokenResources prometheus.Gauge
	TranslationDuration        *prometheus.HistogramVec
	ConfigPushDuration         *prometheus.HistogramVec
	ConfigPushSuccessTime      *prometheus.GaugeVec

	// Fallback config push metrics.
	FallbackTranslationCount           *prometheus.CounterVec
	FallbackTranslationBrokenResources prometheus.Gauge
	FallbackTranslationDuration        *prometheus.HistogramVec
	FallbackConfigPushCount            *prometheus.CounterVec
	FallbackConfigPushSuccessTime      *prometheus.GaugeVec
	FallbackConfigPushBrokenResources  *prometheus.GaugeVec
	FallbackConfigPushDuration         *prometheus.HistogramVec
	FallbackCacheGeneratingDuration    *prometheus.HistogramVec
	ProcessedConfigSnapshotCacheHit    prometheus.Counter
	ProcessedConfigSnapshotCacheMiss   prometheus.Counter
}

func NewCtrlFuncMetrics

func NewCtrlFuncMetrics() *CtrlFuncMetrics

func (*CtrlFuncMetrics) RecordFallbackCacheGenerationDuration added in v3.2.0

func (c *CtrlFuncMetrics) RecordFallbackCacheGenerationDuration(d time.Duration, err error)

RecordFallbackCacheGenerationDuration records the duration of a fallback cache generation.

func (*CtrlFuncMetrics) RecordFallbackPushFailure added in v3.2.0

func (c *CtrlFuncMetrics) RecordFallbackPushFailure(p Protocol, duration time.Duration, dataplane string, brokenResourcesCount int, err error)

RecordFallbackPushFailure records a failed fallback configuration push.

func (*CtrlFuncMetrics) RecordFallbackPushSuccess added in v3.2.0

func (c *CtrlFuncMetrics) RecordFallbackPushSuccess(p Protocol, duration time.Duration, dataplane string)

RecordFallbackPushSuccess records a successful fallback configuration push.

func (*CtrlFuncMetrics) RecordFallbackTranslationBrokenResources added in v3.2.0

func (c *CtrlFuncMetrics) RecordFallbackTranslationBrokenResources(count int)

RecordFallbackTranslationBrokenResources records the number of fallback resources failing translation.

func (*CtrlFuncMetrics) RecordFallbackTranslationFailure added in v3.2.0

func (c *CtrlFuncMetrics) RecordFallbackTranslationFailure(duration time.Duration)

RecordFallbackTranslationFailure records a failed fallback configuration translation.

func (*CtrlFuncMetrics) RecordFallbackTranslationSuccess added in v3.2.0

func (c *CtrlFuncMetrics) RecordFallbackTranslationSuccess(duration time.Duration)

RecordFallbackTranslationSuccess records a failed fallback configuration translation.

func (*CtrlFuncMetrics) RecordProcessedConfigSnapshotCacheHit added in v3.2.0

func (c *CtrlFuncMetrics) RecordProcessedConfigSnapshotCacheHit()

RecordProcessedConfigSnapshotCacheHit records a hit on the processed config snapshot cache.

func (*CtrlFuncMetrics) RecordProcessedConfigSnapshotCacheMiss added in v3.2.0

func (c *CtrlFuncMetrics) RecordProcessedConfigSnapshotCacheMiss()

RecordProcessedConfigSnapshotCacheMiss records a miss on the processed config snapshot cache.

func (*CtrlFuncMetrics) RecordPushFailure

func (c *CtrlFuncMetrics) RecordPushFailure(p Protocol, d time.Duration, dataplane string, count int, err error)

RecordPushFailure records a failed configuration push.

func (*CtrlFuncMetrics) RecordPushSuccess

func (c *CtrlFuncMetrics) RecordPushSuccess(p Protocol, d time.Duration, dataplane string)

RecordPushSuccess records a successful configuration push.

func (*CtrlFuncMetrics) RecordTranslationBrokenResources

func (c *CtrlFuncMetrics) RecordTranslationBrokenResources(count int)

RecordTranslationBrokenResources records the number of resources failing translation.

func (*CtrlFuncMetrics) RecordTranslationFailure

func (c *CtrlFuncMetrics) RecordTranslationFailure(duration time.Duration)

RecordTranslationFailure records a failed configuration translation.

func (*CtrlFuncMetrics) RecordTranslationSuccess

func (c *CtrlFuncMetrics) RecordTranslationSuccess(duration time.Duration)

RecordTranslationSuccess records a successful configuration translation.

type Protocol

type Protocol string

Jump to

Keyboard shortcuts

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