Skip to content

Commit

Permalink
1. add an error log if parse prom port failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gujiawei-Edinburgh committed Dec 12, 2024
1 parent 880a5fd commit e7ab0a0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.baidu.demo.plugin.util;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class VariableUtil {
private static final String PLUGIN_PROMETHEUS_PORT = "PLUGIN_PROMETHEUS_PORT";
private static final String PLUGIN_PROMETHEUS_CONTEXT = "PLUGIN_PROMETHEUS_CONTEXT";
Expand All @@ -15,6 +18,7 @@ public static int getPort() {
try {
return Integer.parseUnsignedInt(prometheusPort);
} catch (Throwable e) {
log.error("Parse prometheus port: {} error, use default port", prometheusPort, e);
return DEFAULT_PORT;
}
}
Expand Down

0 comments on commit e7ab0a0

Please sign in to comment.