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

JobDeletionDurationSeconds metric in TTLAfterFinished controller #98676

Merged
merged 1 commit into from Feb 13, 2021

Conversation

ahg-g
Copy link
Member

@ahg-g ahg-g commented Feb 1, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a metric to track the time it took to delete a job by the ttl-after-finished controller.

Which issue(s) this PR fixes:
Part of kubernetes/enhancements#592

Special notes for your reviewer:
This is a requirement to graduate TTLAfterFinished to Beta: https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/592-ttl-after-finish#monitoring-requirements

Does this PR introduce a user-facing change?:

A new histogram metric to track the time it took to delete a job by the ttl-after-finished controller

@k8s-ci-robot k8s-ci-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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 1, 2021
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 1, 2021
@ahg-g
Copy link
Member Author

ahg-g commented Feb 1, 2021

/remove-kind api-change

@k8s-ci-robot k8s-ci-robot removed the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Feb 1, 2021
@ahg-g
Copy link
Member Author

ahg-g commented Feb 1, 2021

/assign @soltysh

@ahg-g
Copy link
Member Author

ahg-g commented Feb 1, 2021

/assign @janetkuo

@ahg-g
Copy link
Member Author

ahg-g commented Feb 2, 2021

/retest

@k8s-ci-robot k8s-ci-robot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 3, 2021
@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 10, 2021
@ahg-g ahg-g force-pushed the ahg-ttl branch 2 times, most recently from 06a3830 to c744af1 Compare February 12, 2021 17:10
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 12, 2021
TimeToDeletionSeconds = metrics.NewHistogram(
&metrics.HistogramOpts{
Subsystem: TTLAfterFinishedSubsystem,
Name: "time_to_deletion_seconds",
Copy link
Contributor

Choose a reason for hiding this comment

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

generally durations have the suffix _duration_seconds, such as http_request_duration_seconds, or scheduling_duration_seconds. This is to distinguish them from timestamps (e.g. process_start_time_seconds).

The prefix is up to you, but time_to_deletion_duration_seconds sounds a bit odd. Maybe deletion_duration_seconds, or job_deletion_duration_seconds?

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, changed to job_deletion_duration_seconds

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 12, 2021
@ahg-g ahg-g changed the title TimeToDeletion metric in TTLAfterFinished controller JobDeletionDurationSeconds metric in TTLAfterFinished controller Feb 12, 2021
@ahg-g
Copy link
Member Author

ahg-g commented Feb 12, 2021

/retest

@dashpole
Copy link
Contributor

/approve
for sig-instrumentation

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, dashpole, soltysh

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

@ahg-g
Copy link
Member Author

ahg-g commented Feb 12, 2021

/retest

},
{
name: "Job failed 10s ago, 15s TTL",
failedTime: metav1.NewTime(now.Add(-10 * time.Second)),
ttl: utilpointer.Int32Ptr(15),
since: &now.Time,
expectedTimeLeft: durationPointer(5),
expectedExpireAt: now.Add(5 * time.Second),
},
}

for _, tc := range testCases {
job := newJob(tc.completionTime, tc.failedTime, tc.ttl)
Copy link
Member

Choose a reason for hiding this comment

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

Off the logic, but we may migrate this to a pure subtest style.

@Huang-Wei
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 12, 2021
@ahg-g
Copy link
Member Author

ahg-g commented Feb 12, 2021

/retest

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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants