metrics

package
v3.0.0-...-8a51905 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMetricsServerPort = 9090
	DefaultMetricsServerPath = "/metrics"
)

Variables

View Source
var K8sRequestTotalMetric = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: argoNamespace,
		Subsystem: workflowsSubsystem,
		Name:      "k8s_request_total",
		Help:      "Number of kubernetes requests executed. https://nholuongut.github.io/argo-workflows/metrics/#argo_workflows_k8s_request_total",
	},
	[]string{"kind", "verb", "status_code"},
)
View Source
var PodMissingMetric = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: argoNamespace,
		Name:      "pod_missing",
		Help:      "Incidents of pod missing. https://nholuongut.github.io/argo-workflows/metrics/#argo_pod_missing",
	},
	[]string{"recently_started", "node_phase"},
)
View Source
var WorkflowConditionMetric = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: argoNamespace,
		Subsystem: workflowsSubsystem,
		Name:      "workflow_condition",
		Help:      "Workflow condition. https://nholuongut.github.io/argo-workflows/metrics/#argo_workflows_workflow_condition",
	},
	[]string{"type", "status"},
)

Functions

func AddMetricsTransportWrapper

func AddMetricsTransportWrapper(config *rest.Config) *rest.Config

func ConstructOrUpdateMetric

func ConstructOrUpdateMetric(metric prometheus.Metric, metricSpec *wfv1.Prometheus) (prometheus.Metric, error)

func ConstructRealTimeGaugeMetric

func ConstructRealTimeGaugeMetric(metricSpec *wfv1.Prometheus, valueFunc func() float64) (prometheus.Metric, error)

func IsValidMetricName

func IsValidMetricName(name string) bool

func ValidateMetricLabels

func ValidateMetricLabels(metrics map[string]string) error

Types

type ErrorCause

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

type Metrics

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

func New

func New(metricsConfig, telemetryConfig ServerConfig) *Metrics

func (*Metrics) Collect

func (m *Metrics) Collect(ch chan<- prometheus.Metric)

func (*Metrics) CronWorkflowSpecError

func (m *Metrics) CronWorkflowSpecError()

func (*Metrics) CronWorkflowSubmissionError

func (m *Metrics) CronWorkflowSubmissionError()

func (*Metrics) Describe

func (m *Metrics) Describe(ch chan<- *prometheus.Desc)

func (*Metrics) Fire

func (m *Metrics) Fire(entry *log.Entry) error

func (*Metrics) GetCustomMetric

func (m *Metrics) GetCustomMetric(key string) prometheus.Metric

func (*Metrics) Levels

func (m *Metrics) Levels() []log.Level

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(durationSeconds float64)

func (*Metrics) OperationPanic

func (m *Metrics) OperationPanic()

func (*Metrics) RateLimiterWithBusyWorkers

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

func (*Metrics) RunServer

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

RunServer starts a metrics server

func (*Metrics) SetPodPhaseGauge

func (m *Metrics) SetPodPhaseGauge(phase corev1.PodPhase, num int)

func (*Metrics) SetWorkflowPhaseGauge

func (m *Metrics) SetWorkflowPhaseGauge(phase v1alpha1.NodePhase, num int)

func (*Metrics) StopRealtimeMetricsForKey

func (m *Metrics) StopRealtimeMetricsForKey(key string)

func (*Metrics) UpsertCustomMetric

func (m *Metrics) UpsertCustomMetric(key string, ownerKey string, newMetric prometheus.Metric, realtime bool) error

type RealTimeMetric

type RealTimeMetric struct {
	Func func() float64
}

type ServerConfig

type ServerConfig struct {
	Enabled      bool
	Path         string
	Port         int
	TTL          time.Duration
	IgnoreErrors bool
	Secure       bool
}

func (ServerConfig) SameServerAs

func (s ServerConfig) SameServerAs(other ServerConfig) bool

Jump to

Keyboard shortcuts

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