Skip to content

feat(tracing): record reconcile.write_outcome span attribute#10330

Open
thc1006 wants to merge 1 commit into
tektoncd:mainfrom
thc1006:feat/reconcile-write-outcome
Open

feat(tracing): record reconcile.write_outcome span attribute#10330
thc1006 wants to merge 1 commit into
tektoncd:mainfrom
thc1006:feat/reconcile-write-outcome

Conversation

@thc1006

@thc1006 thc1006 commented Jun 22, 2026

Copy link
Copy Markdown

Changes

Adds a reconcile.write_outcome attribute to the PipelineRun and TaskRun ReconcileKind spans, with one of three values: write (the object's labels/annotations were updated), status-only (only the status subresource changed), or no-op (nothing was written). This lets operators see how many reconciliations actually cost an etcd write versus being short-circuited.

The status write is decided by the generated reconciler after ReconcileKind returns, so the outcome is predicted inside ReconcileKind using the same equality.Semantic.DeepEqual comparison: the status and labels/annotations captured on entry are compared against their final values. The work is guarded by span.IsRecording(), so there is no cost when tracing is disabled. The classifier lives in pkg/reconciler and is shared by both reconcilers.

Implements deliverable 2 of #10322.

/kind feature

Release Notes

Add a `reconcile.write_outcome` attribute (write, status-only, no-op) to the PipelineRun and TaskRun reconcile spans so operators can see how many reconciliations write to etcd.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 22, 2026
@tekton-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign vdemeester after the PR has been reviewed.
You can assign the PR to them by writing /assign @vdemeester in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 22, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: thc1006 / name: thc1006 (9ec6031)

@tekton-robot tekton-robot requested review from abayer and twoGiants June 22, 2026 17:36
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 22, 2026
@thc1006 thc1006 force-pushed the feat/reconcile-write-outcome branch 2 times, most recently from 61228b2 to 5479e54 Compare June 22, 2026 18:20
Comment thread pkg/reconciler/pipelinerun/pipelinerun.go Outdated
Comment thread pkg/reconciler/taskrun/taskrun.go Outdated
@thc1006 thc1006 force-pushed the feat/reconcile-write-outcome branch from 5479e54 to 51bc08d Compare June 30, 2026 11:57
Add a reconcile.write_outcome attribute (write, status-only, no-op) to the
PipelineRun and TaskRun ReconcileKind spans so operators can see how many
reconciliations actually write to etcd versus being short-circuited.

The status write is decided by the generated reconciler after ReconcileKind
returns, so the outcome is computed inside ReconcileKind: the status and
labels/annotations are captured at the start, before initTracing (which can
persist span context into the status), and compared against their final values
with the same equality the framework uses. A shared RecordWriteOutcome helper
in pkg/reconciler does the comparison, which runs only when the span is
recording.

Implements deliverable 2 of tektoncd#10322.

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
@thc1006 thc1006 force-pushed the feat/reconcile-write-outcome branch from 51bc08d to 384c75b Compare June 30, 2026 12:30
@thc1006 thc1006 requested a review from waveywaves June 30, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants