Skip to content

Commit

Permalink
Health api drill down (#85234)
Browse files Browse the repository at this point in the history
This commit does two things:
(1) It allows drilling down into the _internal/_health API. So in addition to GET _internal/_health, you can also drill down into a component, like GET _internal/_health/data for the data component. And you can drill down into an individual indicator, like GET _internal/_health/data/ilm for the ilm indicator within the data component.
(2) It prevents details from being calculated or returned when calling the top-level API. This is to avoid the performance cost of calculating and sending those for each indicator at once.
  • Loading branch information
masseyke committed Apr 11, 2022
1 parent 00d01fc commit 605fd4d
Show file tree
Hide file tree
Showing 23 changed files with 537 additions and 146 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/85234.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 85234
summary: Health api drill down
area: Health
type: feature
issues:
- 84793
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@
"methods":[
"GET"
]
},
{
"path":"/_internal/_health/{component}",
"methods":[
"GET"
],
"parts":{
"component":{
"type":"string",
"description":"A component of the cluster, as returned by the top-level health API"
}
}
},
{
"path":"/_internal/_health/{component}/{feature}",
"methods":[
"GET"
],
"parts":{
"component":{
"type":"string",
"description":"A component of the cluster, as returned by the top-level health API"
},
"feature":{
"type":"string",
"description":"A feature of a component of the cluster, as returned by the top-level health API"
}
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@
- match: { components.cluster_coordination.status: "green" }
- match: { components.cluster_coordination.indicators.instance_has_master.status: "green" }
- match: { components.cluster_coordination.indicators.instance_has_master.summary: "Health coordinating instance has a master node." }
- is_true: components.cluster_coordination.indicators.instance_has_master.details.coordinating_node.node_id
- is_true: components.cluster_coordination.indicators.instance_has_master.details.coordinating_node.name
- is_true: components.cluster_coordination.indicators.instance_has_master.details.master_node.node_id
- is_true: components.cluster_coordination.indicators.instance_has_master.details.master_node.name
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"cluster health test drilling down into a component":
- skip:
version: "- 8.2.99"
reason: "health drilldown was only added in 8.3.0"

- do:
_internal.health:
component: cluster_coordination

- is_true: cluster_name
- match: { components.cluster_coordination.status: "green" }
- match: { components.cluster_coordination.indicators.instance_has_master.status: "green" }
- match: { components.cluster_coordination.indicators.instance_has_master.summary: "Health coordinating instance has a master node." }
- is_true: components.cluster_coordination.indicators.instance_has_master.details.coordinating_node.node_id
- is_true: components.cluster_coordination.indicators.instance_has_master.details.coordinating_node.name
- is_true: components.cluster_coordination.indicators.instance_has_master.details.master_node.node_id
- is_true: components.cluster_coordination.indicators.instance_has_master.details.master_node.name
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"cluster health test drilling down into a component and a feature":
- skip:
version: "- 8.2.99"
reason: "health drilldown was only added in 8.3.0"

- do:
_internal.health:
component: cluster_coordination
feature: instance_has_master

- is_true: cluster_name
- match: { components.cluster_coordination.indicators.instance_has_master.status: "green" }
- match: { components.cluster_coordination.indicators.instance_has_master.summary: "Health coordinating instance has a master node." }
- is_true: components.cluster_coordination.indicators.instance_has_master.details.coordinating_node.node_id
- is_true: components.cluster_coordination.indicators.instance_has_master.details.coordinating_node.name
- is_true: components.cluster_coordination.indicators.instance_has_master.details.master_node.node_id
- is_true: components.cluster_coordination.indicators.instance_has_master.details.master_node.name

0 comments on commit 605fd4d

Please sign in to comment.