Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: add workspace reached resource threshold notification #16250

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

Merged
merged 10 commits into from
Feb 4, 2025

Conversation

DanielleMaywood
Copy link
Contributor

@DanielleMaywood DanielleMaywood commented Jan 24, 2025

Closes coder/internal#247

User Notification Settings:
image

Admin Notification Settings:
image

Out Of Memory notification:
Screenshot 2025-01-30 at 09 36 28

Out Of Disk notifications:
Screenshot 2025-02-04 at 12 27 39

Screenshot 2025-02-04 at 12 27 47

@DanielleMaywood DanielleMaywood marked this pull request as ready for review January 24, 2025 10:48
Copy link
Contributor

@defelmnq defelmnq left a comment

Choose a reason for hiding this comment

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

👌 LGTM !

@stirby for the wording on template.

@stirby
Copy link
Collaborator

stirby commented Jan 28, 2025

@DanielleMaywood I had imagined these being separate notification toggles for disk and memory since they're hardcoded in the template. I realize this is a little late to make that change, would it be overly complex to separate these toggles?

I fear that OOM alerts will be noisy compared to OOD. If the user has to choose both or neither, they may forfeit OOD to mute OOM.

@DanielleMaywood
Copy link
Contributor Author

@DanielleMaywood I had imagined these being separate notification toggles for disk and memory since they're hardcoded in the template. I realize this is a little late to make that change, would it be overly complex to separate these toggles?

I fear that OOM alerts will be noisy compared to OOD. If the user has to choose both or neither, they may forfeit OOD to mute OOM.

I'm happy to just have two separate notifications in this case. @defelmnq What are your thoughts?

@stirby
Copy link
Collaborator

stirby commented Jan 29, 2025

Chatted live, we'll separate these into two notifications.

Copy looks good, I'd recommend a more pop-out header:

Your workspace green-turtle is low on disk

Your workspace green-turtle is low on memory

Then we can keep the more descriptive body as-is.

Labels: map[string]string{
"workspace": "bobby-workspace",
"threshold": "90%",
"volume": "/home/coder",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we only alert on one volume being above threshold at once?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With how this template is written, yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we refactor to accept a slice of volumes please?
As an end-user, I wouldn't find much value in receiving one notification for each volume. We already have memory and volume split which I understand is for practical reasons, but splitting volumes would just add noise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have now done so, have updated the screenshots to show the update notification wording

@@ -0,0 +1,33 @@
INSERT INTO notification_templates
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make these inactive by default? We'll be launching inbox (hopefully) soon after OOM/OOD drops, and duplication would be unfortunate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could do, although I could be convinced to go either way on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@stirby WDYT? I fairly feel strongly that SMTP alerts for these are low value, and webhook is unlikely to be the default method chosen most of the time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer to leave these enabled for user visibility. I think more redundancy is preferred since these are pointing out an error that may lead to loss of work.

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Sweet, thank you! 👍
LGTM

},
},
{
name: "TemplateWorkspaceOutOfDisk",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: same test name twice.

Suggested change
name: "TemplateWorkspaceOutOfDisk",
name: "TemplateWorkspaceOutOfDisk_MultipleVolumes",

Copy link
Contributor

@defelmnq defelmnq left a comment

Choose a reason for hiding this comment

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

All good for me -

Just I see that there's 5 golden files for each SMTP and Webhook, isn't there some of them that should be removed ? (outdated and due to previous generated versions of the PR ?)

Otherwise no need another review from me ✅

Copy link
Collaborator

@stirby stirby left a comment

Choose a reason for hiding this comment

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

Woah, the new templates are fantastic! Awesome work.

@DanielleMaywood
Copy link
Contributor Author

All good for me -

Just I see that there's 5 golden files for each SMTP and Webhook, isn't there some of them that should be removed ? (outdated and due to previous generated versions of the PR ?)

Otherwise no need another review from me ✅

Good catch @defelmnq, will delete the unused ones.

@DanielleMaywood DanielleMaywood merged commit dbad69d into main Feb 4, 2025
30 checks passed
@DanielleMaywood DanielleMaywood deleted the dm-internal-247 branch February 4, 2025 19:25
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve notifier part
4 participants