-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adding elasticsearch/ccr metricset (#8335) This PR adds the `elasticsearch/ccr` metricset which collects cross-cluster replication (CCR) stats from the `GET _ccr/stats` Elasticsearch API and indexes them in `metricbeat-*`. (cherry picked from commit 0f2b29a) * Cleaning up CHANGELOG
- Loading branch information
1 parent
ca81155
commit 4f14d66
Showing
20 changed files
with
645 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-metricset-elasticsearch-ccr]] | ||
=== Elasticsearch ccr metricset | ||
|
||
beta[] | ||
|
||
include::../../../module/elasticsearch/ccr/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-elasticsearch,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/elasticsearch/ccr/_meta/data.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
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.
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"@timestamp": "2017-10-12T08:05:34.853Z", | ||
"beat": { | ||
"hostname": "host.example.com", | ||
"name": "host.example.com" | ||
}, | ||
"elasticsearch": { | ||
"ccr": { | ||
"follower": { | ||
"global_checkpoint": 1, | ||
"index": "my_follower", | ||
"operations_indexed": 2, | ||
"shard": { | ||
"number": 0 | ||
}, | ||
"time_since_last_fetch": { | ||
"ms": 4926 | ||
} | ||
}, | ||
"leader": { | ||
"index": "my_leader", | ||
"max_seq_no": 1 | ||
} | ||
}, | ||
"cluster": { | ||
"id": "KSGkOjOuSg6whAgtpPyhQw", | ||
"name": "elasticsearch" | ||
} | ||
}, | ||
"metricset": { | ||
"host": "127.0.0.1:9200", | ||
"module": "elasticsearch", | ||
"name": "ccr", | ||
"rtt": 115 | ||
}, | ||
"service": { | ||
"name": "elasticsearch" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This is the `ccr` metricset of the Elasticsearch module. It interrogates the | ||
Cross Cluster Replication Stats API endpoint to fetch information about shards | ||
in the Elasticsearch cluster that are participating in cross-cluster replication. |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
- name: ccr | ||
type: group | ||
description: > | ||
Cross-cluster replication stats | ||
release: beta | ||
fields: | ||
- name: leader | ||
type: group | ||
fields: | ||
- name: index | ||
type: keyword | ||
description: > | ||
Name of leader index | ||
- name: max_seq_no | ||
type: long | ||
description: > | ||
Maximum sequence number of operation on the leader shard | ||
- name: follower | ||
type: group | ||
fields: | ||
- name: index | ||
type: keyword | ||
description: > | ||
Name of follower index | ||
- name: shard.number | ||
type: long | ||
description: > | ||
Number of the shard within the index | ||
- name: operations_indexed | ||
type: long | ||
description: > | ||
Number of operations indexed (replicated) into the follower shard from the leader shard | ||
- name: time_since_last_fetch.ms | ||
type: long | ||
description: > | ||
Time, in ms, since the follower last fetched from the leader | ||
- name: global_checkpoint | ||
type: long | ||
description: > | ||
Global checkpoint value on follower shard |
98 changes: 98 additions & 0 deletions
98
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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"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" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Oops, something went wrong.