Skip to content

Commit 857ac4d

Browse files
committed
post-review changes
1 parent dc064db commit 857ac4d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/JmxScraper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ public static void main(String[] args) {
8181
JmxScraper jmxScraper = new JmxScraper(connectorBuilder, service, scraperConfig);
8282
jmxScraper.start();
8383
} catch (ConfigurationException e) {
84-
logger.log(Level.SEVERE, "ERROR: invalid configuration ", e);
84+
logger.log(Level.SEVERE, "invalid configuration ", e);
8585
System.exit(1);
8686
} catch (ArgumentsParsingException e) {
87-
logger.log(Level.SEVERE, "ERROR: invalid configuration provided through arguments", e);
87+
logger.log(Level.SEVERE, "invalid configuration provided through arguments", e);
8888
logger.info(
8989
"Usage: java -jar <path_to_jmxscraper.jar> "
9090
+ "-config <path_to_config.properties or - for stdin>");

jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/config/JmxScraperConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ public static JmxScraperConfig fromConfig(ConfigProperties config) {
137137
scraperConfig.serviceUrl = serviceUrl;
138138

139139
// TODO: we could support multiple values
140-
String customConfig = config.getString(JMX_CUSTOM_CONFIG);
140+
String customConfig = config.getString(JMX_CUSTOM_CONFIG, "");
141141
List<String> targetSystem = config.getList(JMX_TARGET_SYSTEM);
142-
if (targetSystem.isEmpty() && customConfig == null) {
142+
if (targetSystem.isEmpty() && customConfig.isEmpty()) {
143143
throw new ConfigurationException(
144144
"at least one of '" + JMX_TARGET_SYSTEM + "' or '" + JMX_CUSTOM_CONFIG + "' must be set");
145145
}

jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/config/PropertiesCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public Map<String, String> apply(ConfigProperties config) {
3535

3636
// providing compatibility with the existing 'otel.jmx.interval.milliseconds' config option
3737
long intervalLegacy = config.getLong(JMX_INTERVAL_LEGACY, -1);
38-
if (config.getDuration(METRIC_EXPORT_INTERVAL) == null && intervalLegacy > 0) {
38+
if (config.getDuration(METRIC_EXPORT_INTERVAL) == null && intervalLegacy >= 0) {
3939
logger.warning(
4040
METRIC_EXPORT_INTERVAL
4141
+ " deprecated option is used, replacing with '"

0 commit comments

Comments
 (0)