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
OU-206: Merge monitoring alerts with alerts from other sources in the dev console #12940
OU-206: Merge monitoring alerts with alerts from other sources in the dev console #12940
Conversation
15d031a
to
4b098e8
Compare
import { useResolvedExtensions } from '@console/dynamic-plugin-sdk'; | ||
import { | ||
AlertingRulesSourceExtension, | ||
isAlertingRulesSource, | ||
} from '@console/dynamic-plugin-sdk/src/extensions/alerts'; |
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.
import { useResolvedExtensions } from '@console/dynamic-plugin-sdk'; | |
import { | |
AlertingRulesSourceExtension, | |
isAlertingRulesSource, | |
} from '@console/dynamic-plugin-sdk/src/extensions/alerts'; | |
import { | |
AlertingRulesSourceExtension, | |
isAlertingRulesSource, | |
useResolvedExtensions, | |
} from '@console/dynamic-plugin-sdk'; |
Maybe combine the dynamic-plugin-sdk
imports?
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.
Not all packages are exported in the main @console/dynamic-plugin-sdk
so a full path is needed
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 added the alerts to the main package export in the SDK
const alertsSource = React.useMemo( | ||
() => | ||
customExtensions | ||
.filter((extension) => extension.properties.contextId === 'dev-observe-alerting') |
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.
Could you add a comment explaining where dev-observe-alerting
comes from?
}); | ||
dispatch(alertingLoading('alerts', 'dev')); | ||
|
||
const poller = (): void => { |
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 notice that this code is almost the same as the poller
we have in /components/monitoring/alerting.tsx
. I think it would be worth extracting this into a single helper function.
}); | ||
dispatch(alertingLoading('alerts', 'dev')); | ||
|
||
const poller = (): void => { |
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.
The two poller
s in this PR and the poller
in /components/monitoring/alerting.tsx
are very similar, so I think it would be good to combine them all.
@@ -123,10 +175,10 @@ export const MonitoringAlerts: React.FC<Props> = ({ match, rules, filters, listS | |||
); | |||
|
|||
const Content = React.useMemo(() => { | |||
if (loading && !loadError) { | |||
if (!alerts?.loaded && !alerts?.loadError) { |
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.
Do we also need to handle the case where the alerts are loaded, but the rules are pending here?
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.
Alerts are extracted from rules so they are loaded at the same time
4b098e8
to
552fdae
Compare
/lgtm |
/assign @yapei @opayne1 @RickJWagner |
/jira refresh |
@jgbernalp: No Jira issue is referenced in the title of this pull request. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jgbernalp: This pull request references OU-206 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jgbernalp: This pull request references OU-206 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
Looks good.
/label px-approved |
@kabirbhartiRH from logging team will test the PR |
/assign @kabirbhartiRH |
@jgbernalp @yapei We have a blocker bug https://issues.redhat.com/browse/LOG-4240 on Logging 5.8.0 |
/label docs-approved |
552fdae
to
d20929a
Compare
/lgtm |
d20929a
to
f841126
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jgbernalp, kyoto The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/qe-approved |
/retest |
1 similar comment
/retest |
/label qe-approved |
/retest |
/retest |
1 similar comment
/retest |
@jgbernalp: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This PR allows plugins to contribute extensions to add new alerting rules sources in the dev console
https://issues.redhat.com/browse/OU-206
Screen.Recording.2023-06-29.at.12.10.23.mov