Skip to content

Commit 255c9e3

Browse files
authored
remove deprecated methods in JMX telemetry (#15929)
1 parent d51565e commit 255c9e3

1 file changed

Lines changed: 0 additions & 36 deletions

File tree

instrumentation/jmx-metrics/library/src/main/java/io/opentelemetry/instrumentation/jmx/JmxTelemetryBuilder.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,6 @@ public JmxTelemetryBuilder beanDiscoveryDelay(Duration delay) {
4848
return this;
4949
}
5050

51-
/**
52-
* Adds built-in JMX rules from classpath resource.
53-
*
54-
* @param target name of target in /jmx/rules/{target}.yaml classpath resource
55-
* @return builder instance
56-
* @throws IllegalArgumentException when classpath resource does not exist or can't be parsed
57-
* @deprecated use {@link #addRules(InputStream)} instead
58-
*/
59-
@Deprecated
60-
@CanIgnoreReturnValue
61-
public JmxTelemetryBuilder addClassPathRules(String target) {
62-
String resourcePath = String.format("jmx/rules/%s.yaml", target);
63-
ClassLoader classLoader = JmxTelemetryBuilder.class.getClassLoader();
64-
logger.log(FINE, "Adding JMX config from classpath {0}", resourcePath);
65-
try (InputStream inputStream = classLoader.getResourceAsStream(resourcePath)) {
66-
return addRules(inputStream);
67-
} catch (IOException e) {
68-
throw new IllegalArgumentException(
69-
"Unable to load JMX rules from resource " + resourcePath, e);
70-
}
71-
}
72-
7351
/**
7452
* Adds JMX rules from input stream
7553
*
@@ -106,20 +84,6 @@ public JmxTelemetryBuilder addRules(Path path) {
10684
}
10785
}
10886

109-
/**
110-
* Adds custom JMX rules from file system path
111-
*
112-
* @param path path to yaml file
113-
* @return builder instance
114-
* @throws IllegalArgumentException when classpath resource does not exist or can't be parsed
115-
* @deprecated use {@link #addRules(Path)} instead
116-
*/
117-
@Deprecated
118-
@CanIgnoreReturnValue
119-
public JmxTelemetryBuilder addCustomRules(Path path) {
120-
return addRules(path);
121-
}
122-
12387
public JmxTelemetry build() {
12488
return new JmxTelemetry(openTelemetry, discoveryDelayMs, metricConfiguration);
12589
}

0 commit comments

Comments
 (0)