-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Metrics UI] Fixing race condition in Metric Threshold alerts #98563
Merged
simianhacker
merged 2 commits into
elastic:master
from
simianhacker:issue-97150-fix-race-condition-in-metric-threshold-alerts
Apr 29, 2021
Merged
[Metrics UI] Fixing race condition in Metric Threshold alerts #98563
simianhacker
merged 2 commits into
elastic:master
from
simianhacker:issue-97150-fix-race-condition-in-metric-threshold-alerts
Apr 29, 2021
Conversation
This file contains 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
simianhacker
added
Feature:Metrics UI
Metrics UI feature
Team:Infra Monitoring UI - DEPRECATED
DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
v7.14.0
v8.0.0
labels
Apr 27, 2021
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Can we get this in for |
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
estermv
approved these changes
Apr 29, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
simianhacker
added a commit
to simianhacker/kibana
that referenced
this pull request
Apr 30, 2021
…c#98563) * [Metrics UI] Fixing race condition in Metric Threshold alerts * fixing type issue
simianhacker
added a commit
to simianhacker/kibana
that referenced
this pull request
Apr 30, 2021
…c#98563) * [Metrics UI] Fixing race condition in Metric Threshold alerts * fixing type issue
simianhacker
added a commit
that referenced
this pull request
Apr 30, 2021
#98978) * [Metrics UI] Fixing race condition in Metric Threshold alerts * fixing type issue
simianhacker
added a commit
that referenced
this pull request
Apr 30, 2021
#98977) * [Metrics UI] Fixing race condition in Metric Threshold alerts * fixing type issue
simianhacker
deleted the
issue-97150-fix-race-condition-in-metric-threshold-alerts
branch
April 17, 2024 15:34
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature:Metrics UI
Metrics UI feature
release_note:fix
Team:Infra Monitoring UI - DEPRECATED
DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
v7.13.0
v7.14.0
v8.0.0
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.
Summary
This PR fixes #97150 by refactoring
useMetricsExplorerData
to useuseTrackedPromises
and then rely on thecancelPreviousOn
set tocreation
to cancel the previous request. Since the basic behavior should remain the same the originaluse_metrics_explorer_data.test.tsx
tests should pass.Setup for Testing
In order to test this, you need to put the Metrics Explorer code into a state where the some requests are delayed. To do this add the following code to
x-pack/plugins/infra/server/routes/metrics_explorer/index.ts
starting on line 57:Steps for Testing
./bin/slingshot.ts load --config ./configs/hosts.json --purge --start now-5d/d --end now+1d/d
Average of system.cpu.total.pct
and filter byhost.name: "host-0" and event.dataset: "system.memory"
and event.dataset: "system.memory"
, cut it then paste it immediately.Before the fix, it should make a request for only
host.name: "host-0"
, which should take ~3 seconds and then a request withhost.name: "host-0" and event.dataset: "system.memory"
should happen but return almost immediately. The screen will update with a blank chart (from the second request) and then update to a chart with data (from the first request).After the fix the chart should display the results from the second request, even when the first request completes afterwards.