fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Configure a different host status webhook per team

Open Patagonia121 opened this issue 2 years ago • 6 comments

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 useQuery options object for this API call
  • [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)

  1. Make sure the webhook fires when triggered automations and contains the correct body.
  2. Make sure the webhook does not fire when conditions are not met.
  3. Test with a large number of hosts offline (10,000)

Testing notes

Confirmation

  1. [x] Engineer (@getvictor): Added comment to user story confirming succesful completion of QA.
  2. [ ] QA (@____): Added comment to user story confirming succesful completion of QA.

Patagonia121 avatar Nov 03 '23 04:11 Patagonia121

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]
        }
      }
    }
    

noahtalerman avatar Nov 28 '23 16:11 noahtalerman

Backend - 8pts Frontend - 5 pts

sharon-fdm avatar Jan 03 '24 20:01 sharon-fdm

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 avatar Feb 01 '24 17:02 noahtalerman

@noahtalerman Strange. Something to keep an eye on. Is it moving back and forth correctly on the board now?

lukeheath avatar Feb 01 '24 19:02 lukeheath

Is it moving back and forth correctly on the board now?

@lukeheath yes, after removing and re-adding the label (:product or :release)

noahtalerman avatar Feb 02 '24 14:02 noahtalerman

Thanks for catching this @noahtalerman Do we have a way to report this bug?

sharon-fdm avatar Feb 02 '24 14:02 sharon-fdm

Unreleased bugs:

  • https://github.com/fleetdm/fleet/issues/17498
  • https://github.com/fleetdm/fleet/issues/17496

getvictor avatar Mar 08 '24 16:03 getvictor

@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!

lukeheath avatar Mar 11 '24 17:03 lukeheath

Thanks @lukeheath, will do. Sorry about that.

jacobshandling avatar Mar 11 '24 17:03 jacobshandling

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?

noahtalerman avatar Apr 04 '24 18:04 noahtalerman

Docs PR is merged ✅

rachaelshaw avatar Apr 11 '24 16:04 rachaelshaw

@Patagonia121 heads up, this customer request was shipped 🎉

noahtalerman avatar Apr 11 '24 18:04 noahtalerman

Webhook set per team, In cloud city, alerts stream, Hosts' status gleam.

fleet-release avatar Apr 11 '24 18:04 fleet-release