metrics

package
v3.6.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 20 Imported by: 10

Documentation

Index

Constants

This section is empty.

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 added in v3.3.0

func ValidateMetricValues(metric *wfv1.Prometheus) error

Types

type Callbacks added in v3.6.0

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 added in v3.6.0

type IsLeaderCallback func() bool

type Metrics

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

func CreateDefaultTestMetrics added in v3.6.0

func CreateDefaultTestMetrics() (*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 added in v3.6.0

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

func (*Metrics) ChangePodPhase added in v3.6.0

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

func (*Metrics) ChangeWorkflowPhase added in v3.6.0

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

func (*Metrics) CountWorkflowTemplate added in v3.6.0

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

func (*Metrics) CronWfPolicy added in v3.6.0

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

func (*Metrics) CronWfTrigger added in v3.6.0

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

func (*Metrics) CronWorkflowSpecError added in v3.2.0

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

func (*Metrics) CronWorkflowSubmissionError

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

func (*Metrics) CustomMetricExists added in v3.6.0

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

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

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 added in v3.6.0

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

func (*Metrics) PodMissingInc added in v3.6.0

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

func (*Metrics) RateLimiterWithBusyWorkers

func (m *Metrics) RateLimiterWithBusyWorkers(ctx context.Context, workQueue workqueue.RateLimiter, queueName string) workqueue.RateLimitingInterface

func (*Metrics) RecordWorkflowTemplateTime added in v3.6.0

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

func (*Metrics) StopRealtimeMetricsForWfUID added in v3.6.0

func (m *Metrics) StopRealtimeMetricsForWfUID(key string)

func (*Metrics) UpsertCustomMetric

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

type PodPhaseCallback added in v3.6.0

type PodPhaseCallback func() map[string]int64

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

type RealTimeValueFunc added in v3.6.0

type RealTimeValueFunc func() float64

type WorkflowConditionCallback added in v3.6.0

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

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

type WorkflowPhaseCallback added in v3.6.0

type WorkflowPhaseCallback func() 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