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

Add SLO parameter to API availability measurement #1776

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

tosi3k
Copy link
Member

@tosi3k tosi3k commented Mar 24, 2021

Add a configurable threshold parameter that would serve as an SLO for the measurement.

/sig scalability
/assign @jkaniuk

@k8s-ci-robot k8s-ci-robot added sig/scalability Categorizes an issue or PR as relevant to SIG Scalability. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 24, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 24, 2021
@@ -252,7 +259,10 @@ func (a *apiAvailabilityMeasurement) gather() ([]measurement.Summary, error) {
}
summary := measurement.CreateSummary(apiAvailabilityMeasurementName, "json", content)
a.summaries = append(a.summaries, summary)
return a.summaries, nil
if sli := output.ClusterSummary.AvailabilityPercentage; sli < a.threshold {
err = fmt.Errorf("API availability SLO not fulfilled (SLI: %.2f, SLO: %.2f)", sli, a.threshold)
Copy link
Member

Choose a reason for hiding this comment

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

NewMetricViolationError

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -252,7 +259,10 @@ func (a *apiAvailabilityMeasurement) gather() ([]measurement.Summary, error) {
}
summary := measurement.CreateSummary(apiAvailabilityMeasurementName, "json", content)
a.summaries = append(a.summaries, summary)
return a.summaries, nil
if sli := output.ClusterSummary.AvailabilityPercentage; sli < a.threshold {
err = fmt.Errorf("API availability SLO not fulfilled (SLI: %.2f, SLO: %.2f)", sli, a.threshold)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make it more readable, without so many acronyms?
like "got: x, expected >= x"

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -252,7 +259,10 @@ func (a *apiAvailabilityMeasurement) gather() ([]measurement.Summary, error) {
}
summary := measurement.CreateSummary(apiAvailabilityMeasurementName, "json", content)
a.summaries = append(a.summaries, summary)
return a.summaries, nil
if sli := output.ClusterSummary.AvailabilityPercentage; sli < a.threshold {
Copy link
Contributor

Choose a reason for hiding this comment

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

are you comparing percentage with a fraction?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also: having percentage in the summary and fraction in an error and variable is inconsistent

Copy link
Member Author

@tosi3k tosi3k Mar 24, 2021

Choose a reason for hiding this comment

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

are you comparing percentage with a fraction?
Also: having percentage in the summary and fraction in an error and variable is inconsistent

Nope, this is a comparison of percentages, not fractions. threshold parameter is also provided as a percentage in the config.

Copy link
Contributor

Choose a reason for hiding this comment

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

right
CL2_API_AVAILABILITY_THRESHOLD 0.0 suggested otherwise
Maybe CL2_API_AVAILABILITY_PERCENTAGE_THRESHOLD then, to make it more explicit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good! Done.

@jkaniuk
Copy link
Contributor

jkaniuk commented Mar 24, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 24, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkaniuk, tosi3k

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 24, 2021
@k8s-ci-robot k8s-ci-robot merged commit abecfdd into kubernetes:master Mar 24, 2021
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/scalability Categorizes an issue or PR as relevant to SIG Scalability. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants