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

aws-janitor: add job duration metric #78

Merged
merged 2 commits into from
Mar 12, 2021

Conversation

cpanato
Copy link
Member

@cpanato cpanato commented Mar 4, 2021

...to collect the response time when running this job

this is a short live job, and then we cannot guarantee that we will have someone to scrape the data at the correct time, to avoid that, we need to use the Prometheus PushGateway to store the metrics and then have Prometheus scrape the PushGateway, however, the problem continues, we need to make sure the metrics are pushed to the PushGateway in time.

So for that, we need to push ourselves, then the approach in this PR is to push when exiting the job

this is part of #13

opening this PR for feedback and see if sounds good

a screenshot for the metric pushed to PushGateway

Screen Shot 2021-03-04 at 14 00 38

/assign @ixdy

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 4, 2021
@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 4, 2021
Copy link
Contributor

@ixdy ixdy left a comment

Choose a reason for hiding this comment

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

thanks for this PR! just a few minor suggestions, otherwise this largely LGTM

@@ -143,3 +183,24 @@ func markAndSweep(opts resources.Options, region string) error {

Copy link
Contributor

Choose a reason for hiding this comment

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

no action required in this change, but in the future it might be worth reporting how many resources were deleted, too (see line directly above this one, I just can't comment on it directly)

(there's probably a similar count obtainable from CleanAll())

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for your review and feedback Jeff

Added a metric to report the sweep, the CleanAll() function does not return how many resources were deleted, but i think we can add that, i can do that if you think that will be good

ptal

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, we'd need to pass that information back from CleanAll(), but that can happen separately.

@k8s-ci-robot k8s-ci-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 Mar 7, 2021
@@ -143,3 +183,24 @@ func markAndSweep(opts resources.Options, region string) error {

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, we'd need to pass that information back from CleanAll(), but that can happen separately.

@cpanato cpanato force-pushed the GH-13-aws-janitor branch from 433f40d to 7553aa1 Compare March 9, 2021 12:01
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, ixdy

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit 885e35e into kubernetes-sigs:master Mar 12, 2021
@cpanato cpanato deleted the GH-13-aws-janitor branch March 12, 2021 07:33
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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