feat(tracing): record reconcile.write_outcome span attribute#10330
Open
thc1006 wants to merge 1 commit into
Open
feat(tracing): record reconcile.write_outcome span attribute#10330thc1006 wants to merge 1 commit into
thc1006 wants to merge 1 commit into
Conversation
Collaborator
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
61228b2 to
5479e54
Compare
waveywaves
reviewed
Jun 30, 2026
waveywaves
reviewed
Jun 30, 2026
5479e54 to
51bc08d
Compare
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>
51bc08d to
384c75b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Adds a
reconcile.write_outcomeattribute to the PipelineRun and TaskRunReconcileKindspans, with one of three values:write(the object's labels/annotations were updated),status-only(only the status subresource changed), orno-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
ReconcileKindreturns, so the outcome is predicted insideReconcileKindusing the sameequality.Semantic.DeepEqualcomparison: the status and labels/annotations captured on entry are compared against their final values. The work is guarded byspan.IsRecording(), so there is no cost when tracing is disabled. The classifier lives inpkg/reconcilerand is shared by both reconcilers.Implements deliverable 2 of #10322.
/kind feature
Release Notes