tektoncd/pipeline

feat(tracing): add spans for When Expression evaluation

開放

#9,782 建立於 2026年4月16日

 (2 則留言) (0 個反應) (1 位負責人)Go (1,943 個分叉)auto 404
good first issuekind/feature

倉庫指標

星標
 (9,013 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Feature request

Add OpenTelemetry spans to the When Expression evaluation path. CEL compilation/evaluation and Input/Operator/Values matching are currently invisible in traces, making it impossible to debug why tasks were skipped.

Use case

When a PipelineRun skips tasks due to When Expressions, the trace shows the parent reconcile span but gives no visibility into which expression evaluated to false or how long CEL compilation took.

Implementation hints

Key functions to instrument:

  1. pkg/reconciler/pipelinerun/pipelinerun.go:746EvaluateCEL() call for DAG tasks (inside loop)
  2. pkg/reconciler/pipelinerun/pipelinerun.go:965EvaluateCEL() call for finally tasks
  3. pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go:104EvaluateCEL() function itself — CEL env creation, compilation, evaluation
  4. pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go:488skipBecauseWhenExpressionsEvaluatedToFalse()
  5. pkg/apis/pipeline/v1/when_types.go:129AllowsExecution()

Span attributes to add: expression text, result (true/false), skip reason.

Parent spans exist: reconcile and runNextSchedulableTask are already spanned.

Part of umbrella: #9701

good first issue — focused scope, 2-3 functions, clear parent spans.

貢獻者指南