tektoncd/pipeline

feat(tracing): add spans to timeout and cancellation code paths

Aberta

#9.783 aberto em 16 de abr. de 2026

 (2 comentários) (0 reação) (0 responsável)Go (1.943 forks)auto 404
good first issuekind/feature

Métricas do repositório

Stars
 (9.013 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Feature request

Add OpenTelemetry spans to the PipelineRun cancellation and timeout helpers. These code paths have zero tracing, making it impossible to trace why a run was stopped or how long child-patching took.

Use case

When a PipelineRun times out, the trace ends abruptly. Adding spans to the cancel/timeout functions reveals: which children were patched, how long each patch took, and whether graceful cancellation triggered finally tasks.

Implementation hints

PipelineRun — pkg/reconciler/pipelinerun/cancel.go:

  • cancelPipelineRun — marks PR cancelled, patches all children
  • gracefullyCancelPipelineRun — cancels tasks but triggers finally
  • cancelPipelineTaskRunsForTaskNames — iterates children, patches each
  • cancelTaskRun / cancelCustomRun — individual child patches

PipelineRun — pkg/reconciler/pipelinerun/timeout.go:

  • timeoutPipelineRun — marks PR timed out, patches all children
  • timeoutPipelineTasksForTaskNames — iterates children, patches each
  • timeoutTaskRun / timeoutCustomRun — individual child patches

TaskRun — pkg/reconciler/taskrun/taskrun.go:

  • Line 185: IsCancelled() branch — add span attribute reason=Cancelled
  • Line 199: HasTimedOut() branch — add span attribute reason=TimedOut

Part of umbrella: #9701

good first issue — well-scoped files (cancel.go + timeout.go), clear functions.

Guia do colaborador