forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating elasticsearch/ccr metricset with ES ccr_stats API changes (e…
…lastic#9179) Resolves elastic/kibana#25778. The ES CCR API changed a little before the 6.5.0 FF and we didn't catch these changes 😞. This PR updates the CCR metricset code to work with the new ES CCR API response structure. ## Testing this PR 1. Setup CCR: https://www.elastic.co/guide/en/elastic-stack-overview/current/ccr-getting-started.html 2. Checkout this PR and `make` Metricbeat: `cd metricbeat; make` 3. Enable the `elasticsearch` module: `./metricbeat modules enable elasticsearch` 4. Edit `modules.d/elasticsearch.yml` and make sure the `ccr` metricset is enabled and `xpack.enabled: true` is set. 5. Start Metricbeat: `./metricbeat -e` 6. After about 10-20 seconds, check that Metricbeat indexed the correct document of `type` = `ccr_stats` into `.monitoring-es-mb-6-*`.
- Loading branch information
1 parent
d6589d1
commit d4d2e0c
Showing
8 changed files
with
81 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 43 additions & 95 deletions
138
metricbeat/module/elasticsearch/ccr/_meta/test/ccr_stats.700.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,46 @@ | ||
{ | ||
"my_follower": [ | ||
{ | ||
"leader_index": "my_leader", | ||
"follower_index": "my_follower", | ||
"shard_id": 0, | ||
"leader_global_checkpoint": 1, | ||
"leader_max_seq_no": 1, | ||
"follower_global_checkpoint": 1, | ||
"follower_max_seq_no": 1, | ||
"last_requested_seq_no": 1, | ||
"number_of_concurrent_reads": 1, | ||
"number_of_concurrent_writes": 0, | ||
"number_of_queued_writes": 0, | ||
"mapping_version": 2, | ||
"total_fetch_time_millis": 21, | ||
"number_of_successful_fetches": 142, | ||
"number_of_failed_fetches": 6743, | ||
"operations_received": 2, | ||
"total_transferred_bytes": 166, | ||
"total_index_time_millis": 48, | ||
"number_of_successful_bulk_operations": 2, | ||
"number_of_failed_bulk_operations": 0, | ||
"number_of_operations_indexed": 2, | ||
"fetch_exceptions": [ | ||
{ | ||
"from_seq_no": 2, | ||
"retries": 6743, | ||
"exception": { | ||
"type": "exception", | ||
"reason": "NoShardAvailableActionException[No shard available for [Request{fromSeqNo=2, maxOperationCount=1024, shardId=[leader][0], expectedHistoryUUID=ki9Do9c-QQKVydB-6Txkdg, maxOperationSizeInBytes=9223372036854775807}]]; nested: RemoteTransportException[[d0XH9XU][127.0.0.1:9300][indices:data/read/xpack/ccr/shard_changes[s]]]; nested: IndexNotFoundException[no such index];", | ||
"caused_by": { | ||
"type": "no_shard_available_action_exception", | ||
"reason": "No shard available for [Request{fromSeqNo=2, maxOperationCount=1024, shardId=[leader][0], expectedHistoryUUID=ki9Do9c-QQKVydB-6Txkdg, maxOperationSizeInBytes=9223372036854775807}]", | ||
"caused_by": { | ||
"type": "index_not_found_exception", | ||
"reason": "no such index", | ||
"index_uuid": "RH8_j_w0Q0GGmpY0HMVQ_A", | ||
"index": "my_leader" | ||
} | ||
} | ||
"auto_follow_stats": { | ||
"number_of_failed_follow_indices": 0, | ||
"number_of_failed_remote_cluster_state_requests": 0, | ||
"number_of_successful_follow_indices": 1, | ||
"recent_auto_follow_errors": [] | ||
}, | ||
"follow_stats": { | ||
"indices": [ | ||
{ | ||
"index": "follower_index", | ||
"shards": [ | ||
{ | ||
"remote_cluster": "remote_cluster", | ||
"leader_index": "leader_index", | ||
"follower_index": "follower_index", | ||
"shard_id": 0, | ||
"leader_global_checkpoint": 1024, | ||
"leader_max_seq_no": 1536, | ||
"follower_global_checkpoint": 768, | ||
"follower_max_seq_no": 896, | ||
"last_requested_seq_no": 897, | ||
"outstanding_read_requests": 8, | ||
"outstanding_write_requests": 2, | ||
"write_buffer_operation_count": 64, | ||
"follower_mapping_version": 4, | ||
"follower_settings_version": 2, | ||
"total_read_time_millis": 32768, | ||
"total_read_remote_exec_time_millis": 16384, | ||
"successful_read_requests": 32, | ||
"failed_read_requests": 0, | ||
"operations_read": 896, | ||
"bytes_read": 32768, | ||
"total_write_time_millis": 16384, | ||
"write_buffer_size_in_bytes": 1536, | ||
"successful_write_requests": 16, | ||
"failed_write_requests": 0, | ||
"operations_written": 832, | ||
"read_exceptions": [], | ||
"time_since_last_read_millis": 8 | ||
} | ||
} | ||
], | ||
"time_since_last_fetch_millis": 470 | ||
}, | ||
{ | ||
"leader_index": "my_leader", | ||
"follower_index": "my_follower", | ||
"shard_id": 1, | ||
"leader_global_checkpoint": -1, | ||
"leader_max_seq_no": -1, | ||
"follower_global_checkpoint": -1, | ||
"follower_max_seq_no": -1, | ||
"last_requested_seq_no": -1, | ||
"number_of_concurrent_reads": 0, | ||
"number_of_concurrent_writes": 0, | ||
"number_of_queued_writes": 0, | ||
"mapping_version": 2, | ||
"total_fetch_time_millis": 0, | ||
"number_of_successful_fetches": 336, | ||
"number_of_failed_fetches": 0, | ||
"operations_received": 0, | ||
"total_transferred_bytes": 0, | ||
"total_index_time_millis": 0, | ||
"number_of_successful_bulk_operations": 0, | ||
"number_of_failed_bulk_operations": 0, | ||
"number_of_operations_indexed": 0, | ||
"fetch_exceptions": [], | ||
"time_since_last_fetch_millis": 4323 | ||
}, | ||
{ | ||
"leader_index": "my_leader", | ||
"follower_index": "my_follower", | ||
"shard_id": 2, | ||
"leader_global_checkpoint": 1, | ||
"leader_max_seq_no": 1, | ||
"follower_global_checkpoint": 1, | ||
"follower_max_seq_no": 1, | ||
"last_requested_seq_no": 1, | ||
"number_of_concurrent_reads": 0, | ||
"number_of_concurrent_writes": 0, | ||
"number_of_queued_writes": 0, | ||
"mapping_version": 2, | ||
"total_fetch_time_millis": 0, | ||
"number_of_successful_fetches": 372, | ||
"number_of_failed_fetches": 0, | ||
"operations_received": 2, | ||
"total_transferred_bytes": 166, | ||
"total_index_time_millis": 32, | ||
"number_of_successful_bulk_operations": 2, | ||
"number_of_failed_bulk_operations": 0, | ||
"number_of_operations_indexed": 2, | ||
"fetch_exceptions": [], | ||
"time_since_last_fetch_millis": 4323 | ||
} | ||
] | ||
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.