fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Add new `missing_10_days_count ` property to the `GET /host_summary` endpoint

Open lukeheath opened this issue 3 years ago • 6 comments

Problem

I'm an engineer managing thousands of hosts and I'm overwhelmed with tracking this goal:

  • Know how many hosts, and which hosts, are missing.

This makes it hard to troubleshoot why a host is missing. Is the user on a longer vacation? Is the host stolen? Is the host is someone's closet? Is the host broken?

Goals

  1. Know how many hosts are missing.

Requirements

  • Fleet Premium users can see how many hosts (count) have not been online in the last 10 days.
  • The Fleet API supports adding more intervals in the future. For example, later, we may want to add the ability to see how many hosts have not been online in the last 30 days.

Related

  • #6435 (epic)
  • #7588
  • #7589 (blocked)

Figma

https://www.figma.com/file/hdALBDsrti77QuDNSzLdkx/%F0%9F%9A%A7-Fleet-EE-(dev-ready%2C-scratchpad)?node-id=9223%3A304723

API Specs

{
  "totals_hosts_count": 25,
  "online_count": 13,
  "offline_count": 12,
  "mia_count": 0,
  "new_count": 0,
  "missing_10_days_count": 5,
  "all_linux_count": 3,
  "builtin_labels": [
    {
      "id": 6,
      "name": "All Hosts",
      "description": "All hosts which have enrolled in Fleet",
      "label_type": "builtin"
    },
    ...
  ],
  "platforms": [
    {
      "platform": "darwin",
      "hosts_count": 21
    },
    ...
  ]
}

Tasks

1

  • [x] Add new missing_10_days_count property to the GET /host_summary endpoint.
  • This number is calculated as hosts that have a seen_time greater than 10 days.
  • This property should also populate when filtered results by team_id. For example: GET /api/v1/fleet/host_summary?team_id=1

lukeheath avatar Sep 06 '22 14:09 lukeheath

@mna New backend ticket that I spec'd. Would you please review and let me know if you have any questions or concerns before estimation? Thanks!

lukeheath avatar Sep 06 '22 15:09 lukeheath

@lukeheath The mia_count property is already the number of hosts missing for 30 days (seen_time greater than 30 days). We just want to add a new count that is for 10 days? I think the naming of those fields will be quite confusing - it's not obvious what is mia_count vs missing_count (and to some extent, offline_count).

mna avatar Sep 07 '22 13:09 mna

@mna Good call out. The same thing occurred to me. mia_count is an old prop we are planning to remove at Fleet v5. For missing_count, I thought about adding the day count to the name so it's something like missing_10_days_count, but I'm not 100% certain that the number won't be configurable in the future. to something other than 10.

@noahtalerman What do you think?

lukeheath avatar Sep 07 '22 13:09 lukeheath

@noahtalerman Assigning to you for product perspective on property naming.

lukeheath avatar Sep 07 '22 15:09 lukeheath

@lukeheath I propose adding a missing_10_days_count and keep the plan of removing mia_count in Fleet 5.

Options and reasoning for how I reached this proposal are below. What do you think?

Options:

  • Add missing_count now and remove mia in Fleet 5
  • Add missing_10_days_count and remove mia in Fleet 5
  • Update mia_count from 30 days to 10 days

Reasoning:

  • It's likely that we will add ability to filter the count by more intervals (7 days, 30 days, etc.) in the future. I think missing_10_days_count set us up for this future.
  • It's unlikely that this number of days will be configurable in the future.

noahtalerman avatar Sep 09 '22 15:09 noahtalerman

I propose adding a missing_10_days_count and keep the plan of removing mia_count in Fleet 5.

@noahtalerman Thanks for your feedback. I agree, adding missing_10_days sets us up for future related properties. I've updated the specs to reflect the new name.

lukeheath avatar Sep 09 '22 17:09 lukeheath