Configure a different host status webhook per team
Goal
| User story |
|---|
| As a team admin in Fleet, |
| I want to set the host status webhook at the team level, |
| so that I can be notified when a percentage of my team's hosts go offline. |
Changes
Product
- [ ] UI changes: Figma
-
Note from frontend sync: try using new default
useQueryoptions object for this API call
-
Note from frontend sync: try using new default
- [x] Configuration file changes: Figma (should also include
fleetctl gitops) - [x] REST API changes: TODO
- [ ] Outdated documentation changes: Draft PR
- [ ] Changes to paid features or tiers: Premium-only feature (since teams are Premium-only)
Engineering
- [ ] Database schema migrations: TODO
ℹ️ Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".
Context
- Requestor(s): @Patagonia121
QA
Risk assessment
- Requires load testing: No
Manual testing steps
Configuration testing matrix: UI, fleetctl apply, fleetctl gitops (see Figma)
- Make sure the webhook fires when triggered
automationsand contains the correct body. - Make sure the webhook does not fire when conditions are not met.
- Test with a large number of hosts offline (10,000)
Testing notes
Confirmation
- [x] Engineer (@getvictor): Added comment to user story confirming succesful completion of QA.
- [ ] QA (@____): Added comment to user story confirming succesful completion of QA.
Info from the customer:
- Currently, the host status webhook is only triggered based on x% of all enrolled hosts. It would be nice to be able to set thresholds based on team. This could be a global option (trigger when x% of hosts on any team are offline), or configurable for each individual team.
- Example payload:
{ "text": "More than X% of your hosts have not checked into Fleet for more than Y days. You've been sent this message because the Host status webhook is enabled in your Fleet instance.", "data": { "team_id": { "unseen_hosts": 3, "total_hosts": 4, "days_unseen": 3, "host_ids": [4, 8, 15] } } }
Backend - 8pts Frontend - 5 pts
Heads up @sharon-fdm, for some reason, this story (intended to be worked on for 4.44) was never added to the release board in ZenHub.
It looks like this is a ZenHub bug? The :release label was added.
For now, because I think we don't have the space in the current sprint, I brought this one back to the drafting board. So the new target is 4.46 FYI @Patagonia121
Heads up @lukeheath and @georgekarrv: ZenHub is being flakey. Somewhat alarming because this could be happening to other issues?
@noahtalerman Strange. Something to keep an eye on. Is it moving back and forth correctly on the board now?
Is it moving back and forth correctly on the board now?
@lukeheath yes, after removing and re-adding the label (:product or :release)
Thanks for catching this @noahtalerman Do we have a way to report this bug?
Unreleased bugs:
- https://github.com/fleetdm/fleet/issues/17498
- https://github.com/fleetdm/fleet/issues/17496
@jacobshandling Reminder to remove the Epic label that ZenHub automatically adds any time you convert an issue to a "epic". Super annoying that it does this!
Thanks @lukeheath, will do. Sorry about that.
Open docs PR is here: https://github.com/fleetdm/fleet/pull/15612
@rachaelshaw when you get the chance, can you please take this one across the finish line?
Docs PR is merged ✅
@Patagonia121 heads up, this customer request was shipped 🎉
Webhook set per team, In cloud city, alerts stream, Hosts' status gleam.