oncall icon indicating copy to clipboard operation
oncall copied to clipboard

Search doesn't work in Alert Groups page

Open marganellim opened this issue 1 year ago • 11 comments

What went wrong?

What happened:

  • When putting a search string into the search text box, the alert group table does not update with the search results

What did you expect to happen:

  • In the previous version of the grafana on-call plugin, the search function would update the alert groups table with search results

image

How do we reproduce it?

  1. On the Alert Groups page, type a search string into the search text box
  2. Wait for Alert Groups to update with search results

Grafana OnCall Version

1.3.36

Product Area

Alert Flow & Configuration

Grafana OnCall Platform?

Other

User's Browser?

Brave

Anything else to add?

No response

marganellim avatar Sep 16 '23 22:09 marganellim

+1

ToonTijtgat2 avatar Sep 18 '23 09:09 ToonTijtgat2

For our setup, the search function never adapted table with the search value.

ToonTijtgat2 avatar Sep 18 '23 09:09 ToonTijtgat2

We're going to update this part of the product (including search) soon: https://github.com/grafana/oncall/issues/2853

Matvey-Kuk avatar Sep 18 '23 10:09 Matvey-Kuk

Is there any estimate on when the next rev will be released? The broken search is causing alot of headache with a client of ours.

marganellim avatar Sep 27 '23 16:09 marganellim

Search is still not working with version 1.3.44

marganellim avatar Oct 18 '23 15:10 marganellim

Still looking to see if there's an update with this issue.

marganellim avatar Nov 17 '23 18:11 marganellim

Can confirm, search still broken in v1.3.86.

From the code, the relevant search function is implemented here:

https://github.com/grafana/oncall/blob/898d025d0982e0f3774d9e772745ffbc61cb66a9/engine/apps/public_api/views/alerts.py#L43

However, looking at the MySQL log, no CAST is actually sent as part of the SQL query, which means that maybe the search request parameter is not passed to the API as expected. (Django casts should be done on the DB-side).

MariaDB [(none)]> select * from mysql.general_log where argument like '%CAST%'  \G;
Empty set (0.013 sec)

vdombrovski avatar Jan 15 '24 13:01 vdombrovski

Bumping this issue. Is there any resolution coming to the search function?

marganellim avatar Jan 20 '24 20:01 marganellim

This was temporarily disabled in #2101 for performance reasons. We are open to pull requests to conditionally enable this functionality under a feature flag! Something like this should get you started:

engine/apps/api/views/alert_group.py

class AlertGroupView:
   ...
   search_fields = ["=public_primary_key", "=inside_organization_number", "web_title_cache"] if settings.FEATURE_ENABLE_ALERT_GROUP_SEARCH else []
   ...

joeyorlando avatar Jan 29 '24 12:01 joeyorlando

@joeyorlando thanks for sharing the reason. Is there a plan to activate it again?

ToonTijtgat2 avatar Jan 30 '24 08:01 ToonTijtgat2

@ToonTijtgat2 eventually yes! But in the mean time, we're open to reviewing pull requests 😄 (the code snippet above gets you 90% of the way there)

joeyorlando avatar Jan 30 '24 12:01 joeyorlando

closing as duplicate of #2232

joeyorlando avatar Mar 06 '24 11:03 joeyorlando

Does the fact this has been closed as "not planned" indicate you have no plans to have a search function? Are you removing the search feature entirely?

marganellim avatar Mar 06 '24 17:03 marganellim

No plans to remove the search functionality, simply doing some cleanup on our issues and closing this as a duplicate. Feel free to continue the conversation over there!

If you really would like to have this re-enabled, I proposed an potential approach for a PR in my comment above, that would allow users to opt-in to having this enabled (disabled by default). If you're willing to create a PR, I will help make sure it gets across the finish-line 😄

joeyorlando avatar Mar 06 '24 18:03 joeyorlando