[9.4] [Obs AI Assistant] Skip log rate analysis and log categories when no entity filters are present (#290244) - #290485
Merged
Conversation
…entity filters are present (elastic#290244) Closes Issue: elastic/sdh-kibana#6510 ## Summary Fixes a performance issue where clicking "Help me understand this alert" on a `custom_threshold` alert that monitors a non-standard metric, one that produces no `service.name`, `host.name`, `container.id`, or `kubernetes.pod.name` in the alert document, causes the `/internal/observability/assistant/alert_details_contextual_insights` endpoint to hang indefinitely. ### Root cause `getLogRateAnalysisForAlert` and `getLogCategories` were pushed to the data-fetcher queue unconditionally, regardless of whether any entity context was available. When all entity values are `undefined`, `getShouldMatchOrNotExistFilter` returns an empty array, so the resulting ES queries carry no entity-scoping filters and fan out across **all** configured log sources. ### Fix Added a `hasEntityFilters` flag (true when at least one of `serviceName`, `hostName`, `containerId`, `kubernetesPodName` is defined) and wrapped both log data fetchers with `if (hasEntityFilters)`. When no entity context is present, running these analyses has no meaningful scope and would scan all log data without correlation to the triggering alert. (cherry picked from commit 3843732)
kibanamachine
enabled auto-merge (squash)
September 11, 2026 09:39
|
Pinging @elastic/obs-presentation-team (Team:obs-presentation) |
Contributor
|
/ci |
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
Author
💚 Build Succeeded
Metrics [docs]
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.4:Questions ?
Please refer to the Backport tool documentation