-
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
[Rules] Remove the UUID requirement for using a pre-defined rule.id
#182594
Comments
Pinging @elastic/response-ops (Team:ResponseOps) |
Update: woops! Missed that used I check the list a little closer - I don't think we have a problem with any of them.
note: alerting URLs and methods
|
@simianhacker As @pmuellr said, the create rule API supports creating rules with a specified ID. Unfortunately the ID has to be a UUID. The reason is that the rule SO has encrypted values (the API key of the user that created or updated the rule) and SOs with encrypted values must have IDs as UUID because the IDs are part of the AAD used during encryption and they should be hard to guess. For example, making the following API call will result to a 400 error. API call
Response
@elastic/kibana-core @elastic/kibana-security Any ideas or alternatives? |
I don't think I really do. As you already mentionned, it's possible to use custom ids for SOs, but ESOs require their IDs to be valid uuids, so custom ids for ESOs needs to be UUIDs. But it's the 30 years old "technical ID vs functional ID" discussion if you ask me. If you think a feature would benefit from more "user friendly functional IDs", then such field can just be added to any SO type's attributes, and the type owner can then change their APIs to create/search/retrieve/update/anything based on a functional ID rather than the technical one (and for ESO, the type owner could decide to have their functional ID attribute unencrypted to even make this easier?) |
Thank you @pgayvallet for the input! The functional ID is a great idea and seems the only way to move forward with this request. |
Sorry for the late reply, but I also agree that the "function ID" is something worth exploring despite the limitations imposed by the ESO plugin and might provide more flexibility in the long run. That being said, if it turns out that this approach isn't viable or significantly worsens DX/UX in your specific case, we can consider relaxing the ESO UUID-ID requirement on a type-by-type basis. |
If there was a way to guarantee uniqueness of both a functional ID and a technical ID this would be a viable option. However, it sadly is not. We've primarily received this feedback from customers who are using tools like terraform to provision their rules as code, and as such, they need the user friendly ID to be unique. Therefore, I think the only reasonable way forward is to relax the ESO UUID-ID requirement on a type-by-type basis. |
Got it. Then yeah, I agree, relaxing the constraint on ESO UUID seems like the only viable option then. (and it's very hard for me, but I think I will manage not trolling with things like transaction support for ES, unique constraints support for ES, proper service layer enforcing unique functional IDs without those technical features and similar concepts. Yeah, I will totally finish my comment without mentioning any of those things. Promise. Here, I did it) |
Blocked by #194692. |
…random IDs (elastic#199119) ## Summary This PR allows users to create rules with predefined nonrandom IDs. To test it, try to create a rule with a predefined ID like `POST /api/alerting/rule/<my_rule_id>` Fixes: elastic#182594 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) (cherry picked from commit 669761b)
…random IDs (elastic#199119) ## Summary This PR allows users to create rules with predefined nonrandom IDs. To test it, try to create a rule with a predefined ID like `POST /api/alerting/rule/<my_rule_id>` Fixes: elastic#182594 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
Users need a way to create a consistent ID across resources that are human readable. Imagine a user is creating an SLO with a custom id
admin-console-availability-sla
and they want to check if a rule exists using the same ID for the rule; if it doesn't exists, create it.In order to do that today, they would need to use the same
UUID
for both the SLO and the Rule. This is less than ideal because they end up with a bunch of UUIDs which requires a lot of cognitive overhead when looking at a logs or a large list of these resources; it requires an extra step of looking up which UUIDs belong to which SLOs.The work around right now is customers will search all the rules to try and find the corresponding burn rate rule, the system doesn't limit the number of burn rate rules for an SLO and if that search returns multiple rules for the same SLO (which a user might have created by accident) they struggle to determine which is the "right one".
The text was updated successfully, but these errors were encountered: