Skip to content

Add API endpoint warnings#47841

Draft
spalmesano0 wants to merge 2 commits into
mainfrom
api-warnings
Draft

Add API endpoint warnings#47841
spalmesano0 wants to merge 2 commits into
mainfrom
api-warnings

Conversation

@spalmesano0

Copy link
Copy Markdown
Member

Discussed on Slack.

@rfairburn Can you give this a quick look? Mainly the line about using query and setting device_mapping=true.

Comment thread docs/REST API/rest-api.md
| exclude_software | boolean | query | If `true`, the response will not include a list of installed software for the host. |
| exclude_fleet_maintained_policies | boolean | query | If `true`, will omit Fleet-maintained policies from the policies list. |

> If you're hitting this endpoint often (e.g. every hour) for a large number of hosts (e.g. 1k+) the best practice is to set the `exclude_software` to `true` to prevent overloading the Fleet server.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@spalmesano0 I think let's move this to the top of this section, right below the "Get host" header. That way we're consistent w/ the "Get host by Fleet Desktop token":

Image

Comment thread docs/REST API/rest-api.md

> `populate_software` returns a lot of data per host when set, and drastically more data when set to `true` on Fleet Premium. If you need vulnerability details for a large number of hosts, consider setting `populate_software` to `without_vulnerability_details` and pulling vulnerability details from the [Get vulnerability](#get-vulnerability) endpoint, as this returns details once per vulnerability rather than once per vulnerability per host.

> Searching with `query` and setting `device_mapping=true` are each expensive, and combining them is more so. If you're hitting this endpoint often the best practice is to reduce how frequently you call it to prevent overloading the Fleet server.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
> Searching with `query` and setting `device_mapping=true` are each expensive, and combining them is more so. If you're hitting this endpoint often the best practice is to reduce how frequently you call it to prevent overloading the Fleet server.
> Searching with `query` and setting `device_mapping=true` are each expensive, and combining them is more so. If you're running a scheduled job that hits this endpoint, the best practice is to run it no more than once per hour to avoid overloading the Fleet server.

@spalmesano0 I tweaked the language to add a specific suggestion but totally guessed on once per hour...is it right? Can we give a faster best practice? 30 minutes?

Also, I think let's move this performance warning to the top of the section: https://github.com/fleetdm/fleet/pull/47841/changes#r3437435430

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@rfairburn said this was originally triggered after hitting it with ~10 req/sec. I'd defer to him on the infrastructure recommendation, though I imagine once every few minutes wouldn't be bad.

@noahtalerman I think the placement of the Get host by Fleet Desktop token warning right under the endpoint title may have been a mistake (probably made by me!), as the warnings for List hosts and List software versions were already under parameters.
With that in mind, do you still want me to move the warnings for the four endpoints here and List software versions near the title?

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.

2 participants