File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public class JmxScraperContainer extends GenericContainer<JmxScraperContainer> {
2828 private String user ;
2929 private String password ;
3030 private final List <String > extraJars ;
31+ private boolean testJmx ;
3132
3233 public JmxScraperContainer (String otlpEndpoint , String baseImage ) {
3334 super (baseImage );
@@ -108,6 +109,12 @@ public JmxScraperContainer withCustomYaml(String yamlPath) {
108109 return this ;
109110 }
110111
112+ @ CanIgnoreReturnValue
113+ public JmxScraperContainer withTestJmx () {
114+ this .testJmx = true ;
115+ return this ;
116+ }
117+
111118 @ Override
112119 public void start () {
113120 // for now only configure through JVM args
@@ -152,6 +159,10 @@ public void start() {
152159 arguments .add ("io.opentelemetry.contrib.jmxscraper.JmxScraper" );
153160 }
154161
162+ if (testJmx ) {
163+ arguments .add ("-test" );
164+ }
165+
155166 this .withCommand (arguments .toArray (new String [0 ]));
156167
157168 logger ().info ("Starting scraper with command: " + String .join (" " , arguments ));
You can’t perform that action at this time.
0 commit comments