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

Enhancement: Support different SLA types #2906

Merged
merged 6 commits into from
Jan 30, 2025

Conversation

dylanbhughes
Copy link
Contributor

@dylanbhughes dylanbhughes commented Jan 29, 2025

Screenshot 2025-01-29 at 5 58 29 PM

@dylanbhughes dylanbhughes marked this pull request as ready for review January 29, 2025 19:29
@dylanbhughes dylanbhughes requested a review from a team as a code owner January 29, 2025 19:29
@dylanbhughes dylanbhughes marked this pull request as draft January 29, 2025 19:33
@dylanbhughes dylanbhughes changed the title Enhancement: support different SLA types Enhancement: Support different SLA types Jan 29, 2025
@dylanbhughes dylanbhughes marked this pull request as ready for review January 29, 2025 23:15
@dylanbhughes
Copy link
Contributor Author

Related to CLOUD-1035

}

public durationInSeconds(): number {
return this.trigger.within
}

public getSlaType(): string {
return ServiceLevelAgreementType.TimeToCompletion
public getSlaDefinitionKeyValuePairs(): { key: string, value: unknown }[] {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is happening because we don't preserve the full state of what a user asked for in the SLA object on the backend. We turn the SLA into an automation and stick some labels on it in the db to preserve the minimal SLA state we need (severity, type, etc) but we don't have the properties exposed in the OSS client. Example:

class FrequencySla:
    stale_after: timedelta
    
 flow.deploy(_sla=FrequencySla(severity="minor", stale_after=timedelta(hours=1)))

We store automation.labels = {"prefect.sla.severity": "minor", "prefect.sla.type": "FrequencySla"} in the db. So I'm "re-assembling" the interface we provided to the user at deploy time.

Copy link
Collaborator

@pleek91 pleek91 left a comment

Choose a reason for hiding this comment

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

LGTM!

@dylanbhughes dylanbhughes merged commit affacc1 into main Jan 30, 2025
2 checks passed
@dylanbhughes dylanbhughes deleted the dylan/enhancement/dynamic-sla-types branch January 30, 2025 19:53
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.

3 participants