Skip to content

[🐛 Bug]: Can't query incident field of alerts #4573

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

Closed
YoannD42 opened this issue Apr 17, 2025 · 1 comment · Fixed by #4611
Closed

[🐛 Bug]: Can't query incident field of alerts #4573

YoannD42 opened this issue Apr 17, 2025 · 1 comment · Fixed by #4611
Labels
Bug Something isn't working

Comments

@YoannD42
Copy link

@skynetigor Using MySQL and Version: 0.41.26 | Build: 460b78

I am trying to look up for alerts, that went orphan / didn't get correlated into incidents. I'm aware of the field "incident", that I can see in the alert payload. But it's quite confusing :

For instance, if I make a filter like : incident.name in [null] OR If I click on incident (in my facet) "None", and filter :
It gives me a list of alerts. and if I open the first one's payload, I see :

"incident": "1adb2362-a3b5-41d5-be98-5ef7957f233c".

I can then go the /incidents/that and it's valid.

If I make a new facet with incident.id, and I click filter Only on "None", it find nothing, despite the big number besides :

Clicking on incident.id None, makes this query in the background : (incident.id in [null])

Image

Image

@dosubot dosubot bot added the Bug Something isn't working label Apr 17, 2025
Copy link

dosubot bot commented Apr 17, 2025

I found a similar closed issue titled "[🐛 Bug]: Filter by enriched field not always work](#4170)" which was resolved by a pull request that enhanced date validation with regex patterns for ISO and datetime [1]. However, this may not directly address your current problem with filtering by the 'incident' field.

Regarding your issue, the filtering mechanism for 'incident.id' might be affected by recent changes in the Keep platform. The migration script dated 2024-07-25 introduced new fields to the 'incident' table, which could impact how incidents are filtered based on these attributes [2]. Additionally, the codebase includes specific database queries related to filtering alerts by 'incident' fields, structured using SQLAlchemy. These queries join tables to include incident data and apply filters based on tenant ID and timestamp thresholds [3].

The 'incident' field is populated with a valid ID when certain conditions are met, such as when the same_incident_in_the_past_id or merged_into_incident_id fields are set with a valid UUID. If these fields are not set, they remain null [4].

To filter by a specific incident ID in CEL queries, ensure the format incident.id == "UUID" is used, where the UUID is written without hyphens [5]. This might help resolve the issue of filtering for 'None' values not returning expected results.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
1 participant