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

Implement CHART source alert (scheduled task) #108

Merged
merged 26 commits into from
Nov 17, 2023

Conversation

wrn14897
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Nov 17, 2023

🦋 Changeset detected

Latest commit: 22b4432

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/api Minor
@hyperdx/app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wrn14897 wrn14897 changed the title [WIP] Implement CHART source alert Implement CHART source alert Nov 17, 2023
@wrn14897 wrn14897 changed the title Implement CHART source alert Implement CHART source alert (scheduled task) Nov 17, 2023
}) => {
const searchQuery = alert.groupBy
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move this to buildLogEventSlackMessage

Comment on lines +1403 to +1404
count(*) as data,
toUnixTimestamp(toStartOfInterval(timestamp, INTERVAL ?)) as ts_bucket
Copy link
Contributor Author

@wrn14897 wrn14897 Nov 17, 2023

Choose a reason for hiding this comment

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

to be consistent with the output of getLogsChart. eventually this method will be replaced by it

Comment on lines 104 to 114
const mrkdwn = [
`*<${buildChartLink({
dashboardId: dashboard.id,
endTime,
granularity,
startTime,
})} | Alert for "${dashboard.chart.name}" in "${dashboard.name}">*`,
`${totalCount} lines found, expected ${
alert.type === 'presence' ? 'less than' : 'greater than'
} ${alert.threshold} lines`,
].join('\n');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lmk if we need to add more details to the alert UI

packages/api/src/models/dashboard.ts Outdated Show resolved Hide resolved
packages/api/src/tasks/checkAlerts.ts Outdated Show resolved Hide resolved
packages/api/src/tasks/checkAlerts.ts Outdated Show resolved Hide resolved
packages/api/src/tasks/checkAlerts.ts Outdated Show resolved Hide resolved
packages/api/src/tasks/checkAlerts.ts Show resolved Hide resolved
packages/api/src/tasks/checkAlerts.ts Outdated Show resolved Hide resolved
packages/api/src/tasks/checkAlerts.ts Outdated Show resolved Hide resolved
MikeShi42
MikeShi42 previously approved these changes Nov 17, 2023
Copy link
Contributor

@MikeShi42 MikeShi42 left a comment

Choose a reason for hiding this comment

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

🚢🚢🚢🚢!!!!

@wrn14897 wrn14897 merged commit 8443a08 into main Nov 17, 2023
3 checks passed
@wrn14897 wrn14897 deleted the warren/implement-chart-alert branch November 17, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants