-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Metric threshold] Persist group by information and apply it in the alert details page #181689
[Metric threshold] Persist group by information and apply it in the alert details page #181689
Conversation
…lert details page; Add source and tags to the alert summary field
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
|
||
import React from 'react'; | ||
|
||
export function Groups({ groups }: { groups: Array<{ field: string; value: string }> }) { |
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.
I've added this Groups component temporarily until we share the Source component between different rules: #181692
/ci |
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
I see that we are introducing We already have I think we should also rethink about point Brandon raised here and which Soren mentioned here. I understand that this might be an edge case, but I wander why would we want to do it anyway if we know there is a limitation. Instead |
Those fields are in the action variables and when I was checking AAD on the alert details page, we didn't have those fields available.
We had this discussion in this RFC and as you mentioned this is an edge case that we don't know it might even happen for our users and there is a proposal in this document about how to solve it if we saw this turns into a challenge for our users.
Adding |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
@@ -142,7 +142,7 @@ function LatencyChart({ | |||
<AlertActiveTimeRangeAnnotation | |||
alertStart={alert.start} | |||
alertEnd={alertEnd} | |||
color={chroma(transparentize('#F04E981A', 0.2)).hex().toUpperCase()} | |||
color={euiTheme.colors.danger} |
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.
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.
When I was working on fixing recovered alert annotation in APM Latency chart, euiTheme.colors.danger
with opacity 0.1 was not showing right color as I expected, so I used chroma(transparentize('#F04E981A', 0.2)).hex().toUpperCase()
with opacity 1. But now it looks fine with euiTheme.colors.danger
and opacity 0.1. Not sure what was the issue before. 🤔
...ics_data_access/server/routes/metrics_explorer/lib/convert_request_to_metrics_api_options.ts
Show resolved
Hide resolved
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
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.
I see that we have a line chart as a main chart. In custom threshold rule which is similar to metric threshold, we are showing bar chart. The preview chart in rule form also has bar chart. Ideally I would have expected to work it similar to preview chart or custom threshold alert page. Was it a design decision to use line chart in metric threshold alert page? If so, could you please add the design link to the PR.
Should we remove "Technical preview"? Once we have alerts history PR merged, I think we are good with first version of the alert page. Wdyt?
@benakansara Thanks for reviewing this PR thoroughly. I will try to address the comments as much as possible, but if I see there is a challenge in implementing those, I will create a separate ticket to move forward with this PR. The main goal of this PR was adding group information and the rest was developed a long time ago, so I need to check about the reasons for some decisions (in which the direction might have been changed over time). About your comments, do you see any of them need to be addressed in this PR or are you fine with having separate tickets for all of them in case I see fixing them is not straightforward? |
@maryam-saeidi Let's create separate issues for them and handle outside of this PR. I can create tickets if you agree with the findings. I will do one more round of testing. |
Sure, let me give them a try, and I will let you know which one will not be covered. |
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. Tested locally, and worked as expected. 🎉
I have left some comments/questions.
...bservability_solution/infra/public/alerting/metric_threshold/components/expression_chart.tsx
Show resolved
Hide resolved
...ck/plugins/observability_solution/infra/public/alerting/metric_threshold/components/tags.tsx
Show resolved
Hide resolved
...servability_solution/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts
Show resolved
Hide resolved
x-pack/plugins/observability_solution/metrics_data_access/common/http_api/metrics_explorer.ts
Show resolved
Hide resolved
x-pack/plugins/observability_solution/metrics_data_access/server/lib/metrics/index.ts
Outdated
Show resolved
Hide resolved
@@ -142,7 +142,7 @@ function LatencyChart({ | |||
<AlertActiveTimeRangeAnnotation | |||
alertStart={alert.start} | |||
alertEnd={alertEnd} | |||
color={chroma(transparentize('#F04E981A', 0.2)).hex().toUpperCase()} | |||
color={euiTheme.colors.danger} |
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.
When I was working on fixing recovered alert annotation in APM Latency chart, euiTheme.colors.danger
with opacity 0.1 was not showing right color as I expected, so I used chroma(transparentize('#F04E981A', 0.2)).hex().toUpperCase()
with opacity 1. But now it looks fine with euiTheme.colors.danger
and opacity 0.1. Not sure what was the issue before. 🤔
@benakansara Regarding your comments:
The data is correctly bucketed based on the look-back window but I think the issue lies somewhere else related to how charts aggregate data. Can you please create a ticket for it and assign it to me? I will investigate it separately.
We can either do this or always show both thresholds and indicate which one is breached in the title.
I think we can keep it as is since it is an alert even if it is because of breaching the warning threshold. (Just to avoid extra work for a rule that will be deprecated in the future) I created a ticket to deprecate the feature flag and I included the removal of the technical preview badge there, can you please list the above tickets in the ticket that I shared? |
x-pack/plugins/observability_solution/metrics_data_access/server/lib/metrics/index.ts
Outdated
Show resolved
Hide resolved
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Canvas Sharable Runtime
Page load bundle
History
To update your PR or re-run it, just comment with: |
Resolves #178998
Summary
This PR
Note
I showed the chart title temporarily in the screenshots below for verification: (You can do the same by removing hideTitle)
How to test
Create a metric threshold rule
Go to the alert details page and verify the charts show data related to the selected group
either remove hideTitle
or make sure the data in the chart matches expectations for that specific group
or check the
metrics_explorer
Create an APM Latency threshold rule and check the active alert annotation to have the right color.
![image](https://private-user-images.githubusercontent.com/12370520/329531717-dd14cf99-e44e-4531-a221-7ed40bb43c5a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwOTI1MTUsIm5iZiI6MTcyMzA5MjIxNSwicGF0aCI6Ii8xMjM3MDUyMC8zMjk1MzE3MTctZGQxNGNmOTktZTQ0ZS00NTMxLWEyMjEtN2VkNDBiYjQzYzVhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA4VDA0NDMzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFmMDQzN2U4YTAxM2FlNzUyMWFiZjAxNDdhZDFmYTM0MGY5OTZjM2VkMGUyMGZlNTJhZjc1MmJlMTIwMjVjZmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5S9i65kWhjboxtdIirQtbOlTIuyeNYoS6L1YP9woEnI)