Skip to content

Commit

Permalink
Fixes error logging
Browse files Browse the repository at this point in the history
Signed-off-by: Gagan Juneja <gjjuneja@amazon.com>
  • Loading branch information
Gagan Juneja committed Jun 10, 2024
1 parent 5860387 commit 85e49d7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.common.cache.Cache;
import org.opensearch.indices.IndicesService;
import org.opensearch.performanceanalyzer.OpenSearchResources;
Expand All @@ -43,6 +45,7 @@ public class CacheConfigMetricsCollector extends PerformanceAnalyzerMetricsColle
implements MetricsProcessor {
public static final int SAMPLING_TIME_INTERVAL =
MetricsConfiguration.CONFIG_MAP.get(CacheConfigMetricsCollector.class).samplingInterval;
private static final Logger LOG = LogManager.getLogger(CacheConfigMetricsCollector.class);
private static final int KEYS_PATH_LENGTH = 0;
private StringBuilder value;

Expand Down Expand Up @@ -122,7 +125,7 @@ public void collectMetrics(long startTime) {
SHARD_REQUEST_CACHE.toString(),
requestCacheMaxSize);
} catch (Exception e) {
e.printStackTrace();
LOG.error("Error while evaluating requestCacheMaxSize", e);
return null;
}
});
Expand Down

0 comments on commit 85e49d7

Please sign in to comment.