telemetry

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

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.

Code generated by util/telemetry/builder. DO NOT EDIT.

Index

Constants

View Source
const (
	AttribArtifactArchive     string = `archive`
	AttribArtifactPath        string = `path`
	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`
	AttribContainerName       string = `container_name`
	AttribCronWFName          string = `name`
	AttribCronWFNamespace     string = `namespace`
	AttribDeprecatedFeature   string = `feature`
	AttribErrorCause          string = `cause`
	AttribLockAcquired        string = `acquired`
	AttribLockName            string = `lock_name`
	AttribLockNamespace       string = `namespace`
	AttribLockStorage         string = `storage`
	AttribLockType            string = `type`
	AttribLogLevel            string = `level`
	AttribMessage             string = `message`
	AttribNodeID              string = `node_id`
	AttribNodePhase           string = `node_phase`
	AttribNodeType            string = `node_type`
	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`
	AttribTaskResultCompleted string = `completed`
	AttribTaskResultName      string = `name`
	AttribTemplateCluster     string = `cluster_scope`
	AttribTemplateName        string = `name`
	AttribTemplateNamespace   string = `namespace`
	AttribWorkerType          string = `worker_type`
	AttribWorkflowName        string = `name`
	AttribWorkflowNamespace   string = `namespace`
	AttribWorkflowPhase       string = `phase`
	AttribWorkflowStatus      string = `status`
	AttribWorkflowType        string = `type`
)
View Source
const (
	DefaultPrometheusServerPort = 9090
	DefaultPrometheusServerPath = "/metrics"
)
View Source
const (
	Float64ObservableGauge instrumentType = iota
	Float64Histogram
	Float64ObservableCounter
	Int64ObservableGauge
	Int64UpDownCounter
	Int64Counter
)
View Source
const TestScopeName string = "argo-workflows-test"

TestScopeName is the name that the metrics running under test will have

View Source
const TestTracingScopeName string = "argo-workflows-test"

TestTracingScopeName is the name that the tracing running under test will have

Variables

View Source
var InstrumentClientRateLimiterLatency = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentCronworkflowsConcurrencypolicyTriggered = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentCronworkflowsTriggeredTotal = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentDeprecatedFeature = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentErrorCount = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentGauge = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentIsLeader = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentK8sRequestDuration = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentK8sRequestTotal = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentLocksHeld = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentLocksPending = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentLocksTakenTotal = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentLogMessages = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentOperationDurationSeconds = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentPodMissing = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentPodPendingCount = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentPodRestartsTotal = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentPodsGauge = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentPodsTotalCount = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentQueueAddsCount = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentQueueDepthGauge = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentQueueDuration = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentQueueLatency = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentQueueLongestRunning = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentQueueRetries = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentQueueUnfinishedWork = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentResourceRateLimiterLatency = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentTotalCount = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentVersion = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentWorkersBusyCount = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentWorkflowCondition = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentWorkflowtemplateRuntime = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var InstrumentWorkflowtemplateTriggeredTotal = BuiltinInstrument{
	// contains filtered or unexported fields
}
View Source
var SpanArchiveArtifact = Span{
	// contains filtered or unexported fields
}
View Source
var SpanCaptureScriptResult = Span{
	// contains filtered or unexported fields
}
View Source
var SpanCreateTaskResult = Span{
	// contains filtered or unexported fields
}
View Source
var SpanCreateWorkflowPod = Span{
	// contains filtered or unexported fields
}
View Source
var SpanLoadArtifact = Span{
	// contains filtered or unexported fields
}
View Source
var SpanLoadArtifacts = Span{
	// contains filtered or unexported fields
}
View Source
var SpanNode = Span{
	// contains filtered or unexported fields
}
View Source
var SpanNodePhase = Span{
	// contains filtered or unexported fields
}
View Source
var SpanPatchTaskResult = Span{
	// contains filtered or unexported fields
}
View Source
var SpanPatchTaskResultLabels = Span{
	// contains filtered or unexported fields
}
View Source
var SpanPersistUpdates = Span{
	// contains filtered or unexported fields
}
View Source
var SpanPodReconciliation = Span{
	// contains filtered or unexported fields
}
View Source
var SpanProcessDataTemplate = Span{
	// contains filtered or unexported fields
}
View Source
var SpanReconcileTaskResult = Span{
	// contains filtered or unexported fields
}
View Source
var SpanReconcileTaskResults = Span{
	// contains filtered or unexported fields
}
View Source
var SpanReconcileWorkflow = Span{
	// contains filtered or unexported fields
}
View Source
var SpanRunInitContainer = Span{
	// contains filtered or unexported fields
}
View Source
var SpanRunMainContainer = Span{
	// contains filtered or unexported fields
}
View Source
var SpanRunSupervisorContainer = Span{
	// contains filtered or unexported fields
}
View Source
var SpanRunWaitContainer = Span{
	// contains filtered or unexported fields
}
View Source
var SpanSaveArtifact = Span{
	// contains filtered or unexported fields
}
View Source
var SpanSaveArtifacts = Span{
	// contains filtered or unexported fields
}
View Source
var SpanSaveContainerLogs = Span{
	// contains filtered or unexported fields
}
View Source
var SpanSaveLogs = Span{
	// contains filtered or unexported fields
}
View Source
var SpanStageFiles = Span{
	// contains filtered or unexported fields
}
View Source
var SpanStartupCacheSync = Span{
	// contains filtered or unexported fields
}
View Source
var SpanStartupController = Span{
	// contains filtered or unexported fields
}
View Source
var SpanTryAcquireLock = Span{
	// contains filtered or unexported fields
}
View Source
var SpanUnarchiveArtifact = Span{
	// contains filtered or unexported fields
}
View Source
var SpanWaitClientRateLimiter = Span{
	// contains filtered or unexported fields
}
View Source
var SpanWaitWorkload = Span{
	// contains filtered or unexported fields
}
View Source
var SpanWorkflow = Span{
	// contains filtered or unexported fields
}
View Source
var SpanWorkflowPhase = Span{
	// contains filtered or unexported fields
}

Functions

func AddDeprecationCounter

func AddDeprecationCounter(_ context.Context, m *Metrics) error

func AddVersion

func AddVersion(ctx context.Context, m *Metrics) error

Types

type AddMetric

type AddMetric func(context.Context, *Metrics) error

type Attribute added in v4.1.0

type Attribute struct {
	Name  string
	Value interface{}
}

type Attributes added in v4.1.0

type Attributes []Attribute

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 Carrier added in v4.1.0

type Carrier struct {
	// SetEnvFunc is a function that sets the environment variable.
	// Usually, you want to set the environment variable for processes
	// that are spawned by the current process.
	// By default implementation, it does nothing.
	// Using os.Setenv here is discouraged as the environment should
	// be immutable:
	// https://opentelemetry.io/docs/specs/otel/context/env-carriers/#environment-variable-immutability
	SetEnvFunc func(key, value string)
}

Carrier is a TextMapCarrier that uses the environment variables as a storage medium for propagated key-value pairs. The keys are uppercased before being used to access the environment variables. This is useful for propagating values that are set in the environment and need to be accessed by different processes or services. The keys are uppercased to avoid case sensitivity issues across different operating systems and environments.

func (Carrier) Get added in v4.1.0

func (Carrier) Get(key string) string

Get returns the value associated with the passed key. The key is uppercased before being used to access the environment variable.

func (Carrier) Keys added in v4.1.0

func (Carrier) Keys() []string

Keys lists the keys stored in this carrier. This returns all the keys in the environment variables.

func (Carrier) Set added in v4.1.0

func (e Carrier) Set(key, value string)

Set stores the key-value pair in the environment variable. The key is uppercased before being used to set the environment variable. If SetEnvFunc is not set, this method does nothing.

type DeprecatedFeatureMetricOption added in v4.1.0

type DeprecatedFeatureMetricOption func(*Attributes)

DeprecatedFeatureMetricOption is a functional option for configuring optional attributes on DeprecatedFeature

func WithWorkflowNamespace

func WithWorkflowNamespace(workflowNamespace string) DeprecatedFeatureMetricOption

WithWorkflowNamespace sets the namespace attribute

type InstAttrib

type InstAttrib struct {
	Name  string
	Value any
}

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 Attributes)

func (*Instrument) GetDescription

func (i *Instrument) GetDescription() string

func (*Instrument) GetName

func (i *Instrument) GetName() string

func (*Instrument) GetOtel

func (i *Instrument) GetOtel() any

func (*Instrument) GetUserdata

func (i *Instrument) GetUserdata() any

func (*Instrument) ObserveFloat

func (i *Instrument) ObserveFloat(ctx context.Context, o metric.Observer, val float64, attribs Attributes)

func (*Instrument) ObserveInt

func (i *Instrument) ObserveInt(ctx context.Context, o metric.Observer, val int64, attribs Attributes)

func (*Instrument) Record

func (i *Instrument) Record(ctx context.Context, val float64, attribs Attributes)

func (*Instrument) RegisterCallback

func (i *Instrument) RegisterCallback(m *Metrics, f metric.Callback) error

func (*Instrument) SetUserdata

func (i *Instrument) SetUserdata(data any)

type InstrumentOption added in v4.1.0

type InstrumentOption func(*instrumentOptions)

InstrumentOption is a functional option for configuring instruments.

func WithAsBuiltIn

func WithAsBuiltIn() InstrumentOption

func WithDefaultBuckets

func WithDefaultBuckets(buckets []float64) InstrumentOption

type Metrics

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

func NewMetrics

func NewMetrics(ctx context.Context, serviceName, prometheusName string, config *MetricsConfig, extraOpts ...metricsdk.Option) (*Metrics, error)

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 ...DeprecatedFeatureMetricOption)

AddDeprecatedFeature adds a value to the deprecated_feature counter

func (*Metrics) AddErrorCount

func (m *Metrics) AddErrorCount(ctx context.Context, val int64, errorCause string)

AddErrorCount adds a value to the error_count counter

func (*Metrics) AddInstrument

func (m *Metrics) AddInstrument(name string, inst *Instrument)

func (*Metrics) AddInt

func (m *Metrics) AddInt(ctx context.Context, name string, val int64, attribs Attributes)

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) AddLocksTakenTotal added in v4.1.0

func (m *Metrics) AddLocksTakenTotal(ctx context.Context, val int64, lockType string, lockStorage string, lockName string, lockNamespace string)

AddLocksTakenTotal adds a value to the locks_taken_total counter

func (*Metrics) AddLogMessages

func (m *Metrics) AddLogMessages(ctx context.Context, val int64, logLevel string)

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 ...PodRestartsTotalMetricOption)

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

func (m *Metrics) AddQueueAddsCount(ctx context.Context, val int64, queueName string)

AddQueueAddsCount adds a value to the queue_adds_count counter

func (*Metrics) AddQueueDepthGauge

func (m *Metrics) AddQueueDepthGauge(ctx context.Context, val int64, queueName string)

AddQueueDepthGauge adds a value to the queue_depth_gauge counter

func (*Metrics) AddQueueRetries

func (m *Metrics) AddQueueRetries(ctx context.Context, val int64, queueName string)

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

func (m *Metrics) AddWorkersBusyCount(ctx context.Context, val int64, workerType string)

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 (m *Metrics) CreateInstrument(instType instrumentType, name, desc, unit string, options ...InstrumentOption) error

func (*Metrics) DeprecatedFeature

func (m *Metrics) DeprecatedFeature(ctx context.Context, deprecation string, namespace string)

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

func (m *Metrics) ObserveIsLeader(ctx context.Context, o metric.Observer, val int64)

ObserveIsLeader observes a value for the is_leader gauge This is a helper method for use inside RegisterCallback functions

func (*Metrics) ObserveLocksHeld added in v4.1.0

func (m *Metrics) ObserveLocksHeld(ctx context.Context, o metric.Observer, val int64, lockType string, lockStorage string, lockName string, lockNamespace string)

ObserveLocksHeld observes a value for the locks_held gauge This is a helper method for use inside RegisterCallback functions

func (*Metrics) ObserveLocksPending added in v4.1.0

func (m *Metrics) ObserveLocksPending(ctx context.Context, o metric.Observer, val int64, lockType string, lockStorage string, lockName string, lockNamespace string)

ObserveLocksPending observes a value for the locks_pending 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) Populate

func (m *Metrics) Populate(ctx context.Context, adders ...AddMetric) error

func (*Metrics) Record

func (m *Metrics) Record(ctx context.Context, name string, val float64, attribs Attributes)

func (*Metrics) RecordClientRateLimiterLatency added in v4.1.0

func (m *Metrics) RecordClientRateLimiterLatency(ctx context.Context, val float64)

RecordClientRateLimiterLatency records a value to the client_rate_limiter_latency histogram

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

func (m *Metrics) RecordOperationDurationSeconds(ctx context.Context, val float64)

RecordOperationDurationSeconds records a value to the operation_duration_seconds histogram

func (*Metrics) RecordQueueDuration

func (m *Metrics) RecordQueueDuration(ctx context.Context, val float64, queueName string)

RecordQueueDuration records a value to the queue_duration histogram

func (*Metrics) RecordQueueLatency

func (m *Metrics) RecordQueueLatency(ctx context.Context, val float64, queueName string)

RecordQueueLatency records a value to the queue_latency histogram

func (*Metrics) RecordResourceRateLimiterLatency added in v4.1.0

func (m *Metrics) RecordResourceRateLimiterLatency(ctx context.Context, val float64)

RecordResourceRateLimiterLatency records a value to the resource_rate_limiter_latency histogram

func (*Metrics) RecordWorkflowtemplateRuntime

func (m *Metrics) RecordWorkflowtemplateRuntime(ctx context.Context, val float64, templateName string, templateNamespace string, templateCluster bool)

RecordWorkflowtemplateRuntime records a value to the workflowtemplate_runtime histogram

func (*Metrics) RunPrometheusServer

func (m *Metrics) RunPrometheusServer(ctx context.Context, isDummy bool)

RunPrometheusServer starts a prometheus metrics server If 'isDummy' is set to true, the dummy metrics server will be started. If it's false, the prometheus metrics server will be started

func (*Metrics) Shutdown added in v4.1.0

func (m *Metrics) Shutdown(ctx context.Context) error

Shutdown flushes any remaining metrics and shuts down the meter provider.

type MetricsConfig added in v4.1.0

type MetricsConfig struct {
	Enabled      bool
	Path         string
	Port         int
	TTL          time.Duration
	IgnoreErrors bool
	Secure       bool
	Modifiers    map[string]MetricsModifier
	Temporality  metricsdk.TemporalitySelector
}

type MetricsModifier added in v4.1.0

type MetricsModifier struct {
	Disabled           bool
	DisabledAttributes []string
	HistogramBuckets   []float64
}

MetricsModifier holds options to change the behaviour for a single metric

type NodePhaseSpanOption added in v4.1.0

type NodePhaseSpanOption func(*[]attribute.KeyValue)

NodePhaseSpanOption is a functional option for configuring optional attributes on NodePhase

func WithMessage added in v4.1.0

func WithMessage(message string) NodePhaseSpanOption

WithMessage sets the message attribute

type PodRestartsTotalMetricOption added in v4.1.0

type PodRestartsTotalMetricOption func(*Attributes)

PodRestartsTotalMetricOption is a functional option for configuring optional attributes on PodRestartsTotal

func WithPodRestartCondition

func WithPodRestartCondition(podRestartCondition string) PodRestartsTotalMetricOption

WithPodRestartCondition sets the condition attribute

type Span added in v4.1.0

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

func (*Span) AllDescendantNames added in v4.1.0

func (s *Span) AllDescendantNames() []string

AllDescendantNames returns all descendant span runtime names (depth-first).

func (*Span) Children added in v4.1.0

func (s *Span) Children() []*Span

Children returns the direct children of this span.

func (*Span) ExpectedChildren added in v4.1.0

func (s *Span) ExpectedChildren() []string

ExpectedChildren returns the runtime names of expected children.

func (*Span) FindDescendant added in v4.1.0

func (s *Span) FindDescendant(runtimeName string) *Span

FindDescendant searches recursively for a descendant span with the given runtime name. Returns nil if not found.

func (*Span) HasChild added in v4.1.0

func (s *Span) HasChild(runtimeName string) bool

HasChild returns true if this span has a child with the given runtime name.

func (*Span) RuntimeName added in v4.1.0

func (s *Span) RuntimeName() string

RuntimeName returns the span name as it appears at runtime (lowerCamelCase). This matches what's passed to tracer.Start() in the generated code.

type Spans added in v4.1.0

type Spans []*Span

func AllNoParentSpans added in v4.1.0

func AllNoParentSpans() Spans

type TestMetricsExporter

type TestMetricsExporter struct {
	metric.Reader
}

TestMetricsExporter 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

type TestTracingExporter added in v4.1.0

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

TestTracingExporter is an opentelemetry tracing exporter, purely for use within tests. It collects spans in-memory and provides methods to query them by name and attributes for the purposes of testing only. This is a public structure as it is used outside of this module also.

func NewTestTracingExporter added in v4.1.0

func NewTestTracingExporter() *TestTracingExporter

NewTestTracingExporter creates a new test tracing exporter

func (*TestTracingExporter) ExportSpans added in v4.1.0

func (t *TestTracingExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error

ExportSpans implements the SpanExporter interface, collecting spans in-memory

func (*TestTracingExporter) GetChildSpans added in v4.1.0

func (t *TestTracingExporter) GetChildSpans(parentSpanID trace.SpanID) []sdktrace.ReadOnlySpan

GetChildSpans returns all spans that have the given parent span ID

func (*TestTracingExporter) GetRootSpans added in v4.1.0

func (t *TestTracingExporter) GetRootSpans() []sdktrace.ReadOnlySpan

GetRootSpans returns all spans that have no parent (root spans)

func (*TestTracingExporter) GetSpanByName added in v4.1.0

func (t *TestTracingExporter) GetSpanByName(name string) (sdktrace.ReadOnlySpan, error)

GetSpanByName returns the first span matching the given name

func (*TestTracingExporter) GetSpanByNameAndAttributes added in v4.1.0

func (t *TestTracingExporter) GetSpanByNameAndAttributes(name string, attribs *attribute.Set) (sdktrace.ReadOnlySpan, error)

GetSpanByNameAndAttributes returns the first span matching the given name and attributes

func (*TestTracingExporter) GetSpans added in v4.1.0

func (t *TestTracingExporter) GetSpans() []sdktrace.ReadOnlySpan

GetSpans returns all collected spans

func (*TestTracingExporter) GetSpansByName added in v4.1.0

func (t *TestTracingExporter) GetSpansByName(name string) []sdktrace.ReadOnlySpan

GetSpansByName returns all spans matching the given name

func (*TestTracingExporter) Reset added in v4.1.0

func (t *TestTracingExporter) Reset()

Reset clears all collected spans, useful between test cases

func (*TestTracingExporter) Shutdown added in v4.1.0

func (t *TestTracingExporter) Shutdown(ctx context.Context) error

Shutdown implements the SpanExporter interface, no-op for tests

func (*TestTracingExporter) SpanCount added in v4.1.0

func (t *TestTracingExporter) SpanCount() int

SpanCount returns the number of collected spans

type Tracing added in v4.1.0

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

func NewTracing added in v4.1.0

func NewTracing(ctx context.Context, serviceName string, extraOpts ...tracesdk.TracerProviderOption) (*Tracing, error)

func (*Tracing) BreakTrace added in v4.1.0

func (*Tracing) BreakTrace(ctx context.Context) context.Context

BreakTrace completely removes the trace from the context The next span created will be a top level trace, it does not traverse up the span tree to the parent

func (*Tracing) Shutdown added in v4.1.0

func (t *Tracing) Shutdown(ctx context.Context) error

Shutdown flushes any remaining spans and shuts down the trace provider.

func (*Tracing) StartArchiveArtifact added in v4.1.0

func (t *Tracing) StartArchiveArtifact(ctx context.Context) (context.Context, trace.Span)

StartArchiveArtifact starts a archive_artifact span

func (*Tracing) StartCaptureScriptResult added in v4.1.0

func (t *Tracing) StartCaptureScriptResult(ctx context.Context) (context.Context, trace.Span)

StartCaptureScriptResult starts a capture_script_result span

func (*Tracing) StartCreateTaskResult added in v4.1.0

func (t *Tracing) StartCreateTaskResult(ctx context.Context) (context.Context, trace.Span)

StartCreateTaskResult starts a create_task_result span

func (*Tracing) StartCreateWorkflowPod added in v4.1.0

func (t *Tracing) StartCreateWorkflowPod(ctx context.Context, nodeID string) (context.Context, trace.Span)

StartCreateWorkflowPod starts a create_workflow_pod span

func (*Tracing) StartLoadArtifact added in v4.1.0

func (t *Tracing) StartLoadArtifact(ctx context.Context, artifactPath string) (context.Context, trace.Span)

StartLoadArtifact starts a load_artifact span

func (*Tracing) StartLoadArtifacts added in v4.1.0

func (t *Tracing) StartLoadArtifacts(ctx context.Context) (context.Context, trace.Span)

StartLoadArtifacts starts a load_artifacts span

func (*Tracing) StartNode added in v4.1.0

func (t *Tracing) StartNode(ctx context.Context, nodeID string, workflowName string, workflowNamespace string, nodeType string) (context.Context, trace.Span)

StartNode starts a node span

func (*Tracing) StartNodePhase added in v4.1.0

func (t *Tracing) StartNodePhase(ctx context.Context, nodeID string, nodePhase string, opts ...NodePhaseSpanOption) (context.Context, trace.Span)

StartNodePhase starts a node_phase span

func (*Tracing) StartPatchTaskResult added in v4.1.0

func (t *Tracing) StartPatchTaskResult(ctx context.Context) (context.Context, trace.Span)

StartPatchTaskResult starts a patch_task_result span

func (*Tracing) StartPatchTaskResultLabels added in v4.1.0

func (t *Tracing) StartPatchTaskResultLabels(ctx context.Context) (context.Context, trace.Span)

StartPatchTaskResultLabels starts a patch_task_result_labels span

func (*Tracing) StartPersistUpdates added in v4.1.0

func (t *Tracing) StartPersistUpdates(ctx context.Context) (context.Context, trace.Span)

StartPersistUpdates starts a persist_updates span

func (*Tracing) StartPodReconciliation added in v4.1.0

func (t *Tracing) StartPodReconciliation(ctx context.Context) (context.Context, trace.Span)

StartPodReconciliation starts a pod_reconciliation span

func (*Tracing) StartProcessDataTemplate added in v4.1.0

func (t *Tracing) StartProcessDataTemplate(ctx context.Context) (context.Context, trace.Span)

StartProcessDataTemplate starts a process_data_template span

func (*Tracing) StartReconcileTaskResult added in v4.1.0

func (t *Tracing) StartReconcileTaskResult(ctx context.Context, taskResultName string, taskResultCompleted bool) (context.Context, trace.Span)

StartReconcileTaskResult starts a reconcile_task_result span

func (*Tracing) StartReconcileTaskResults added in v4.1.0

func (t *Tracing) StartReconcileTaskResults(ctx context.Context) (context.Context, trace.Span)

StartReconcileTaskResults starts a reconcile_task_results span

func (*Tracing) StartReconcileWorkflow added in v4.1.0

func (t *Tracing) StartReconcileWorkflow(ctx context.Context) (context.Context, trace.Span)

StartReconcileWorkflow starts a reconcile_workflow span

func (*Tracing) StartRunInitContainer added in v4.1.0

func (t *Tracing) StartRunInitContainer(ctx context.Context, workflowName string, workflowNamespace string) (context.Context, trace.Span)

StartRunInitContainer starts a run_init_container span

func (*Tracing) StartRunMainContainer added in v4.1.0

func (t *Tracing) StartRunMainContainer(ctx context.Context, workflowName string, workflowNamespace string) (context.Context, trace.Span)

StartRunMainContainer starts a run_main_container span

func (*Tracing) StartRunSupervisorContainer added in v4.1.0

func (t *Tracing) StartRunSupervisorContainer(ctx context.Context, workflowName string, workflowNamespace string) (context.Context, trace.Span)

StartRunSupervisorContainer starts a run_supervisor_container span

func (*Tracing) StartRunWaitContainer added in v4.1.0

func (t *Tracing) StartRunWaitContainer(ctx context.Context, workflowName string, workflowNamespace string) (context.Context, trace.Span)

StartRunWaitContainer starts a run_wait_container span

func (*Tracing) StartSaveArtifact added in v4.1.0

func (t *Tracing) StartSaveArtifact(ctx context.Context) (context.Context, trace.Span)

StartSaveArtifact starts a save_artifact span

func (*Tracing) StartSaveArtifacts added in v4.1.0

func (t *Tracing) StartSaveArtifacts(ctx context.Context) (context.Context, trace.Span)

StartSaveArtifacts starts a save_artifacts span

func (*Tracing) StartSaveContainerLogs added in v4.1.0

func (t *Tracing) StartSaveContainerLogs(ctx context.Context, containerName string) (context.Context, trace.Span)

StartSaveContainerLogs starts a save_container_logs span

func (*Tracing) StartSaveLogs added in v4.1.0

func (t *Tracing) StartSaveLogs(ctx context.Context) (context.Context, trace.Span)

StartSaveLogs starts a save_logs span

func (*Tracing) StartStageFiles added in v4.1.0

func (t *Tracing) StartStageFiles(ctx context.Context) (context.Context, trace.Span)

StartStageFiles starts a stage_files span

func (*Tracing) StartStartupCacheSync added in v4.1.0

func (t *Tracing) StartStartupCacheSync(ctx context.Context) (context.Context, trace.Span)

StartStartupCacheSync starts a startup_cache_sync span

func (*Tracing) StartStartupController added in v4.1.0

func (t *Tracing) StartStartupController(ctx context.Context) (context.Context, trace.Span)

StartStartupController starts a startup_controller span

func (*Tracing) StartTryAcquireLock added in v4.1.0

func (t *Tracing) StartTryAcquireLock(ctx context.Context, lockName string, lockAcquired bool) (context.Context, trace.Span)

StartTryAcquireLock starts a try_acquire_lock span

func (*Tracing) StartUnarchiveArtifact added in v4.1.0

func (t *Tracing) StartUnarchiveArtifact(ctx context.Context, artifactArchive string) (context.Context, trace.Span)

StartUnarchiveArtifact starts a unarchive_artifact span

func (*Tracing) StartWaitClientRateLimiter added in v4.1.0

func (t *Tracing) StartWaitClientRateLimiter(ctx context.Context) (context.Context, trace.Span)

StartWaitClientRateLimiter starts a wait_client_rate_limiter span

func (*Tracing) StartWaitWorkload added in v4.1.0

func (t *Tracing) StartWaitWorkload(ctx context.Context) (context.Context, trace.Span)

StartWaitWorkload starts a wait_workload span

func (*Tracing) StartWorkflow added in v4.1.0

func (t *Tracing) StartWorkflow(ctx context.Context, workflowName string, workflowNamespace string) (context.Context, trace.Span)

StartWorkflow starts a workflow span

func (*Tracing) StartWorkflowPhase added in v4.1.0

func (t *Tracing) StartWorkflowPhase(ctx context.Context, workflowPhase string) (context.Context, trace.Span)

StartWorkflowPhase starts a workflow_phase span

type TracingConfig added in v4.1.0

type TracingConfig struct {
	Modifiers map[string]TracingModifier
}

type TracingModifier added in v4.1.0

type TracingModifier struct {
	Disabled           bool
	DisableChildren    bool
	DisabledAttributes []string
}

TracingModifier holds options to change the behaviour for a trace

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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