-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics: pipelinerun_count is not correct #2848
Metrics: pipelinerun_count is not correct #2848
Conversation
In scenario: `PipelineResult` is not null, the Metrics: pipelinerun_count will not correct.
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR cannot be merged: expecting exactly one kind/ label Available
|
1 similar comment
This PR cannot be merged: expecting exactly one kind/ label Available
|
The following is the coverage report on the affected files.
|
/kind bug |
/cc @afrittoli @mattmoor |
/test pull-tekton-pipeline-integration-tests |
/cc @hrishin |
@vincent-pli thank you for the fix! Although in this case count and duration may need additional care. Like not to repeat the count and consolidate duration. |
} | ||
}(c.metrics) | ||
|
||
if equality.Semantic.DeepEqual(original.Status, pr.Status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is enough to prevent false metrics from being reported.
Not knowing much about opencensus, my expectation reading this code is that DurationAndCount
was idempotent, and it would take care of not submitting twice.
Now, if the controller is restarted for instance, all metrics will be submitted again.
A way to solve this could perhaps be to write metrics where the completion time is set?
@hrishin thanks for comments, that's great if we can prevent repeat in
@afrittoli About "controller restart", I think that's ok, all the metrics will be report again but with different time series. |
@vincent-pli @afrittoli, yes this fix looks promising. Just wonders how metrics aggregators behave in case of deployment restarts? We shall test this? |
@hrishin
All the metric list above will be recover just one thing: the |
I meant to submit the metric in a different place in the code, when the completion time is set, which happens only once, regardless of further reconciles or restarts. Could we add test coverage for this? |
@afrittoli pipeline/pkg/reconciler/pipelinerun/pipelinerun.go Lines 465 to 466 in 08ac72c
|
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Part fix issue: #2844
In scenario:
PipelineResult
is not null, the Metrics:pipelinerun_count
will not correct.The root cause is that:
pipeline/pkg/reconciler/pipelinerun/pipelinerun.go
Lines 149 to 154 in 4fb1078
The
updatePipelineResults(ctx, pr)
will updatepr.Status.PipelineResults
if needed, this will make theknative/pkg
update thePipelinerun.Status
andreconcile
will be trigger again.So the
pipelinerun_count
will count again.Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.