opentelemetry-java-contrib icon indicating copy to clipboard operation
opentelemetry-java-contrib copied to clipboard

Sending JFR RecordingOptions with a diagnostic command may fail on Java 8

Open dsgrieve opened this issue 8 months ago • 1 comments

Component(s)

jfr-connection

What happened?

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.

Steps to Reproduce

Create an application with FlightRecorderDiagnosticCommandConnection which sets the 'time' or 'age' option for a recording. This causes an issue with Oracle Java 8.

Expected Result

No exception returned from the diagnostic command mbean.

Actual Result

Component version

1.36.0

Log output

com.microsoft.jfr.JfrStreamingException: Java 8 currently only supports predefined configurations (default/profile)       at com.microsoft.jfr.dcmd.FlightRecorderDiagnosticCommandConnection.formOptions(FlightRecorderDiagnosticCommandConnection.java:135)       at com.microsoft.jfr.dcmd.FlightRecorderDiagnosticCommandConnection.startRecording(FlightRecorderDiagnosticCommandConnection.java:109)       at com.microsoft.jfr.Recording.start(Recording.java:116)

Additional context

This is an issue that was reported by a third party using the com.microsoft:jfr-streaming classes, which is where jfr-connection comes from. So this issue is present in jfr-connection as well. This issue won't be fixed in com.microsoft:jfr-streaming since that code is no longer maintained.

dsgrieve avatar Jun 05 '24 18:06 dsgrieve