Help us shape the future of Go! Take the 2026 Go Developer Survey

taskrunmetrics

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPartOfPipeline added in v0.40.0

func IsPartOfPipeline(tr *v1.TaskRun) (bool, string, string)

IsPartOfPipeline return true if TaskRun is a part of a Pipeline. It also return the name of Pipeline and PipelineRun

func OnStore added in v0.62.2

func OnStore(logger *zap.SugaredLogger, recorder *Recorder) func(name string, value interface{})

OnStore returns a function that can be passed to a configmap watcher for dynamic updates

func WithClient

func WithClient(ctx context.Context) context.Context

WithClient adds a metrics recorder to the given context

func WithInformer

func WithInformer(ctx context.Context) (context.Context, controller.Informer)

WithInformer returns the given context, and a configured informer

Types

type InformerKey

type InformerKey struct{}

InformerKey is used for associating the Informer inside the context.Context.

type Recorder

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

Recorder holds OpenTelemetry instruments for TaskRun metrics

func Get

func Get(ctx context.Context) *Recorder

Get extracts the taskrunmetrics.Recorder from the context.

func NewRecorder

func NewRecorder(ctx context.Context) (*Recorder, error)

NewRecorder creates a new OpenTelemetry-based metrics recorder instance

func (*Recorder) DurationAndCount

func (r *Recorder) DurationAndCount(ctx context.Context, tr *v1.TaskRun, beforeCondition *apis.Condition) error

DurationAndCount logs the duration of TaskRun execution and count for number of TaskRuns succeed or failed

func (*Recorder) RecordPodLatency

func (r *Recorder) RecordPodLatency(ctx context.Context, pod *corev1.Pod, tr *v1.TaskRun) error

RecordPodLatency logs the duration required to schedule the pod for TaskRun

func (*Recorder) ReportRunningTaskRuns

func (r *Recorder) ReportRunningTaskRuns(ctx context.Context, lister listers.TaskRunLister)

ReportRunningTaskRuns invokes observeRunningTaskRuns on our configured PeriodSeconds until the context is cancelled.

type RecorderKey

type RecorderKey struct{}

RecorderKey is used for associating the Recorder inside the context.Context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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