keep
keep copied to clipboard
[🔨 Enhancement]: provider distribution should use search engine (elastic)
Describe the bug When deploying Keep with elastic, it still calc provider distribution on the database
this depends on adding "index-alerts-history" which won't happen now.
once we have that, we can run:
POST /_sql?format=json
{
"query": """
SELECT
providerId AS alert_provider_id,
providerType AS alert_provider_type,
DATE_FORMAT(lastReceived, 'yyyy-MM-dd HH') AS "time",
COUNT(*) AS hits,
MAX(lastReceived) AS last_alert_timestamp
FROM
"keep-alerts-%tenant-id%"
WHERE
lastReceived >= NOW() - INTERVAL 1 DAY
GROUP BY
providerId,
providerType,
DATE_FORMAT(lastReceived, 'yyyy-MM-dd HH')
ORDER BY
providerId,
providerType,
DATE_FORMAT(lastReceived, 'yyyy-MM-dd HH')
"""
}
Not relevant anymore, I think. @shahargl if needed, let's re-open.