Skip to content

Commit

Permalink
Added metrics to _nodes/stats.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Jul 16, 2024
1 parent b2af866 commit 3fba593
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added support for skipping tests using semver range ([#410](https://github.com/opensearch-project/opensearch-api-specification/pull/410))
- Added `cluster_manager_timeout` to `HEAD /{index}` ([#421](https://github.com/opensearch-project/opensearch-api-specification/pull/421))
- Added missing fields to `/_nodes/stats` ([#415](https://github.com/opensearch-project/opensearch-api-specification/pull/415))
- Added missing metrics options to `/_nodes/stats` ([#422](https://github.com/opensearch-project/opensearch-api-specification/pull/422))

### Changed

Expand Down
15 changes: 15 additions & 0 deletions spec/schemas/nodes.stats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,33 @@ components:
type: string
enum:
- _all
- adaptive_selection
- admission_control
- breaker
- caches
- cluster_manager_throttling
- discovery
- file_cache
- fs
- http
- indexing_pressure
- indices
- ingest
- jvm
- os
- process
- repositories
- resource_usage_stats
- shard_indexing_pressure
- segment_replication_backpressure

Check failure on line 31 in spec/schemas/nodes.stats.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected sequence values to be in ascending order. 'segment_replication_backpressure' should be before 'shard_indexing_pressure'
- search_backpressure

Check failure on line 32 in spec/schemas/nodes.stats.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected sequence values to be in ascending order. 'search_backpressure' should be before 'segment_replication_backpressure'
- search_pipeline
- script

Check failure on line 34 in spec/schemas/nodes.stats.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected sequence values to be in ascending order. 'script' should be before 'search_pipeline'
- script_cache
- task_cancellation
- thread_pool
- transport
- weighted_routing
IndexMetric:
type: string
enum:
Expand Down
9 changes: 8 additions & 1 deletion tests/nodes/info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ $schema: ../../json_schemas/test_story.schema.yaml

description: Test nodes endpoints.
chapters:
- synopsis: Nodes with a json response.
- synopsis: Get all nodes.
path: /_nodes
method: GET
response:
status: 200
- synopsis: Get nodes.
path: /_nodes/{node_id_or_metric}
method: GET
parameters:
node_id_or_metric: indices
response:
status: 200
149 changes: 148 additions & 1 deletion tests/nodes/stats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,155 @@ $schema: ../../json_schemas/test_story.schema.yaml

description: Test nodes stats.
chapters:
- synopsis: Get all nodes stats.
- synopsis: Get stats for all nodes.
path: /_nodes/stats
method: GET
response:
status: 200
- synopsis: Get stats for all nodes with parameters.
path: /_nodes/stats
method: GET
parameters:
completion_fields: '*'
fielddata_fields: '*'
fields: '*'
groups:
- '*'
timeout: 10s
include_segment_file_sizes: true
response:
status: 200
- synopsis: Get _all node stats (node_id).
path: /_nodes/{node_id}/stats
method: GET
parameters:
node_id: _all
response:
status: 200
- synopsis: Get fs metic node stats (metric).
path: /_nodes/stats/{metric}
method: GET
parameters:
metric:
- fs
response:
status: 200
- synopsis: Get fs metric node stats (node_id_or_metric).
path: /_nodes/{node_id_or_metric}
method: GET
parameters:
node_id_or_metric: fs
response:
status: 200
- synopsis: Get jvm and fs metric node stats from data nodes.
path: /_nodes/{node_id}/stats/{metric}
method: GET
parameters:
node_id: data:true
metric:
- fs
- jvm
response:
status: 200
- synopsis: Get statistics for the request_cache.
path: /_nodes/stats/{metric}/{index_metric}
method: GET
parameters:
metric:
- adaptive_selection
- breaker
- discovery
- fs
- http
- indexing_pressure
- ingest
- indices

Check failure on line 67 in tests/nodes/stats.yaml

View workflow job for this annotation

GitHub Actions / lint

Expected sequence values to be in ascending order. 'indices' should be before 'ingest'
- jvm
- os
- process
- script
- script_cache
- shard_indexing_pressure
- thread_pool
- transport
index_metric:
- request_cache
response:
status: 200
- synopsis: Get statistics for the request_cache (2.4).
path: /_nodes/stats/{metric}/{index_metric}
method: GET
version: '>= 2.4'
parameters:
metric:
- indices
- search_backpressure
index_metric:
- request_cache
response:
status: 200
- synopsis: Get statistics for the request_cache (2.6).
path: /_nodes/stats/{metric}/{index_metric}
method: GET
version: '>= 2.6'
parameters:
metric:
- cluster_manager_throttling
- indices
- weighted_routing
index_metric:
- request_cache
response:
status: 200
- synopsis: Get statistics for the request_cache (2.7).
path: /_nodes/stats/{metric}/{index_metric}
method: GET
version: '>= 2.7'
parameters:
metric:
- file_cache
- indices
index_metric:
- request_cache
response:
status: 200
- synopsis: Get statistics for the request_cache (2.9).
path: /_nodes/stats/{metric}/{index_metric}
method: GET
version: '>= 2.9'
parameters:
metric:
- indices
- search_pipeline
- task_cancellation
index_metric:
- request_cache
response:
status: 200
- synopsis: Get statistics for the request_cache (2.12).
path: /_nodes/stats/{metric}/{index_metric}
method: GET
version: '>= 2.12'
parameters:
metric:
- admission_control
- indices
- repositories
- resource_usage_stats
- segment_replication_backpressure
index_metric:
- request_cache
response:
status: 200
- synopsis: Get statistics for the request_cache (2.14).
path: /_nodes/stats/{metric}/{index_metric}
method: GET
version: '>= 2.14'
parameters:
metric:
- caches
- indices
index_metric:
- request_cache
response:
status: 200

0 comments on commit 3fba593

Please sign in to comment.