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

WIP: Define schema with cue #32

Closed
wants to merge 2 commits into from
Closed

Conversation

embano1
Copy link

@embano1 embano1 commented Jun 14, 2021

TODO:

  • Discuss folder structure
  • Documentation, examples and descriptions
  • Add indicator
  • Add objectives

Closes: #20
Signed-off-by: Michael Gasch mgasch@vmware.com

@embano1 embano1 marked this pull request as draft June 14, 2021 14:07
Closes: OpenSLO#20
Signed-off-by: Michael Gasch <mgasch@vmware.com>
@embano1
Copy link
Author

embano1 commented Jun 14, 2021

@ian-bartholomew first proposal for discussion. There's couple of areas where the spec is a bit fuzzy/unclear to me (and I made some minor adjustments based on some other comments).

On indicator and objectives I had a couple of questions thus did not include them in the spec yet.

indicator optional, represents the Service Level Indicator (SLI). Currently this only supports one Metric, thresholdMetric, with ratioMetric supported in the objectives stanza.

Why do we need to spread the different metrics over various spec parts, e.g. one in indicator, one in objectives?
This also leads to some tough validation requirements e.g.

If thresholdMetric has been defined, only one Threshold can be defined. However if using ratioMetric then any number of Thresholds can be defined.

and

indicator.ratioMetric Metric {Good, Total}, if ratioMetric is defined then thresholdMetric should not be set in indicator

@@ -0,0 +1,198 @@
{
Copy link
Author

Choose a reason for hiding this comment

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

Generated with cue export --out=openapi meta.cue spec.cue > openapi.json

@@ -0,0 +1,6 @@
package v1alpha1

apiVersion: "openslo/v1alpha1" & #apiVersion
Copy link
Author

Choose a reason for hiding this comment

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

enforcing v1alpha1 semantics

package v1alpha1

apiVersion: "openslo/v1alpha1" & #apiVersion
kind: "SLO" & #kind
Copy link
Author

Choose a reason for hiding this comment

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

For Service the spec is rather brief on what goes into it (besides spec.Description) so I did not include Service type yet.

import "time"

#spec: {
// list?
Copy link
Author

Choose a reason for hiding this comment

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

In the spec it looks like a list []?

service: string
// optional
// TODO: 1050 exceeds go regex limit (1000)
description?: string
Copy link
Author

Choose a reason for hiding this comment

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

Can't use regex to validate 1050 char limit here due to go regex package limit (1000).

service: string
// optional
// TODO: 1050 exceeds go regex limit (1000)
description?: string
Copy link
Author

Choose a reason for hiding this comment

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

Can't use regex to validate 1050 char limit here due to go regex package limit (1000).

// TODO: 1050 exceeds go regex limit (1000)
description?: string
// object oneOf
timeWindow: #timeWindowSecond | #timeWindowCalendar
Copy link
Author

Choose a reason for hiding this comment

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

Note: made this oneOf instead of list

// indicator:
}

#indicator: {
Copy link
Author

Choose a reason for hiding this comment

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

See questions in PR comments.

}
calendar: {
// note: leap-seconds not supported
startTime: time.Format(time.RFC3339)
Copy link
Author

Choose a reason for hiding this comment

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

Enforcing RFC3339 and avoiding additional timezone field.

@its02003
Copy link

@ian-bartholomew first proposal for discussion. There's couple of areas where the spec is a bit fuzzy/unclear to me (and I made some minor adjustments based on some other comments).

On indicator and objectives I had a couple of questions thus did not include them in the spec yet.

indicator optional, represents the Service Level Indicator (SLI). Currently this only supports one Metric, thresholdMetric, with ratioMetric supported in the objectives stanza.

Why do we need to spread the different metrics over various spec parts, e.g. one in indicator, one in objectives?
This also leads to some tough validation requirements e.g.

If thresholdMetric has been defined, only one Threshold can be defined. However if using ratioMetric then any number of Thresholds can be defined.

and

indicator.ratioMetric Metric {Good, Total}, if ratioMetric is defined then thresholdMetric should not be set in indicator

Agreed as I mentioned this here: #29

Whats the best mechanism for suggesting the recommended change to the spec?

@ian-bartholomew
Copy link
Contributor

Why do we need to spread the different metrics over various spec parts, e.g. one in indicator, one in objectives?

@embano1 this has come up a few times, and I agree, it leads to some issues, and should get addressed. This is an artifact of us open sourcing our internal spec

@its02003 I think a good way of doing is it is a PR here with changes in the spec, and then pinging the OpenSLO Slack channel where we can discuss it.

Thanks both!

@embano1 embano1 closed this Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define schema in .cue?
5 participants