Skip to content
Merged
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 @@ -48,28 +48,6 @@ public JmxTelemetryBuilder beanDiscoveryDelay(Duration delay) {
return this;
}

/**
* Adds built-in JMX rules from classpath resource.
*
* @param target name of target in /jmx/rules/{target}.yaml classpath resource
* @return builder instance
* @throws IllegalArgumentException when classpath resource does not exist or can't be parsed
* @deprecated use {@link #addRules(InputStream)} instead
*/
@Deprecated
@CanIgnoreReturnValue
public JmxTelemetryBuilder addClassPathRules(String target) {
String resourcePath = String.format("jmx/rules/%s.yaml", target);
ClassLoader classLoader = JmxTelemetryBuilder.class.getClassLoader();
logger.log(FINE, "Adding JMX config from classpath {0}", resourcePath);
try (InputStream inputStream = classLoader.getResourceAsStream(resourcePath)) {
return addRules(inputStream);
} catch (IOException e) {
throw new IllegalArgumentException(
"Unable to load JMX rules from resource " + resourcePath, e);
}
}

/**
* Adds JMX rules from input stream
*
Expand Down Expand Up @@ -106,20 +84,6 @@ public JmxTelemetryBuilder addRules(Path path) {
}
}

/**
* Adds custom JMX rules from file system path
*
* @param path path to yaml file
* @return builder instance
* @throws IllegalArgumentException when classpath resource does not exist or can't be parsed
* @deprecated use {@link #addRules(Path)} instead
*/
@Deprecated
@CanIgnoreReturnValue
public JmxTelemetryBuilder addCustomRules(Path path) {
return addRules(path);
}

public JmxTelemetry build() {
return new JmxTelemetry(openTelemetry, discoveryDelayMs, metricConfiguration);
}
Expand Down
Loading