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

Fixes #19860: Added Diagnostic tab to display diagnostic information || Added Sync offset button #19980

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dhruvjsx
Copy link
Contributor

@dhruvjsx dhruvjsx commented Feb 26, 2025

Fixes #19860

I worked on adding a Diagnostics tab in the alert details page to help users troubleshoot delayed alerts. This includes:

A Sync Offset button to prioritize alert events by syncing their offsets.
API: PUT /api/v1/events/subscriptions/name/{name}/syncOffset

Displaying diagnostic information to show the current and total offsets of alerts.
API: GET /api/v1/events/subscriptions/name/{name}/diagnosticInfo

These changes ensure that users receive alerts in real time even when offsets fall behind in the queue.

BEFORE

BEFORE

AFTER

AFTER
Screen.Recording.2025-02-27.at.1.37.46.PM.mov

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.

Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment on lines 385 to 415
test('Alert Diagnostic Info', async ({ page }) => {
const ALERT_NAME = generateAlertName();

await test.step('Create alert', async () => {
await visitObservabilityAlertPage(page);
data.alertDetails = await createAlert({
page,
alertName: ALERT_NAME,
sourceName: SOURCE_NAME_1,
sourceDisplayName: SOURCE_DISPLAY_NAME_1,
user: user1,
createButtonId: 'create-observability',
selectId: 'Owner Name',
addTrigger: true,
});
});

await test.step('Verify diagnostic info tab', async () => {
await visitObservabilityAlertPage(page);
await visitAlertDetailsPage(page, data.alertDetails);

const diagnosticTab = page.getByRole('tab', { name: /diagnostic info/i });
const diagnosticInfoResponse = page.waitForResponse(
`/api/v1/events/subscriptions/**/diagnosticInfo`
);
await diagnosticTab.click();
await diagnosticInfoResponse;
});

await test.step('Delete alert', async () => {
await deleteAlert(page, data.alertDetails, false);
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to create a separate alert just for the diagnostics info check. Can we add a test for a created alert somewhere above?

@@ -223,12 +222,13 @@ const UserListPageV1 = () => {

const handleShowDeletedUserChange = (value: boolean) => {
handlePageChange(INITIAL_PAGING_VALUE);
handlePageSizeChange(PAGE_SIZE_MEDIUM);
Copy link
Member

Choose a reason for hiding this comment

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

Let's not mix up 2 separate fixes in a single PR. Can you please create a separate PR for the User list?

@@ -61,6 +61,7 @@
"alert-lowercase": "alert",
"alert-lowercase-plural": "alerts",
"alert-plural": "Alerts",
"alert-synced-successfully": "Alert synced successfully",
Copy link
Member

Choose a reason for hiding this comment

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

Let's add these changes to other language files as well, with the respective translations.

Copy link
Contributor

github-actions bot commented Feb 26, 2025

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.41% (41523/65483) 39.09% (16576/42410) 43% (5024/11684)

Comment on lines 55 to 57
.text-grey-muted {
display: inline;
}
Copy link
Member

Choose a reason for hiding this comment

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

The styles do not match the class name we are giving. Use a completely different class with all the stylings if there are many, or just use the pre-defined classes for the specific style. Ex. in this case inline already exists with the display:inline style.

Comment on lines 402 to 404
title={t('label.sync-entity', {
entity: t('label.alert'),
})}>
Copy link
Member

Choose a reason for hiding this comment

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

Ideally this should be Sync Alert Offset

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert: Show a diagnostics tab
3 participants