Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add FaultDetectionStats to collect latency and failure metrics #575

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public enum MetricName {
SHARD_STATS,
MASTER_PENDING,
MOUNTED_PARTITION_METRICS,
SHARD_INDEXING_PRESSURE
SHARD_INDEXING_PRESSURE,
FAULT_DETECTION,
}

// we don't store node details as a metric on reader side database. We
Expand Down Expand Up @@ -1099,27 +1100,6 @@ public static class Constants {
}
}

public enum FaultDetectionDimension implements MetricDimension {
SOURCE_NODE_ID(Constants.SOURCE_NODE_ID),
TARGET_NODE_ID(Constants.TARGET_NODE_ID);

private final String value;

FaultDetectionDimension(String value) {
this.value = value;
}

@Override
public String toString() {
return value;
}

public static class Constants {
public static final String SOURCE_NODE_ID = "SourceNodeID";
public static final String TARGET_NODE_ID = "TargetNodeID";
}
}

public enum CommonDimension implements MetricDimension {
INDEX_NAME(Constants.INDEX_NAME_VALUE),
OPERATION(Constants.OPERATION_VALUE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,22 +343,22 @@ public class MetricsModel {
allMetricsInitializer.put(
AllMetrics.FaultDetectionMetric.FOLLOWER_CHECK_LATENCY.toString(),
new MetricAttributes(
MetricUnits.MILLISECOND.toString(), AllMetrics.FaultDetectionDimension.values()));
MetricUnits.MILLISECOND.toString(), AllMetrics.EmptyDimension.values()));

allMetricsInitializer.put(
AllMetrics.FaultDetectionMetric.LEADER_CHECK_LATENCY.toString(),
new MetricAttributes(
MetricUnits.MILLISECOND.toString(), AllMetrics.FaultDetectionDimension.values()));
MetricUnits.MILLISECOND.toString(), AllMetrics.EmptyDimension.values()));

allMetricsInitializer.put(
AllMetrics.FaultDetectionMetric.FOLLOWER_CHECK_FAILURE.toString(),
new MetricAttributes(
MetricUnits.COUNT.toString(), AllMetrics.FaultDetectionDimension.values()));
MetricUnits.COUNT.toString(), AllMetrics.EmptyDimension.values()));

allMetricsInitializer.put(
AllMetrics.FaultDetectionMetric.LEADER_CHECK_FAILURE.toString(),
new MetricAttributes(
MetricUnits.COUNT.toString(), AllMetrics.FaultDetectionDimension.values()));
MetricUnits.COUNT.toString(), AllMetrics.EmptyDimension.values()));

allMetricsInitializer.put(
AllMetrics.MasterThrottlingValue.MASTER_THROTTLED_PENDING_TASK_COUNT.toString(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.metrics;

import com.amazon.opendistro.elasticsearch.performanceanalyzer.metrics.AllMetrics;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.metricsdb.Metric;

public class FollowerCheck_Failure extends Metric {
public FollowerCheck_Failure(long evaluationIntervalSeconds) {
super(AllMetrics.FaultDetectionMetric.FOLLOWER_CHECK_FAILURE.name(), evaluationIntervalSeconds);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.metrics;

import com.amazon.opendistro.elasticsearch.performanceanalyzer.metrics.AllMetrics;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.Metric;

public class FollowerCheck_Latency extends Metric {
public FollowerCheck_Latency(long evaluationIntervalSeconds) {
super(AllMetrics.FaultDetectionMetric.FOLLOWER_CHECK_LATENCY.name(), evaluationIntervalSeconds);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.metrics;

import com.amazon.opendistro.elasticsearch.performanceanalyzer.metrics.AllMetrics;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.metricsdb.Metric;

public class LeaderCheck_Failure extends Metric {
public LeaderCheck_Failure(long evaluationIntervalSeconds) {
super(AllMetrics.FaultDetectionMetric.LEADER_CHECK_FAILURE.name(), evaluationIntervalSeconds);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.metrics;

import com.amazon.opendistro.elasticsearch.performanceanalyzer.metrics.AllMetrics;
import com.amazon.opendistro.elasticsearch.performanceanalyzer.metricsdb.Metric;

public class LeaderCheck_Latency extends Metric {
public LeaderCheck_Latency(long evaluationIntervalSeconds) {
super(AllMetrics.FaultDetectionMetric.LEADER_CHECK_LATENCY.name(), evaluationIntervalSeconds);
}
}

This file was deleted.

Loading