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

Initial proposal to create new counters/timeseries to account for tasknames and namespaces #1170

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

nistar
Copy link

@nistar nistar commented Jul 31, 2024

Changes

Created new const values for a possible future functionality

We're trying to implement the following solution:

Having some metric statistics on container signing, meaning "this many containers were generated, this many were signed, this many weren't". Having a namespace categorization would be helpful.

Submitter Checklist

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

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

Copy link

linux-foundation-easycla bot commented Jul 31, 2024

CLA Missing ID CLA Not Signed

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

Hi @nistar. 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
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@PuneetPunamiya
Copy link
Member

@nistar Can you please sign the SLA

@PuneetPunamiya
Copy link
Member

/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 1, 2024
@nistar
Copy link
Author

nistar commented Aug 1, 2024

/ok-to-test

@nistar Can you please sign the SLA

Done. Please, let me know if I need to provide more info

PipelineRunStoredDesc = "Total number of stored payloads for pipelineruns"
PipelineRunMarkedName = "pipelinerun_marked_signed_total"
PipelineRunMarkedDesc = "Total number of objects marked as signed for pipelineruns"
PipelineRunSignedMsg = "pipelinerun_signed_messages"
Copy link
Contributor

@lcarva lcarva Aug 1, 2024

Choose a reason for hiding this comment

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

How's this different than PipelineRunSignedName ?

Actually, I'm not sure how any of the ones being added are different than the existing ones. What am I missing?

Copy link
Author

Choose a reason for hiding this comment

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

The ones currently used produce totals across the entire cluster. We need a more detailed information, such as a namespace, taskname, success/failure and other kinds of labels attached to the counters. So my proposal is to leave the old ones alone and create a new time series that can be utilized to display info related to individual projects in Grafana or some other tool.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. Can we make the name and description indicative of this?

Copy link
Author

Choose a reason for hiding this comment

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

Do we have a naming convention?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not an official one. I would just like to make it obvious that certain metric is namespace based. Does that make sense?

Copy link
Author

Choose a reason for hiding this comment

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

Absolutely

Copy link
Author

Choose a reason for hiding this comment

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

Does it look ok?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @lcarva do the names look ok to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the delay! Yes, that looks reasonable. Were you thinking about doing the same for TaskRuns as well?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, just wanted to make small and manageable changes at a time.

@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 20, 2024
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@nistar
Copy link
Author

nistar commented Sep 16, 2024

It looks like we don't honor storage.oci.repository.insecure flag on every execution path and it results in https/http protocol errors when trying to communicate with insecure registries like kind. I've added a few checks to make sure it's implemented. Welcome any comments/suggestions

@nistar
Copy link
Author

nistar commented Sep 17, 2024

@lcarva @PuneetPunamiya I've modified a couple of files to honor the storage.oci.repository.insecure flag to be able to test with kind registry. What are your thoughts on this?

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@lcarva
Copy link
Contributor

lcarva commented Sep 19, 2024

@lcarva @PuneetPunamiya I've modified a couple of files to honor the storage.oci.repository.insecure flag to be able to test with kind registry. What are your thoughts on this?

@nistar, I don' think name.Digest queries the registry. Have you actually seen this cause an error?

@nistar
Copy link
Author

nistar commented Sep 19, 2024

@lcarva @PuneetPunamiya I've modified a couple of files to honor the storage.oci.repository.insecure flag to be able to test with kind registry. What are your thoughts on this?

@nistar, I don' think name.Digest queries the registry. Have you actually seen this cause an error?

@lcarva The code eventually ends up calling Ping:

image

resulting in "using https with http protocol" error message

@lcarva
Copy link
Contributor

lcarva commented Sep 19, 2024

@nistar ah! name.NewDigest creates a new object that stores the insecure registry option. This is later used in queries to the registry. Good find!

Could you open a separate PR for that? 🙏

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/pipelinerunmetrics/metrics.go 84.6% 76.5% -8.1

@tekton-robot
Copy link

@nistar: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-tekton-chains-unit-tests 9362db3 link true /test pull-tekton-chains-unit-tests
pull-tekton-chains-integration-tests 9362db3 link true /test pull-tekton-chains-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

4 participants