x-pack/solutions/observability/plugins/infra/server/routes/infra/README.md
This endpoint returns a list of hosts and their metrics.
The response includes:
Request
curl --location -u elastic:changeme 'http://0.0.0.0:5601/ftw/api/metrics/infra/host' \
--header 'kbn-xsrf: xxxx' \
--header 'Content-Type: application/json' \
--data '{
"limit": 100,
"metrics": [ "rx", "tx", "memory", "cpu", "diskSpaceUsage", "memoryFree"],
"query": {
"bool": {
"must": [],
"filter": [],
"should": [],
"must_not": []
}
},
"from": "2023-04-18T11:15:31.407Z",
"to": "2023-04-18T11:30:31.407Z"
}'
Response
{
"entityType": "host",
"nodes":[
{
"metadata":[
{
"name":"host.os.name",
"value":null
},
{
"name":"cloud.provider",
"value":null
}
],
"metrics":[
{
"name":"rx",
"value":3959.4930095127706
},
{
"name":"tx",
"value":100.26926542816672
}
{
"name":"memory",
"value":0.542838307852529
},
{
"name":"cpu",
"value":0.13271302652800487
},
{
"name":"diskSpaceUsage",
"value":0
},
{
"name":"memoryFree",
"value":66640704.099216014
},
],
"hasSystemMetrics": true,
"name":"host-0"
}
]
}
This endpoint returns the count of the hosts monitored with the system integration.
The response includes:
Request
curl --location -u elastic:changeme 'http://0.0.0.0:5601/ftw/api/infra/host/count' \
--header 'kbn-xsrf: xxxx' \
--header 'Content-Type: application/json' \
--data '{
"query": {
"bool": {
"must": [],
"filter": [],
"should": [],
"must_not": []
}
},
"from": "2024-07-23T11:34:11.640Z",
"to": "2024-07-23T11:49:11.640Z",
"sourceId": "default"
}'
Response
{"entityType":"host","count":22}