-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[SLO] Create SLO with specified ID #156425
Comments
Pinging @elastic/actionable-observability (Team: Actionable Observability) |
@CoenWarmer you've added this. Are we sure that's the expected behaviour we want?
Our UI does not provide a way to specify an id, It's only an API details for external (e.g. terraform) client. Therefore, we don't need to handle this case in our UI (yet, maybe never). For the 400, not sure it's the preferred response for idempotent request. Maybe a 409, but probably more a 200/201. Basically, the responsibility of choosing a unique identifier is on the client, then the server treats the request as a no-op if it already exists, or create the slo if it does not. @wandergeek can shed some light here. |
Hey @kdelemme, this is what was suggested while discussing this ticket in the Inbox session while you were out. We tried to interpret the use case on the basis of the description. And we (apparently incorrectly) assumed the UI implications. Feel free to adjust the acceptance criteria how you see fit. |
Thanks for this @kdelemme, I really appreciate it. Part of me thinks a 400/409 is preferable because if someone accidentally use the create API when they should've used the update API, they could be lead into a false sense that the request worked when it didn't. Edit: Which looks like that's exactly what you did. Perfect! |
📝 Summary
When creating an SLO, we should allow an optional ID to be specified, and use this ID for the SLO.
When not specified, we should fallback to a uuidv1 as we currently do.
The optional ID should be length limited to avoid problematic usage when used in the related transform ID.
To simplify SLO management through infrastructure as code, we should allow the creation of an SLO with a custom id instead of relying on a uuidv1 generated on the server.
This change requires a few changes in the repository and the schema:
When creating an SLO, if an existing SLO already exists for the given id, we should return a 409 conflict.
The SLO id schema should be enforced with at least a 8-char alphanumerical string, up to 32-char.
✅ Acceptance criteria
The text was updated successfully, but these errors were encountered: