Skip to main content

agents

Creates, updates, deletes, gets or lists an agents resource.

Overview

Nameagents
TypeResource
Iddatadog.fleet.agents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique agent key identifier. (example: a1b2c3d4e5f67890a1b2c3d4e5f67890)
attributesobjectAttributes for the v2 agent detail response.
typestringThe type of the agent resource. (agent) (default: agent, example: agent)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_fleet_agent_detail_v2selectagent_keyincludeRetrieve detailed information about a specific Datadog Agent.<br /><br />By default, only agent_infos is returned. Use the include query parameter to<br />request additional data: integrations and/or configuration_files.
list_fleet_agents_v2selectpage_number, page_size, filter, tags, sort_attribute, sort_descendingRetrieve a paginated list of Datadog Agents.<br /><br />Returns agents with support for pagination, sorting, and filtering.<br />Use page_number and page_size to navigate pages, filter to narrow by field values,<br />and tags to filter by agent tags.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
agent_keystringThe unique identifier (Agent key) for the Datadog Agent. Must be a 32-character lowercase hexadecimal string. (example: a1b2c3d4e5f67890a1b2c3d4e5f67890)
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
filterstringFilter string to narrow down agent results. (example: hostname:my-hostname OR env:dev)
includestringComma-separated list of additional fields to include in the response. Valid values are integrations and configuration_files. Omitting this parameter returns only agent_infos. Unrecognized values are silently ignored rather than causing an error. (example: integrations,configuration_files)
page_numberinteger (int64)Page number for pagination, starting at 0.
page_sizeinteger (int64)Number of agents to return per page. Maximum value is 100. Defaults to 10.
sort_attributestringAgent attribute to sort results by. Must be a supported attribute name; unsupported values return a 400 error.
sort_descendingbooleanSet to true to sort results in descending order. Defaults to ascending.
tagsstringComma-separated list of tag keys to select which tags are included in each agent's tags attribute. Does not filter which agents are returned.

SELECT examples

Retrieve detailed information about a specific Datadog Agent.<br /><br />By default, only agent_infos is returned. Use the include query parameter to<br />request additional data: integrations and/or configuration_files.

SELECT
id,
attributes,
type
FROM datadog.fleet.agents
WHERE agent_key = '{{ agent_key }}' -- required
AND include = '{{ include }}'
;