-
Notifications
You must be signed in to change notification settings - Fork 917
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
Runtime-telemetry-Java17 support on OpenJ9 #10443
Comments
hi @tajila! yes, we would welcome any contributions to improve OpenTelemetry's OpenJ9 support |
Okay, thanks @trask Below is a rough outline of what I am proposing. Much of it is based on my unsderstanding of the existing OTEL support in Java17 which may be incomplete. So I would appreciate your feedback. BUFFER_METRICSMy understanding is that these are DirectByteBuffer metrics. If so, then the existing
CLASS_LOAD_METRICSLikewise with the classloading metrics, one could use the existing ClassLoadingMXBean
CONTEXT_SWITCH_METRICSFor this one I am thinking we could add to the existing J9 JvmCpuMonitorMXBean to add an additional API the returns the context switch rate. Internally, we would periodically poll the number of context switches with a fixed interval, then return a context switch rate per second.
CPU_COUNT_METRICSHere I believe we can use the OperatingSystemMXBean which has a method that returns
CPU_UTILIZATION_METRICSLikewise, we can use the OperatingSystemMXBean to query process CPU load. We can also enahnce it to return machine CPU load.
GC_DURATION_METRICSHere I believe the GarbageCollectorMXBean has the relevant data. It looks like OTEL currently registers a handler that accumulates the GC collection times. The API below works differently in that it returns the cummulative time.
LOCK_METRICSHere we can add a method to ThreadMXBean that returns the total lock wait time for a given thread.
MEMORY_ALLOCATION_METRICSMy understanding is that this simply reports the thread local and non-thread local abject allocation amounts. I propose adding a new API to GarbageCollectorMXBean that returns the cummulative object allocation metrics.
NETWORK_IO_METRICSHere I propose adding a new MXbean that returns the cummulative network IO stats.
THREAD_METRICSI believe we can use the exsting ThreadMXBean APIs for this.
MEMORY_POOL_METRICSMy understanding of this is that this reports metrics for various JVM components (java heap, metaspace, jit code cache,...). J9's internal memory management differs from hotspot so there may not be a direct parallel for each of these. That being said I think we can have a similar division where, JIT, GC and Class memory stats are reported separately.
We will also need a way to differentiate between hotspot, J9 and older versions of J9 that do not have the enhanced MXBeans. For this I propose adding a property to newer JDKs "org.eclipse.openj9.extendedMXBeanVersion=[1.XX]". Please let me know your thoughts and if I've misunderstood any of the OTEL behaviour. I expect we will need to go back and forth to iron out something that will work. |
@trask Any thoughts on the next steps? |
hi @tajila,
the java17 implementations of some of these metrics are alternative implementations of the java8 versions, see in general, the java17 "alternative" implementations are disabled by default, see the "Default Enabled" column on https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/runtime-telemetry/runtime-telemetry-java17/library |
Hi @trask
Thanks, this makes more sense. So if one wanted to add support for Java17 metrics without alternate implementations (e.g. |
you could add them to https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/runtime-telemetry/runtime-telemetry-java17/library the |
Is your feature request related to a problem? Please describe.
Java17 support inculdes additional metrics such as CPU_COUNT_METRICS and LOCK_METRICS described here. On OpenJ9 JVM these metrics are not available as the runtime-telemetry-java17 support depends on JFR streaming capabilities which is based on Hotspot JVM.
Describe the solution you'd like
I would like to ask if the runtime-telemetry community is open to working with the OpenJ9 Community to provide support for the metrics introduced in java17. The high level idea would be for OpenJ9 to provide some additional MXBean APIs that supply the required data for the new metrics. These would then be integrated in runtime-telemetry-java17.
Describe alternatives you've considered
One alternative is to create a Runtime-telemetry agent for OpenJ9. But this approach is not preferred.
Additional context
Please let me know if this is not the correct place to raise this request.
The text was updated successfully, but these errors were encountered: