-
Notifications
You must be signed in to change notification settings - Fork 129
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
jfr-connection: fixes for using diagnostic command to start a recording #1352
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jeanbisutti
reviewed
Jun 28, 2024
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.
Thank you @dsgrieve!
jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/RecordingOptions.java
Outdated
Show resolved
Hide resolved
.../java/io/opentelemetry/contrib/jfr/connection/FlightRecorderDiagnosticCommandConnection.java
Outdated
Show resolved
Hide resolved
jfr-connection/src/test/java/io/opentelemetry/contrib/jfr/connection/RecordingOptionsTest.java
Outdated
Show resolved
Hide resolved
jfr-connection/src/test/java/io/opentelemetry/contrib/jfr/connection/RecordingTest.java
Show resolved
Hide resolved
…ection/RecordingOptionsTest.java Co-authored-by: Jean Bisutti <[email protected]>
jeanbisutti
approved these changes
Jul 3, 2024
@breedx-splk - Waiting for your review. |
trask
approved these changes
Jul 11, 2024
This was referenced Sep 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Time based recording options (time and age) are sent with a space between the value and units, e.g. "6000 ms", which may cause an issue with Java 8/Diagnostic Command.
In the course of testing, I found an issue with the code that checks to see if
-XX:+UnlockCommercialFeatures
needs to be set. The issue was that this check was applied always and would erroneously report that the user needed to UnlockCommercialFeatures even though the JVM was not an Oracle JVM. I addressed this by putting an additional check to see if the VM vendor is "Oracle Corporation" and the VM version is 1.8, 9, or 10. Oracle removed UnlockCommercialFeatures in JDK 11.Existing Issue(s):
Fixes #1338
Testing:
I tested locally with Oracle JVMs version 1.8, 11, 17 and 21, and also with Adoptium and Microsoft JVMs.
Modified existing unit tests to accept
<value><units>
as oppsed to<value> <units>
Added unit test that starts a recording for a specified duration where the duration configured in the RecordingOptions as
5s
or5 s
. This test is run with both the diagnostic command connection and with the MBean connection to ensure there are no differences. This test does not use Mock as do others.Documentation:
One place in the documentation had an example duration with a space between the value and units. I eliminated the space, although the code normalizes the string by eliminating any space.
Outstanding items:
< Anything that these changes are intentionally missing
that will be needed or can be helpful in the future. >