Skip to content

Commit

Permalink
Minor: Adding JSON_PARSER_ERROR and CONFIG_OVERRIDES_SER_FAILED (open…
Browse files Browse the repository at this point in the history
…search-project#366)

Signed-off-by: Khushboo Rajput <khushbr@amazon.com>
  • Loading branch information
khushbr authored May 17, 2023
1 parent e420988 commit 744f4e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ public enum ExceptionsAndErrors implements MeasurementSet {
INVALID_CONFIG_RCA_AGENT_STOPPED("InvalidConfigRCAAgentStopped"),
RCA_FRAMEWORK_CRASH("RcaFrameworkCrash"),
CONFIG_DIR_NOT_FOUND("ConfigDirectoryNotFound"),
CONFIG_OVERRIDES_SER_FAILED("ConfigOverridesSerFailed"),
WRITE_UPDATED_RCA_CONF_ERROR("WriteUpdatedRcaConfError"),
BATCH_METRICS_CONFIG_ERROR("BatchMetricsConfigError"),
MUTE_ERROR("MuteError"),
JSON_PARSER_ERROR("JsonParserError", "namedCount", Statistics.NAMED_COUNTERS),

/**
* Aggregate metrics across RCA Graph nodes tracking failure in various staged of RCA Graph
Expand Down Expand Up @@ -54,15 +56,10 @@ public enum ExceptionsAndErrors implements MeasurementSet {
/** Thread ID is no loner exists */
JVM_THREAD_ID_NO_LONGER_EXISTS("JVMThreadIdNoLongerExists"),

/** This metric indicates failure in collecting ClusterManagerServiceEventMetrics */
CLUSTER_MANAGER_METRICS_ERROR("ClusterManagerMetricsError"),

/** This metric indicates cluster_manager is not up */
CLUSTER_MANAGER_NODE_NOT_UP("ClusterManagerNodeNotUp"),

/** This metric indicates faiure in intercepting opensearch requests at transport channel */
OPENSEARCH_REQUEST_INTERCEPTOR_ERROR("OpenSearchRequestInterceptorError"),

/** Metrics tracking RCA Agent level: 1. Errors 2. Exceptions */
/** This metric indicates metric entry insertion to event log queue failed */
METRICS_WRITE_ERROR("MetricsWriteError", "namedCount", Statistics.NAMED_COUNTERS),

Expand All @@ -85,6 +82,9 @@ public enum ExceptionsAndErrors implements MeasurementSet {
/** This metric indicates that error occurred while closing metrics db. */
METRICS_DB_CLOSURE_ERROR("MetricsDbClosureError", "namedCount", Statistics.NAMED_COUNTERS),

/** When the reader encounters errors accessing metricsdb files. */
READER_METRICSDB_ACCESS_ERRORS("ReaderMetricsdbAccessError"),

/** This metric indicates that error occurred while closing database connection. */
IN_MEMORY_DATABASE_CONN_CLOSURE_ERROR(
"InMemoryDatabaseConnClosureError", "namedCount", Statistics.NAMED_COUNTERS),
Expand All @@ -94,11 +94,13 @@ public enum ExceptionsAndErrors implements MeasurementSet {
BATCH_METRICS_HTTP_HOST_ERROR("BatchMetricsHttpHostError"),
BATCH_METRICS_EXCEEDED_MAX_DATAPOINTS("ExceededBatchMetricsMaxDatapoints"),

/** When the reader encounters errors accessing metricsdb files. */
READER_METRICSDB_ACCESS_ERRORS("ReaderMetricsdbAccessError"),
/** Below track Collector specific Errors. */
THREADPOOL_METRICS_COLLECTOR_ERROR("ThreadPoolMetricsCollectorError"),
SHARD_STATE_COLLECTOR_ERROR("ShardStateCollectorError"),
ADMISSION_CONTROL_COLLECTOR_ERROR("AdmissionControlCollectorError"),
CIRCUIT_BREAKER_COLLECTOR_ERROR("CircuitBreakerCollectorError"),
CLUSTER_MANAGER_METRICS_ERROR("ClusterManagerMetricsError"),
CLUSTER_MANAGER_NODE_NOT_UP("ClusterManagerNodeNotUp"),
CLUSTER_MANAGER_THROTTLING_COLLECTOR_ERROR("ClusterManagerThrottlingMetricsCollectorError"),
FAULT_DETECTION_COLLECTOR_ERROR("FaultDetectionMetricsCollectorError"),
CLUSTER_APPLIER_SERVICE_STATS_COLLECTOR_ERROR("ClusterApplierServiceStatsCollectorError"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public enum WriterMetrics implements MeasurementSet {
"ClusterApplierServiceStatsCollectorExecutionTime",
"millis",
Arrays.asList(Statistics.MAX, Statistics.MEAN, Statistics.SUM)),
ADMISSION_CONTROL_METRICS_COLLECTOR_EXECUTION_TIME(
"AdmissionControlMetricsCollectorExecutionTime",
ADMISSION_CONTROL_COLLECTOR_EXECUTION_TIME(
"AdmissionControlCollectorExecutionTime",
"millis",
Arrays.asList(Statistics.MAX, Statistics.MEAN, Statistics.SUM)),
ELECTION_TERM_COLLECTOR_EXECUTION_TIME(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jooq.BatchBindStep;
import org.opensearch.performanceanalyzer.PerformanceAnalyzerApp;
import org.opensearch.performanceanalyzer.collectors.StatExceptionCode;
import org.opensearch.performanceanalyzer.collectors.StatsCollector;
import org.opensearch.performanceanalyzer.metrics.AllMetrics;
import org.opensearch.performanceanalyzer.metrics.PerformanceAnalyzerMetrics;
import org.opensearch.performanceanalyzer.rca.framework.metrics.ExceptionsAndErrors;
import org.opensearch.performanceanalyzer.reader_writer_shared.Event;
import org.opensearch.performanceanalyzer.util.JsonConverter;
import org.opensearch.performanceanalyzer.util.JsonPathNotFoundException;
Expand Down Expand Up @@ -157,7 +159,8 @@ private boolean processEvent(
"Malformed json (%s) ExceptionCode: %s",
lines[0], StatExceptionCode.JSON_PARSER_ERROR.toString()),
ex);
StatsCollector.instance().logException(StatExceptionCode.JSON_PARSER_ERROR);
PerformanceAnalyzerApp.ERRORS_AND_EXCEPTIONS_AGGREGATOR.updateStat(
ExceptionsAndErrors.JSON_PARSER_ERROR, this.getClass().getSimpleName(), 1);
return false;
} catch (IOException ex) {
LOG.warn(
Expand Down

0 comments on commit 744f4e3

Please sign in to comment.