Skip to content

Commit e426eed

Browse files
committed
add ssl rmi registry support in scraper container
1 parent ef3ce95 commit e426eed

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/JmxScraperContainer.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class JmxScraperContainer extends GenericContainer<JmxScraperContainer> {
3636
private String keyStorePassword;
3737
private Path trustStore;
3838
private String trustStorePassword;
39+
private boolean sslRmiRegistry;
3940

4041
public JmxScraperContainer(String otlpEndpoint, String baseImage) {
4142
super(baseImage);
@@ -133,6 +134,12 @@ public JmxScraperContainer withTrustStore(Path trustStore, String password) {
133134
return this;
134135
}
135136

137+
@CanIgnoreReturnValue
138+
public JmxScraperContainer withSslRmiRegistry() {
139+
this.sslRmiRegistry = true;
140+
return this;
141+
}
142+
136143
@Override
137144
public void start() {
138145
// for now only configure through JVM args
@@ -162,6 +169,10 @@ public void start() {
162169
arguments.addAll(addKeyStore(keyStore, keyStorePassword, /* keyStore= */ true));
163170
arguments.addAll(addKeyStore(trustStore, trustStorePassword, /* keyStore= */ false));
164171

172+
if (sslRmiRegistry) {
173+
arguments.add("-Dotel.jmx.remote.registry.ssl=true");
174+
}
175+
165176
if (!customYamlFiles.isEmpty()) {
166177
for (String yaml : customYamlFiles) {
167178
this.withCopyFileToContainer(MountableFile.forClasspathResource(yaml), yaml);

0 commit comments

Comments
 (0)