-
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
[RAC] Solidify schema (UUIDs per document) #112541
Comments
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
I'm following the Alerts-as-data schema document when I say this, but my understanding is that we agreed on alerts using the following:
|
Does this mean we end up with two alert documents or that we modify the status of the original document back to active? |
I don't think so. In the alert executor's state we're tracking the mapping of
|
If I understand correctly we end up with two alert documents then, with a shared In any case I think we can still consider it as a primary key of the alert document |
Yep.
Wouldn't "primary key" imply that it's unique? |
On the "Alert" document, as a FK we have this:
We should specify exactly what type of ID we want to store here, whether it's a so-called "legacy" Saved Object ID or the newly generated type (or if this question even makes sense)? @mikecote @gmmorris can you let us know about how the Rule saved objects are or will be affected by the saved object ID migration in 8.0? |
If you store the current rule SO ID regardless of the version and capture the release To do a lookup of the rule based on the alert document, you can use the SO resolve API unless there's a more robust way to do so (maybe rule lookup by legacyId & space? 🤔) |
Yes this is the use case I'm thinking about. So to clarify:
(alert.kibana.version < 8 && alert.kibana.alert.rule.id === rule.legacyId)
|| (alert.kibana.version >= 8 && alert.kibana.alert.rule.id === rule.id)
if (alert.kibana.version < 8) {
// Construct query with condition: rule.legacyId === alert.kibana.rule.id
} else {
// Construct query with condition: rule.id === alert.kibana.rule.id
} If the above is true, we should be ok to only store @jportner would you mind glancing at this and letting me know if I'm making any sense? |
Here is the criteria for determine if an existing object's ID will change in 8.0:
The
I'd prefer not to use the term "reference" here, it means something else when we are talking about saved objects. But yes, Rule objects do maintain their legacy ID in their attributes (e.g., "type-level fields"). So, in 7.16, a Rule would have these fields: {
id: '123',
attributes: {
legacyId: '123'
},
namespace: 'some-space'
} and after it is converted in 8.0, it would have these fields: {
id: '456',
attributes: {
legacyId: '123'
},
namespaces: ['some-space']
}
This point is tripping me up; I thought "Rule" is just a new name for the
I'd like to make sure I understand (4) and (5) above before attempting to answer this. |
From @kobelb -- legacyIds can be the same for two different rules in two different spaces. Have we accounted for this? |
@afgomez thanks for all of your work on tracking this information down and documenting it. Two conclusions from this work:
|
Document Relationship Map
AC:
Field source spreadsheet
Need to figure these out now
alerting.registerType
Note that rule types are registered when kibana loads and are not persisted.
producer
: app that registers the rulerule_type_id
: string used to register the rule typeconsumer
: plugin that registered the ruleAlert type(2)
kibana.alert.rule.execution.uuid
_id
andkibana.alert.uuid
(same value, but two different fields)kibana.alert.instance.id
used to identify a pre-existing alert with the executorkibana.alert.rule.rule_type_id
: string used to register the rule typekibana.alert.rule.uuid
: rule instance(1)kibana.alert.rule.producer
: the rule type producerkibana.alert.rule.consumer
: the rule consumerkibana.alert.group.id
orkibana.alert.rule.execution.uuid
(3) (see #110135)We just need to be aware of these but we can figure them out for certain later
footnotes
(1) Saved object IDs used as foreign keys might be affected by the planned ID changes
(2) Security needs some other way to identify an "alert type" that is not unique
(3) This field is proposed but hasn't materialized yet
The text was updated successfully, but these errors were encountered: