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

Alerting: Loki-based alert state history modal #66595

Merged
merged 48 commits into from
Apr 24, 2023

Conversation

konrad147
Copy link
Contributor

@konrad147 konrad147 commented Apr 14, 2023

What is this feature?
This PR adds a new Alert State History modal which taps into the new Loki-based history API

Minor improvements:

  • adds a muted version of the AlertStateTag component
  • Cleans the user provided label matcher regex expression to prevent RegExp errors

Why do we need this feature?
To provide better insights into changes in alert instances over time

Fixes #63656

Special notes for your reviewer:
The new modal is used when the state history backend engine is set to Loki. Otherwise, the old one will be used

OLD ASH MODAL
image

NEW ASH MODAL
image

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

gillesdemey and others added 30 commits April 14, 2023 16:41
Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com>
Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com>
>
<StateHistory alertId={alertId} />
<Suspense fallback={'Loading...'}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

builder.setSync();
const interpolator = builder.getTooltipInterpolator();

// I found this in TooltipPlugin.tsx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@VikaCep
Copy link
Contributor

VikaCep commented Apr 18, 2023

Looks like the Clear button from the filter is showing even if there's no text. Perhaps it should be hidden if empty.

image

Copy link
Contributor

@VikaCep VikaCep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!! 🚀 ☄️ Left a few suggestions/comments.

instancesFilter
);

const frameSubset = useMemo(() => take(dataFrames, MAX_TIMELINE_SERIES), [dataFrames]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why you're using lodash's take instead of just slice?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some of my personal bias towards using Lodash / more readable code entered in to this (which is basically executing slice(0, n).

There's definitely a trade-off here since some engineers might be more familiar with the std library than lodash's functions but hopefully the function names are descriptive enough.

Copy link
Member

@soniaAguilarPeiron soniaAguilarPeiron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredible work! 🎉🎉🎉🎉🎉🎉🚀🚀🚀🚀🚀🚀

Copy link
Member

@gillesdemey gillesdemey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review here is a bit biased since I co-authored some parts; but have raised some (non-blocking) points that I think we could address from a maintenance perspective.

Copy link
Member

@gillesdemey gillesdemey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 test still needs fixing or might be flakey but code LGTM

Copy link
Contributor

@VikaCep VikaCep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀 🚀

@konrad147 konrad147 merged commit 91704cf into main Apr 24, 2023
@konrad147 konrad147 deleted the alerting/alert-state-history-modal branch April 24, 2023 07:28
@zerok zerok modified the milestones: 10.0.0, 10.0.0-preview May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Alerting: Improved history view of an individual alert rule
6 participants