Skip to content
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

[🔨 Enhancement]: provider distribution should use search engine (elastic) #1316

Open
shahargl opened this issue Jul 1, 2024 · 1 comment
Assignees
Labels
Architecture Requires an architecture change/review

Comments

@shahargl
Copy link
Member

shahargl commented Jul 1, 2024

Describe the bug
When deploying Keep with elastic, it still calc provider distribution on the database

@shahargl shahargl self-assigned this Jul 4, 2024
@shahargl shahargl added the Architecture Requires an architecture change/review label Jul 4, 2024
@shahargl
Copy link
Member Author

shahargl commented Jul 4, 2024

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')
  """
}

@shahargl shahargl changed the title [Bug]: provider distribution should use search engine (elastic) [enhancement]: provider distribution should use search engine (elastic) Jul 4, 2024
@talboren talboren changed the title [enhancement]: provider distribution should use search engine (elastic) [🔨 Enhancement]: provider distribution should use search engine (elastic) Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Requires an architecture change/review
Projects
None yet
Development

No branches or pull requests

1 participant