metrics

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Complete operation = iota
	Delete
)

Variables

This section is empty.

Functions

func AddMetricsTransportWrapper

func AddMetricsTransportWrapper(ctx context.Context, config *rest.Config) *rest.Config

func IsValidMetricName

func IsValidMetricName(name string) bool

func ValidateMetricLabels

func ValidateMetricLabels(metrics map[string]string) error

func ValidateMetricValues

func ValidateMetricValues(metric *wfv1.Prometheus) error

Types

type Callbacks

type Callbacks struct {
	PodPhase          PodPhaseCallback
	WorkflowPhase     WorkflowPhaseCallback
	WorkflowCondition WorkflowConditionCallback
	IsLeader          IsLeaderCallback
}

type ErrorCause

type ErrorCause string
const (
	ErrorCauseOperationPanic              ErrorCause = "OperationPanic"
	ErrorCauseCronWorkflowSubmissionError ErrorCause = "CronWorkflowSubmissionError"
	ErrorCauseCronWorkflowSpecError       ErrorCause = "CronWorkflowSpecError"
)

type IsLeaderCallback

type IsLeaderCallback func() bool

type Metrics

type Metrics struct {
	*telemetry.Metrics
	// contains filtered or unexported fields
}

func CreateDefaultTestMetrics

func CreateDefaultTestMetrics(ctx context.Context) (*Metrics, *telemetry.TestMetricsExporter, error)

CreateDefaultTestMetrics creates a boring testExporter enabled metrics, suitable for many tests

func New

func New(ctx context.Context, serviceName, prometheusName string, config *telemetry.Config, callbacks Callbacks, extraOpts ...metricsdk.Option) (*Metrics, error)

func (*Metrics) ChangePodPending

func (m *Metrics) ChangePodPending(ctx context.Context, reason, namespace string)

func (*Metrics) ChangePodPhase

func (m *Metrics) ChangePodPhase(ctx context.Context, phase, namespace string)

func (*Metrics) ChangeWorkflowPhase

func (m *Metrics) ChangeWorkflowPhase(ctx context.Context, phase MetricWorkflowPhase, namespace string)

func (*Metrics) CompleteRealtimeMetricsForWfUID

func (m *Metrics) CompleteRealtimeMetricsForWfUID(key string)

func (*Metrics) CountWorkflowTemplate

func (m *Metrics) CountWorkflowTemplate(ctx context.Context, phase MetricWorkflowPhase, name, namespace string, cluster bool)

func (*Metrics) CronWfPolicy

func (m *Metrics) CronWfPolicy(ctx context.Context, name, namespace string, policy wfv1.ConcurrencyPolicy)

func (*Metrics) CronWfTrigger

func (m *Metrics) CronWfTrigger(ctx context.Context, name, namespace string)

func (*Metrics) CronWorkflowSpecError

func (m *Metrics) CronWorkflowSpecError(ctx context.Context)

func (*Metrics) CronWorkflowSubmissionError

func (m *Metrics) CronWorkflowSubmissionError(ctx context.Context)

func (*Metrics) CustomMetricExists

func (m *Metrics) CustomMetricExists(key string) bool

CustomMetricExists returns if metric exists from its key This is exported for testing only

func (*Metrics) DeleteRealtimeMetricsForWfUID

func (m *Metrics) DeleteRealtimeMetricsForWfUID(key string)

func (*Metrics) GetCustomMetric

func (m *Metrics) GetCustomMetric(key string) *telemetry.Instrument

GetCustomMetric returns a custom (or any) metric from it's key This is exported for legacy testing only

func (*Metrics) NewAddsMetric

func (m *Metrics) NewAddsMetric(name string) workqueue.CounterMetric

func (*Metrics) NewDepthMetric

func (m *Metrics) NewDepthMetric(name string) workqueue.GaugeMetric

func (*Metrics) NewLatencyMetric

func (m *Metrics) NewLatencyMetric(name string) workqueue.HistogramMetric

func (*Metrics) NewLongestRunningProcessorSecondsMetric

func (m *Metrics) NewLongestRunningProcessorSecondsMetric(name string) workqueue.SettableGaugeMetric

func (*Metrics) NewRetriesMetric

func (m *Metrics) NewRetriesMetric(name string) workqueue.CounterMetric

func (*Metrics) NewUnfinishedWorkSecondsMetric

func (m *Metrics) NewUnfinishedWorkSecondsMetric(name string) workqueue.SettableGaugeMetric

func (*Metrics) NewWorkDurationMetric

func (m *Metrics) NewWorkDurationMetric(name string) workqueue.HistogramMetric

func (*Metrics) OperationCompleted

func (m *Metrics) OperationCompleted(ctx context.Context, durationSeconds float64)

func (*Metrics) OperationPanic

func (m *Metrics) OperationPanic(ctx context.Context)

func (*Metrics) PodMissingEnsure

func (m *Metrics) PodMissingEnsure(ctx context.Context, recentlyStarted bool, phase string)

func (*Metrics) PodMissingInc

func (m *Metrics) PodMissingInc(ctx context.Context, recentlyStarted bool, phase string)

func (*Metrics) RateLimiterWithBusyWorkers

func (m *Metrics) RateLimiterWithBusyWorkers(ctx context.Context, workQueue workqueue.TypedRateLimiter[string], name string) workqueue.TypedRateLimitingInterface[string]

func (*Metrics) RecordPodRestart

func (m *Metrics) RecordPodRestart(ctx context.Context, reason, message, namespace string)

RecordPodRestart records a metric when a pod is automatically restarted due to an infrastructure failure.

func (*Metrics) RecordWorkflowTemplateTime

func (m *Metrics) RecordWorkflowTemplateTime(ctx context.Context, duration time.Duration, name, namespace string, cluster bool)

func (*Metrics) UpsertCustomMetric

func (m *Metrics) UpsertCustomMetric(ctx context.Context, metricSpec *wfv1.Prometheus, ownerKey string, valueFunc RealTimeValueFunc) error

type PodPhaseCallback

type PodPhaseCallback func(ctx context.Context) map[string]int64

PodPhaseCallback is the function prototype to provide this gauge with the phase of the pods

type RealTimeValueFunc

type RealTimeValueFunc func() float64

type WorkflowConditionCallback

type WorkflowConditionCallback func(ctx context.Context) map[wfv1.Condition]int64

WorkflowConditionCallback is the function prototype to provide this gauge with the condition of the workflows

type WorkflowPhaseCallback

type WorkflowPhaseCallback func(ctx context.Context) map[string]int64

WorkflowPhaseCallback is the function prototype to provide this gauge with the phase of the pods

Jump to

Keyboard shortcuts

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