Documentation
¶
Overview ¶
Code generated by util/telemetry/builder. DO NOT EDIT.
Code generated by util/telemetry/builder. DO NOT EDIT.
Code generated by util/telemetry/builder. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func AddDeprecationCounter(_ context.Context, m *Metrics) error
- func AddVersion(ctx context.Context, m *Metrics) error
- func WithAsBuiltIn() instrumentOption
- func WithDefaultBuckets(buckets []float64) instrumentOption
- type AddMetric
- type BuiltinAttribute
- type BuiltinInstrument
- type Config
- type DeprecatedFeatureOption
- type InstAttrib
- type InstAttribs
- type Instrument
- func (i *Instrument) AddInt(ctx context.Context, val int64, attribs InstAttribs)
- func (i *Instrument) GetDescription() string
- func (i *Instrument) GetName() string
- func (i *Instrument) GetOtel() interface{}
- func (i *Instrument) GetUserdata() interface{}
- func (i *Instrument) ObserveFloat(ctx context.Context, o metric.Observer, val float64, attribs InstAttribs)
- func (i *Instrument) ObserveInt(ctx context.Context, o metric.Observer, val int64, attribs InstAttribs)
- func (i *Instrument) Record(ctx context.Context, val float64, attribs InstAttribs)
- func (i *Instrument) RegisterCallback(m *Metrics, f metric.Callback) error
- func (i *Instrument) SetUserdata(data interface{})
- type Metrics
- func (m *Metrics) AddCronworkflowsConcurrencypolicyTriggered(ctx context.Context, val int64, cronWFName string, cronWFNamespace string, ...)
- func (m *Metrics) AddCronworkflowsTriggeredTotal(ctx context.Context, val int64, cronWFName string, cronWFNamespace string)
- func (m *Metrics) AddDeprecatedFeature(ctx context.Context, val int64, deprecatedFeature string, ...)
- func (m *Metrics) AddErrorCount(ctx context.Context, val int64, errorCause string)
- func (m *Metrics) AddInstrument(name string, inst *Instrument)
- func (m *Metrics) AddInt(ctx context.Context, name string, val int64, attribs InstAttribs)
- func (m *Metrics) AddK8sRequestTotal(ctx context.Context, val int64, requestKind string, requestVerb string, ...)
- func (m *Metrics) AddLogMessages(ctx context.Context, val int64, logLevel string)
- func (m *Metrics) AddPodMissing(ctx context.Context, val int64, nodePhase string, recentlyStarted bool)
- func (m *Metrics) AddPodPendingCount(ctx context.Context, val int64, podPendingReason string, podNamespace string)
- func (m *Metrics) AddPodRestartsTotal(ctx context.Context, val int64, podRestartReason string, podNamespace string, ...)
- func (m *Metrics) AddPodsTotalCount(ctx context.Context, val int64, podPhase string, podNamespace string)
- func (m *Metrics) AddQueueAddsCount(ctx context.Context, val int64, queueName string)
- func (m *Metrics) AddQueueDepthGauge(ctx context.Context, val int64, queueName string)
- func (m *Metrics) AddQueueRetries(ctx context.Context, val int64, queueName string)
- func (m *Metrics) AddTotalCount(ctx context.Context, val int64, workflowPhase string, workflowNamespace string)
- func (m *Metrics) AddVersion(ctx context.Context, val int64, buildVersion string, buildPlatform string, ...)
- func (m *Metrics) AddWorkersBusyCount(ctx context.Context, val int64, workerType string)
- func (m *Metrics) AddWorkflowtemplateTriggeredTotal(ctx context.Context, val int64, templateName string, templateNamespace string, ...)
- func (m *Metrics) CreateBuiltinInstrument(instrument BuiltinInstrument, opts ...instrumentOption) error
- func (m *Metrics) CreateInstrument(instType instrumentType, name, desc, unit string, options ...instrumentOption) error
- func (m *Metrics) DeprecatedFeature(ctx context.Context, deprecation string, namespace string)
- func (m *Metrics) GetInstrument(name string) *Instrument
- func (m *Metrics) IterateROInstruments(fn func(i *Instrument))
- func (m *Metrics) ObserveGauge(ctx context.Context, o metric.Observer, val int64, workflowPhase string)
- func (m *Metrics) ObserveIsLeader(ctx context.Context, o metric.Observer, val int64)
- func (m *Metrics) ObservePodsGauge(ctx context.Context, o metric.Observer, val int64, podPhase string)
- func (m *Metrics) ObserveQueueLongestRunning(ctx context.Context, o metric.Observer, val float64, queueName string)
- func (m *Metrics) ObserveQueueUnfinishedWork(ctx context.Context, o metric.Observer, val float64, queueName string)
- func (m *Metrics) ObserveWorkflowCondition(ctx context.Context, o metric.Observer, val int64, workflowType string, ...)
- func (m *Metrics) Populate(ctx context.Context, adders ...AddMetric) error
- func (m *Metrics) Record(ctx context.Context, name string, val float64, attribs InstAttribs)
- func (m *Metrics) RecordK8sRequestDuration(ctx context.Context, val float64, requestKind string, requestVerb string, ...)
- func (m *Metrics) RecordOperationDurationSeconds(ctx context.Context, val float64)
- func (m *Metrics) RecordQueueDuration(ctx context.Context, val float64, queueName string)
- func (m *Metrics) RecordQueueLatency(ctx context.Context, val float64, queueName string)
- func (m *Metrics) RecordWorkflowtemplateRuntime(ctx context.Context, val float64, templateName string, ...)
- func (m *Metrics) RunPrometheusServer(ctx context.Context, isDummy bool)
- type Modifier
- type PodRestartsTotalOption
- type TestMetricsExporter
- func (t *TestMetricsExporter) GetFloat64CounterValue(ctx context.Context, name string, attribs *attribute.Set) (float64, error)
- func (t *TestMetricsExporter) GetFloat64GaugeValue(ctx context.Context, name string, attribs *attribute.Set) (float64, error)
- func (t *TestMetricsExporter) GetFloat64HistogramData(ctx context.Context, name string, attribs *attribute.Set) (*metricdata.HistogramDataPoint[float64], error)
- func (t *TestMetricsExporter) GetInt64CounterValue(ctx context.Context, name string, attribs *attribute.Set) (int64, error)
- func (t *TestMetricsExporter) GetInt64GaugeValue(ctx context.Context, name string, attribs *attribute.Set) (int64, error)
Constants ¶
const ( AttribBuildCompiler string = `compiler` AttribBuildDate string = `build_date` AttribBuildGitCommit string = `git_commit` AttribBuildGitTag string = `git_tag` AttribBuildGitTreeState string = `git_tree_state` AttribBuildGoVersion string = `go_version` AttribBuildPlatform string = `platform` AttribBuildVersion string = `version` AttribConcurrencyPolicy string = `concurrency_policy` AttribCronWFName string = `name` AttribCronWFNamespace string = `namespace` AttribDeprecatedFeature string = `feature` AttribErrorCause string = `cause` AttribLogLevel string = `level` AttribNodePhase string = `node_phase` AttribPodNamespace string = `namespace` AttribPodPendingReason string = `reason` AttribPodPhase string = `phase` AttribPodRestartCondition string = `condition` AttribPodRestartReason string = `reason` AttribQueueName string = `queue_name` AttribRecentlyStarted string = `recently_started` AttribRequestCode string = `status_code` AttribRequestKind string = `kind` AttribRequestVerb string = `verb` AttribTemplateCluster string = `cluster_scope` AttribTemplateName string = `name` AttribTemplateNamespace string = `namespace` AttribWorkerType string = `worker_type` AttribWorkflowNamespace string = `namespace` AttribWorkflowPhase string = `phase` AttribWorkflowStatus string = `status` AttribWorkflowType string = `type` )
const ( DefaultPrometheusServerPort = 9090 DefaultPrometheusServerPath = "/metrics" )
const ( Float64ObservableGauge instrumentType = iota Float64Histogram Float64ObservableCounter Int64ObservableGauge Int64UpDownCounter Int64Counter )
const TestScopeName string = "argo-workflows-test"
TestScopeName is the name that the metrics running under test will have
Variables ¶
var InstrumentCronworkflowsConcurrencypolicyTriggered = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentCronworkflowsTriggeredTotal = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentDeprecatedFeature = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentErrorCount = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentGauge = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentIsLeader = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentK8sRequestDuration = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentK8sRequestTotal = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentLogMessages = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentOperationDurationSeconds = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentPodMissing = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentPodPendingCount = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentPodRestartsTotal = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentPodsGauge = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentPodsTotalCount = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentQueueAddsCount = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentQueueDepthGauge = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentQueueDuration = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentQueueLatency = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentQueueLongestRunning = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentQueueRetries = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentQueueUnfinishedWork = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentTotalCount = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentVersion = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentWorkersBusyCount = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentWorkflowCondition = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentWorkflowtemplateRuntime = BuiltinInstrument{ // contains filtered or unexported fields }
var InstrumentWorkflowtemplateTriggeredTotal = BuiltinInstrument{ // contains filtered or unexported fields }
Functions ¶
func WithAsBuiltIn ¶
func WithAsBuiltIn() instrumentOption
func WithDefaultBuckets ¶
func WithDefaultBuckets(buckets []float64) instrumentOption
Types ¶
type BuiltinAttribute ¶
type BuiltinAttribute struct {
// contains filtered or unexported fields
}
type BuiltinInstrument ¶
type BuiltinInstrument struct {
// contains filtered or unexported fields
}
func (*BuiltinInstrument) Name ¶
func (bi *BuiltinInstrument) Name() string
type DeprecatedFeatureOption ¶
type DeprecatedFeatureOption func(*InstAttribs)
DeprecatedFeatureOption is a functional option for configuring optional attributes on DeprecatedFeature
func WithWorkflowNamespace ¶
func WithWorkflowNamespace(workflowNamespace string) DeprecatedFeatureOption
WithWorkflowNamespace sets the namespace attribute
type InstAttrib ¶
type InstAttrib struct {
Name string
Value interface{}
}
type InstAttribs ¶
type InstAttribs []InstAttrib
type Instrument ¶
type Instrument struct {
// contains filtered or unexported fields
}
func (*Instrument) AddInt ¶
func (i *Instrument) AddInt(ctx context.Context, val int64, attribs InstAttribs)
func (*Instrument) GetDescription ¶
func (i *Instrument) GetDescription() string
func (*Instrument) GetName ¶
func (i *Instrument) GetName() string
func (*Instrument) GetOtel ¶
func (i *Instrument) GetOtel() interface{}
func (*Instrument) GetUserdata ¶
func (i *Instrument) GetUserdata() interface{}
func (*Instrument) ObserveFloat ¶
func (i *Instrument) ObserveFloat(ctx context.Context, o metric.Observer, val float64, attribs InstAttribs)
func (*Instrument) ObserveInt ¶
func (i *Instrument) ObserveInt(ctx context.Context, o metric.Observer, val int64, attribs InstAttribs)
func (*Instrument) Record ¶
func (i *Instrument) Record(ctx context.Context, val float64, attribs InstAttribs)
func (*Instrument) RegisterCallback ¶
func (i *Instrument) RegisterCallback(m *Metrics, f metric.Callback) error
func (*Instrument) SetUserdata ¶
func (i *Instrument) SetUserdata(data interface{})
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func (*Metrics) AddCronworkflowsConcurrencypolicyTriggered ¶
func (m *Metrics) AddCronworkflowsConcurrencypolicyTriggered(ctx context.Context, val int64, cronWFName string, cronWFNamespace string, concurrencyPolicy string)
AddCronworkflowsConcurrencypolicyTriggered adds a value to the cronworkflows_concurrencypolicy_triggered counter
func (*Metrics) AddCronworkflowsTriggeredTotal ¶
func (m *Metrics) AddCronworkflowsTriggeredTotal(ctx context.Context, val int64, cronWFName string, cronWFNamespace string)
AddCronworkflowsTriggeredTotal adds a value to the cronworkflows_triggered_total counter
func (*Metrics) AddDeprecatedFeature ¶
func (m *Metrics) AddDeprecatedFeature(ctx context.Context, val int64, deprecatedFeature string, opts ...DeprecatedFeatureOption)
AddDeprecatedFeature adds a value to the deprecated_feature counter
func (*Metrics) AddErrorCount ¶
AddErrorCount adds a value to the error_count counter
func (*Metrics) AddInstrument ¶
func (m *Metrics) AddInstrument(name string, inst *Instrument)
func (*Metrics) AddK8sRequestTotal ¶
func (m *Metrics) AddK8sRequestTotal(ctx context.Context, val int64, requestKind string, requestVerb string, requestCode int)
AddK8sRequestTotal adds a value to the k8s_request_total counter
func (*Metrics) AddLogMessages ¶
AddLogMessages adds a value to the log_messages counter
func (*Metrics) AddPodMissing ¶
func (m *Metrics) AddPodMissing(ctx context.Context, val int64, nodePhase string, recentlyStarted bool)
AddPodMissing adds a value to the pod_missing counter
func (*Metrics) AddPodPendingCount ¶
func (m *Metrics) AddPodPendingCount(ctx context.Context, val int64, podPendingReason string, podNamespace string)
AddPodPendingCount adds a value to the pod_pending_count counter
func (*Metrics) AddPodRestartsTotal ¶
func (m *Metrics) AddPodRestartsTotal(ctx context.Context, val int64, podRestartReason string, podNamespace string, opts ...PodRestartsTotalOption)
AddPodRestartsTotal adds a value to the pod_restarts_total counter
func (*Metrics) AddPodsTotalCount ¶
func (m *Metrics) AddPodsTotalCount(ctx context.Context, val int64, podPhase string, podNamespace string)
AddPodsTotalCount adds a value to the pods_total_count counter
func (*Metrics) AddQueueAddsCount ¶
AddQueueAddsCount adds a value to the queue_adds_count counter
func (*Metrics) AddQueueDepthGauge ¶
AddQueueDepthGauge adds a value to the queue_depth_gauge counter
func (*Metrics) AddQueueRetries ¶
AddQueueRetries adds a value to the queue_retries counter
func (*Metrics) AddTotalCount ¶
func (m *Metrics) AddTotalCount(ctx context.Context, val int64, workflowPhase string, workflowNamespace string)
AddTotalCount adds a value to the total_count counter
func (*Metrics) AddVersion ¶
func (m *Metrics) AddVersion(ctx context.Context, val int64, buildVersion string, buildPlatform string, buildGoVersion string, buildDate string, buildCompiler string, buildGitCommit string, buildGitTreeState string, buildGitTag string)
AddVersion adds a value to the version counter
func (*Metrics) AddWorkersBusyCount ¶
AddWorkersBusyCount adds a value to the workers_busy_count counter
func (*Metrics) AddWorkflowtemplateTriggeredTotal ¶
func (m *Metrics) AddWorkflowtemplateTriggeredTotal(ctx context.Context, val int64, templateName string, templateNamespace string, templateCluster bool, workflowPhase string)
AddWorkflowtemplateTriggeredTotal adds a value to the workflowtemplate_triggered_total counter
func (*Metrics) CreateBuiltinInstrument ¶
func (m *Metrics) CreateBuiltinInstrument(instrument BuiltinInstrument, opts ...instrumentOption) error
CreateBuiltinInstrument adds a yaml defined builtin instrument opts parameter is for legacy metrics, do not use for new metrics
func (*Metrics) CreateInstrument ¶
func (*Metrics) DeprecatedFeature ¶
func (*Metrics) GetInstrument ¶
func (m *Metrics) GetInstrument(name string) *Instrument
func (*Metrics) IterateROInstruments ¶
func (m *Metrics) IterateROInstruments(fn func(i *Instrument))
IterateROInstruments iterates over every instrument for Read-Only purposes
func (*Metrics) ObserveGauge ¶
func (m *Metrics) ObserveGauge(ctx context.Context, o metric.Observer, val int64, workflowPhase string)
ObserveGauge observes a value for the gauge gauge This is a helper method for use inside RegisterCallback functions
func (*Metrics) ObserveIsLeader ¶
ObserveIsLeader observes a value for the is_leader gauge This is a helper method for use inside RegisterCallback functions
func (*Metrics) ObservePodsGauge ¶
func (m *Metrics) ObservePodsGauge(ctx context.Context, o metric.Observer, val int64, podPhase string)
ObservePodsGauge observes a value for the pods_gauge gauge This is a helper method for use inside RegisterCallback functions
func (*Metrics) ObserveQueueLongestRunning ¶
func (m *Metrics) ObserveQueueLongestRunning(ctx context.Context, o metric.Observer, val float64, queueName string)
ObserveQueueLongestRunning observes a value for the queue_longest_running gauge This is a helper method for use inside RegisterCallback functions
func (*Metrics) ObserveQueueUnfinishedWork ¶
func (m *Metrics) ObserveQueueUnfinishedWork(ctx context.Context, o metric.Observer, val float64, queueName string)
ObserveQueueUnfinishedWork observes a value for the queue_unfinished_work gauge This is a helper method for use inside RegisterCallback functions
func (*Metrics) ObserveWorkflowCondition ¶
func (m *Metrics) ObserveWorkflowCondition(ctx context.Context, o metric.Observer, val int64, workflowType string, workflowStatus string)
ObserveWorkflowCondition observes a value for the workflow_condition gauge This is a helper method for use inside RegisterCallback functions
func (*Metrics) RecordK8sRequestDuration ¶
func (m *Metrics) RecordK8sRequestDuration(ctx context.Context, val float64, requestKind string, requestVerb string, requestCode int)
RecordK8sRequestDuration records a value to the k8s_request_duration histogram
func (*Metrics) RecordOperationDurationSeconds ¶
RecordOperationDurationSeconds records a value to the operation_duration_seconds histogram
func (*Metrics) RecordQueueDuration ¶
RecordQueueDuration records a value to the queue_duration histogram
func (*Metrics) RecordQueueLatency ¶
RecordQueueLatency records a value to the queue_latency histogram
type PodRestartsTotalOption ¶
type PodRestartsTotalOption func(*InstAttribs)
PodRestartsTotalOption is a functional option for configuring optional attributes on PodRestartsTotal
func WithPodRestartCondition ¶
func WithPodRestartCondition(podRestartCondition string) PodRestartsTotalOption
WithPodRestartCondition sets the condition attribute
type TestMetricsExporter ¶
TestExporter is an opentelemetry metrics exporter, purely for use within tests. It is not possible to query the values of an instrument via the otel SDK, so this exporter provides methods by which you can request metrics by name+attributes and therefore inspect whether they exist, and their values for the purposes of testing only. This is a public structure as it is used outside of this module also.
func NewTestMetricsExporter ¶
func NewTestMetricsExporter() *TestMetricsExporter
func (*TestMetricsExporter) GetFloat64CounterValue ¶
func (t *TestMetricsExporter) GetFloat64CounterValue(ctx context.Context, name string, attribs *attribute.Set) (float64, error)
GetFloat64CounterValue returns an otel float64 counter value for test reads
func (*TestMetricsExporter) GetFloat64GaugeValue ¶
func (t *TestMetricsExporter) GetFloat64GaugeValue(ctx context.Context, name string, attribs *attribute.Set) (float64, error)
GetFloat64GaugeValue returns an otel float64 gauge value for test reads
func (*TestMetricsExporter) GetFloat64HistogramData ¶
func (t *TestMetricsExporter) GetFloat64HistogramData(ctx context.Context, name string, attribs *attribute.Set) (*metricdata.HistogramDataPoint[float64], error)
GetFloat64HistogramData returns an otel histogram float64 data point for test reads
func (*TestMetricsExporter) GetInt64CounterValue ¶
func (t *TestMetricsExporter) GetInt64CounterValue(ctx context.Context, name string, attribs *attribute.Set) (int64, error)
GetInt64CounterValue returns an otel int64 counter value for test reads
func (*TestMetricsExporter) GetInt64GaugeValue ¶
func (t *TestMetricsExporter) GetInt64GaugeValue(ctx context.Context, name string, attribs *attribute.Set) (int64, error)
GetInt64GaugeValue returns an otel int64 gauge value for test reads