-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jmx scraper connection test #1684
Conversation
} | ||
} | ||
|
||
private static void checkConnectionLogs(JmxScraperContainer scraper, boolean expectedOk) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] we have to parse and check scraper logs in order to know if the connection is OK or not, this is because we can't access the process exit value when the program completes.
*/ | ||
@CanIgnoreReturnValue | ||
public TestAppContainer withHostAccessFixedJmxPort(int port) { | ||
// To get host->container JMX connection working docker must expose JMX/RMI port under the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] this is no longer necessary as we only rely on container-to-container communication and we don't have to use docker NAT to access the JMX endpoint.
import org.junit.jupiter.api.Test; | ||
import org.testcontainers.containers.Network; | ||
|
||
public class JmxConnectorBuilderTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] this is replaced by JmxConnectionTest
.
jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/JmxScraper.java
Outdated
Show resolved
Hide resolved
jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/JmxScraper.java
Show resolved
Hide resolved
jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/JmxScraper.java
Show resolved
Hide resolved
…ontrib into jmx-scraper-test
…ontrib into jmx-scraper-test
Relates to #1681
This PR adds a new CLI argument to enable end-users to test JMX connection.
JMX connection is expected to be tedious to setup and will benefit from a fast feedback loop as there are multiple things that can be problematic during setup:
Also, testing connection through this mean allow us to validate configuration usage with CLI interface and avoids having any complication due to JMX/RMI port mapping which is not NAT friendly (open connection on a port, then another one is used afterwards).