Skip to content
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

feat: add ability to include reason in count metrics #7060

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

AverageMarcus
Copy link
Contributor

@AverageMarcus AverageMarcus commented Aug 22, 2023

Changes

Fixes #7059

Introduces the ability to include a reason label along with the current status label on the PipelineRun and TaskRun count metrics.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Add ability to include `reason` along with `status` in TaskRun and PipelineRun count metrics

/kind feature

@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 Aug 22, 2023
@tekton-robot
Copy link
Collaborator

Hi @AverageMarcus. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@tekton-robot tekton-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 68.4% -2.2
pkg/taskrunmetrics/metrics.go 83.0% 82.9% -0.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/taskrunmetrics/metrics.go 83.0% 82.9% -0.1

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2023
@AverageMarcus
Copy link
Contributor Author

/test pull-tekton-pipeline-go-coverage-df

@tekton-robot
Copy link
Collaborator

@AverageMarcus: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-tekton-pipeline-go-coverage-df

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.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 80.0% 81.0% 1.0
pkg/taskrunmetrics/metrics.go 83.0% 83.6% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 80.0% 81.0% 1.0
pkg/taskrunmetrics/metrics.go 83.0% 83.6% 0.6

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 22, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 80.0% 81.0% 1.0
pkg/taskrunmetrics/metrics.go 83.0% 83.6% 0.6

@khrm
Copy link
Contributor

khrm commented Aug 22, 2023

/test tekton-pipeline-unit-tests

@AverageMarcus
Copy link
Contributor Author

Sorry, looks like I left in a small typo. 🤦 Updated now.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 80.0% 81.0% 1.0
pkg/taskrunmetrics/metrics.go 83.0% 83.6% 0.6

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 80.0% 81.0% 1.0
pkg/taskrunmetrics/metrics.go 83.0% 83.6% 0.6

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@AverageMarcus
Copy link
Contributor Author

/assign @dibyom

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 15, 2023
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 15, 2023
@AverageMarcus
Copy link
Contributor Author

Rebased! ✅

Is anyone available for a review?

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/taskrunmetrics/metrics.go 83.4% 84.0% 0.5

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/taskrunmetrics/metrics.go 83.4% 84.0% 0.5

@jerop jerop added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2023
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 21, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 82.1% 82.9% 0.8
pkg/taskrunmetrics/metrics.go 83.4% 84.0% 0.5

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 82.1% 82.9% 0.8
pkg/taskrunmetrics/metrics.go 83.4% 84.0% 0.5

@dibyom
Copy link
Member

dibyom commented Oct 2, 2023

@AverageMarcus thanks for the PR (and sorry for the delay in reviewing) - I think this looks good and only have some naming nitpicks.

@vdemeester @khrm what do you think?

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dibyom Yes, this looks good to me.

@AverageMarcus
Copy link
Contributor Author

only have some naming nitpicks.

I don't see any other comments. Do you still have them as pending or something gone wrong with GitHub?

docs/metrics.md Outdated
@@ -40,6 +40,7 @@ A sample config-map has been provided as [config-observability](./../config/conf
metrics.taskrun.duration-type: "histogram"
metrics.pipelinerun.level: "pipeline"
metrics.pipelinerun.duration-type: "histogram"
metrics.count.reason: "false"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe metrics.count.enable-reason to be more explicit that this is for enabling this vs something else

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! 👍 Updated.

@dibyom
Copy link
Member

dibyom commented Oct 5, 2023

I don't see any other comments. Do you still have them as pending or something gone wrong with GitHub?

yup, was pending 🤦

Adds a configuration flag to enable including the `reason` for a TaskRun or PipelineRun status on their count metrics. This allows for more fine-grained monitoring and alerting of run failures.

Signed-off-by: Marcus Noble <[email protected]>
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 82.1% 82.9% 0.8
pkg/taskrunmetrics/metrics.go 83.4% 84.0% 0.5

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/metrics.go 70.6% 73.7% 3.1
pkg/pipelinerunmetrics/metrics.go 82.1% 82.9% 0.8
pkg/taskrunmetrics/metrics.go 83.4% 84.0% 0.5

@AverageMarcus
Copy link
Contributor Author

@dibyom any chance I could get another review please?

@dibyom
Copy link
Member

dibyom commented Oct 12, 2023

Looks good to me, thanks for your patience @AverageMarcus 🙏

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, khrm

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

The pull request process is described here

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2023
@AverageMarcus
Copy link
Contributor Author

Thanks @dibyom 🎉 It looks like tide also requires a lgtm label too though. 😅

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 12, 2023
@tekton-robot tekton-robot merged commit d26a45c into tektoncd:main Oct 12, 2023
2 checks passed
@AverageMarcus AverageMarcus deleted the metrics_count_reason branch October 12, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Include reason along with status in TaskRun and PipelineRun count metrics
5 participants