Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monitoring] Rename ccr fields based on changes in ES #24519

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ exports[`CcrShard that it renders normally 1`] = `
oldestStat={
Object {
"number_of_failed_fetches": 0,
"number_of_operations_indexed": 2976,
"operations_read": 2976,
}
}
stat={
Object {
"fetch_exceptions": Array [],
"read_exceptions": Array [],
"follower_global_checkpoint": 3049,
"follower_index": "follower",
"follower_max_seq_no": 3049,
Expand All @@ -85,13 +85,13 @@ exports[`CcrShard that it renders normally 1`] = `
"number_of_concurrent_writes": 0,
"number_of_failed_bulk_operations": 0,
"number_of_failed_fetches": 0,
"number_of_operations_indexed": 3050,
"operations_read": 3050,
"number_of_queued_writes": 0,
"number_of_successful_bulk_operations": 3050,
"number_of_successful_fetches": 3050,
"operations_received": 3050,
"shard_id": 0,
"time_since_last_fetch_millis": 9402,
"time_since_last_read_millis": 9402,
"total_fetch_time_millis": 44128980,
"total_index_time_millis": 41827,
"total_transferred_bytes": 234156,
Expand Down Expand Up @@ -183,7 +183,7 @@ exports[`CcrShard that it renders normally 1`] = `
language="json"
>
{
"fetch_exceptions": [],
"read_exceptions": [],
"follower_global_checkpoint": 3049,
"follower_index": "follower",
"follower_max_seq_no": 3049,
Expand All @@ -196,13 +196,13 @@ exports[`CcrShard that it renders normally 1`] = `
"number_of_concurrent_writes": 0,
"number_of_failed_bulk_operations": 0,
"number_of_failed_fetches": 0,
"number_of_operations_indexed": 3050,
"operations_read": 3050,
"number_of_queued_writes": 0,
"number_of_successful_bulk_operations": 3050,
"number_of_successful_fetches": 3050,
"operations_received": 3050,
"shard_id": 0,
"time_since_last_fetch_millis": 9402,
"time_since_last_read_millis": 9402,
"total_fetch_time_millis": 44128980,
"total_index_time_millis": 41827,
"total_transferred_bytes": 234156
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class CcrShard extends PureComponent {

renderErrors() {
const { stat } = this.props;
if (stat.fetch_exceptions && stat.fetch_exceptions.length > 0) {
if (stat.read_exceptions && stat.read_exceptions.length > 0) {
return (
<Fragment>
<EuiPanel>
Expand All @@ -61,7 +61,7 @@ export class CcrShard extends PureComponent {
</EuiTitle>
<EuiSpacer size="s"/>
<EuiBasicTable
items={stat.fetch_exceptions}
items={stat.read_exceptions}
columns={[
{
name: 'Type',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('CcrShard', () => {
formattedLeader: 'leader on remote',
metrics: [],
stat: {
fetch_exceptions: [],
read_exceptions: [],
follower_global_checkpoint: 3049,
follower_index: 'follower',
follower_max_seq_no: 3049,
Expand All @@ -26,20 +26,20 @@ describe('CcrShard', () => {
number_of_concurrent_writes: 0,
number_of_failed_bulk_operations: 0,
number_of_failed_fetches: 0,
number_of_operations_indexed: 3050,
operations_read: 3050,
number_of_queued_writes: 0,
number_of_successful_bulk_operations: 3050,
number_of_successful_fetches: 3050,
operations_received: 3050,
shard_id: 0,
time_since_last_fetch_millis: 9402,
time_since_last_read_millis: 9402,
total_fetch_time_millis: 44128980,
total_index_time_millis: 41827,
total_transferred_bytes: 234156,
},
oldestStat: {
number_of_failed_fetches: 0,
number_of_operations_indexed: 2976
operations_read: 2976
},
timestamp: '2018-09-27T13:32:09.412Z'
};
Expand All @@ -54,7 +54,7 @@ describe('CcrShard', () => {
...props,
stat: {
...props.stat,
fetch_exceptions: [
read_exceptions: [
{
type: 'something_is_wrong',
reason: 'not sure but something happened'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export function Status({ stat, formattedLeader, oldestStat }) {
const {
follower_index: followerIndex,
shard_id: shardId,
number_of_operations_indexed: operationsReceived,
operations_read: operationsReceived,
number_of_failed_fetches: failedFetches
} = stat;

const {
number_of_operations_indexed: oldestOperationsReceived,
operations_read: oldestOperationsReceived,
number_of_failed_fetches: oldestFailedFetches
} = oldestStat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ Object {
"calculation": [Function],
"derivative": false,
"description": "The amount of time the follower index is lagging behind the leader.",
"field": "ccr_stats.time_since_last_fetch_millis",
"field": "ccr_stats.time_since_last_read_millis",
"format": "0.[00]",
"label": "Fetch delay",
"metricAgg": "max",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ export const metrics = {
ccr_sync_lag_time: new MillisecondsToSecondsMetric({
title: 'Fetch delay', // title to use for the chart
type: 'ccr',
field: 'ccr_stats.time_since_last_fetch_millis',
field: 'ccr_stats.time_since_last_read_millis',
label: 'Fetch delay',
description: 'The amount of time the follower index is lagging behind the leader.',
format: SMALL_FLOAT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ function buildRequest(req, config, esIndexPattern) {
const aggs = {
ops_synced_max: {
max: {
field: 'ccr_stats.number_of_operations_indexed'
field: 'ccr_stats.operations_read'
}
},
ops_synced_min: {
min: {
field: 'ccr_stats.number_of_operations_indexed'
field: 'ccr_stats.operations_read'
}
},
lag_ops_leader_max: {
Expand Down Expand Up @@ -81,10 +81,10 @@ function buildRequest(req, config, esIndexPattern) {
index: esIndexPattern,
size: maxBucketSize,
filterPath: [
'hits.hits.inner_hits.by_shard.hits.hits._source.ccr_stats.fetch_exceptions',
'hits.hits.inner_hits.by_shard.hits.hits._source.ccr_stats.read_exceptions',
'hits.hits.inner_hits.by_shard.hits.hits._source.ccr_stats.follower_index',
'hits.hits.inner_hits.by_shard.hits.hits._source.ccr_stats.shard_id',
'hits.hits.inner_hits.by_shard.hits.hits._source.ccr_stats.time_since_last_fetch_millis',
'hits.hits.inner_hits.by_shard.hits.hits._source.ccr_stats.time_since_last_read_millis',
'aggregations.by_follower_index.buckets.key',
'aggregations.by_follower_index.buckets.leader_index.buckets.key',
'aggregations.by_follower_index.buckets.by_shard_id.buckets.key',
Expand Down Expand Up @@ -217,9 +217,9 @@ export function ccrRoute(server) {
const fullStat = get(fullStats[`${bucket.key}:${shardBucket.key}`], '[0]', {});
const shardStat = {
shardId: shardBucket.key,
error: fullStat.fetch_exceptions.length ? fullStat.fetch_exceptions[0].exception.type : null,
error: fullStat.read_exceptions.length ? fullStat.read_exceptions[0].exception.type : null,
opsSynced: get(shardBucket, 'ops_synced.value'),
syncLagTime: fullStat.time_since_last_fetch_millis,
syncLagTime: fullStat.time_since_last_read_millis,
syncLagOps: get(shardBucket, 'lag_ops.value'),
syncLagOpsLeader: get(shardBucket, 'leader_lag_ops.value'),
syncLagOpsFollower: get(shardBucket, 'follower_lag_ops.value'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function getCcrStat(req, esIndexPattern, filters) {
filterPath: [
'hits.hits._source.ccr_stats',
'hits.hits._source.timestamp',
'hits.hits.inner_hits.oldest.hits.hits._source.ccr_stats.number_of_operations_indexed',
'hits.hits.inner_hits.oldest.hits.hits._source.ccr_stats.operations_read',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be operations_written.

'hits.hits.inner_hits.oldest.hits.hits._source.ccr_stats.number_of_failed_fetches',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one should be failed_read_requests

],
body: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"metric": {
"app": "elasticsearch",
"field": "ccr_stats.time_since_last_fetch_millis",
"field": "ccr_stats.time_since_last_read_millis",
"metricAgg": "max",
"label": "Fetch delay",
"title": "Fetch delay",
Expand Down Expand Up @@ -63,13 +63,13 @@
"total_index_time_millis": 1096,
"number_of_successful_bulk_operations": 86,
"number_of_failed_bulk_operations": 0,
"number_of_operations_indexed": 86,
"fetch_exceptions": [],
"time_since_last_fetch_millis": 19886
"operations_read": 86,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operations_written

"read_exceptions": [],
"time_since_last_read_millis": 19886
},
"timestamp": "2018-09-19T20:01:00.440Z",
"oldestStat": {
"number_of_failed_fetches": 0,
"number_of_operations_indexed": 1
"operations_read": 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operations_written

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"properties": {
"ccr_stats": {
"properties": {
"fetch_exceptions": {
"read_exceptions": {
"type": "nested",
"properties": {
"exception": {
Expand Down Expand Up @@ -75,7 +75,7 @@
"number_of_failed_fetches": {
"type": "long"
},
"number_of_operations_indexed": {
"operations_read": {
"type": "long"
},
"number_of_queued_writes": {
Expand All @@ -93,7 +93,7 @@
"shard_id": {
"type": "integer"
},
"time_since_last_fetch_millis": {
"time_since_last_read_millis": {
"type": "long"
},
"total_fetch_time_millis": {
Expand Down