Skip to content
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

[Native Image] jvm_gc_* and jvm_buffer_* metrics missing #9912

Open
1 of 2 tasks
patpatpat123 opened this issue Oct 17, 2024 · 6 comments
Open
1 of 2 tasks

[Native Image] jvm_gc_* and jvm_buffer_* metrics missing #9912

patpatpat123 opened this issue Oct 17, 2024 · 6 comments

Comments

@patpatpat123
Copy link

Describe the Issue

For a springboot 3.4 ( latest as of this writing) and GraalVM JDK23, project, there are missing metrics.

For background, the same app https://github.com/patpatpat123/nativejvmmetricsissueminimal running in "normal" (not native) will have the jvm_gc_* and jvm_buffer_* metrics

The exact same app, running as native image, will not have the metrics, which is the issue.

Not having GC, buffer etc metrics greatly impact the observability of the native image app.

Thank you for looking into this.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

java 23 2024-09-17
Java(TM) SE Runtime Environment Oracle GraalVM 23+37.1 (build 23+37-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 23+37.1 (build 23+37-jvmci-b01, mixed mode, sharing)

Operating System and Version

Mac os

Diagnostic Flag Confirmation

  • I tried the -H:ThrowMissingRegistrationErrors= flag.

Run Command

mvn -Pnative spring-boot:build-image

docker run docker.io/library/sre-demo:0.0.1-SNAPSHOT

Expected Behavior

to see jvm_gc_* and jvm_buffer_* in both non native and native image

Actual Behavior

jvm_gc_* and jvm_buffer_* are present only in non native run, but absent when running native image.

Steps to Reproduce

mvn -Pnative spring-boot:build-image

docker run docker.io/library/sre-demo:0.0.1-SNAPSHOT

Additional Context

https://github.com/patpatpat123/nativejvmmetricsissueminimal

Run-Time Log Output and Error Messages

No response

@oubidar-Abderrahim
Copy link
Member

reading jvm events with native image is not a straightforward process and requires some tweaking, there are a few example using OpenTelemetry with GraalVM native image that you can find online, also it would make sense to check with Spring Boot on what they support and with which GraalVM version

@oubidar-Abderrahim oubidar-Abderrahim closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2024
@Karm
Copy link
Contributor

Karm commented Oct 21, 2024

@patpatpat123 Wouldn't JFR be an option for you?

@roberttoyonaga
Copy link
Collaborator

@patpatpat123 I'm not sure if this will work for you use-case, but I think micrometer uses GC Notifications for gc related metrics. There's a PR up for adding notification support, which might solve your problem: #9799

Otherwise, like Karm said, I think JFR could help you too.

@patpatpat123
Copy link
Author

Hello @oubidar-Abderrahim ,

Your comment is not very clear, and it seems you are trying to offload a graalvm issue to other teams.
Furthermore, the closing of this issue seems inappropriate as well.

After some investigation, it seems this issue is indeed related to graalvm #8237
Please feel free to close this as duplicate, but the issue is clear and accepted.

Furthermore, I do not think this issue should be closed, as #8237 only addresses part of the issue.
For the buffer metrics, SubstrateVM needs to provide an implementation of BufferPoolMXBean which I believe it currently doesn't. I didn't find any issue in their issue tracker requesting it

Would you like me to open an issue reflecting this as well?
Thank you

@roberttoyonaga
Copy link
Collaborator

Hi @patpatpat123

Furthermore, I do not think this issue should be closed, as #8237 only addresses part of the issue.
For the buffer metrics, SubstrateVM needs to provide an implementation of BufferPoolMXBean which I believe it currently doesn't. I didn't find any issue in their issue tracker requesting it
Would you like me to open an issue reflecting this as well?

Hmm I don't think it's necessary to open another separate issue. Maybe just mention briefly in the description that #8237 already covers the GC metrics, but you're still concerned about the buffer metrics.

@roberttoyonaga
Copy link
Collaborator

roberttoyonaga commented Oct 23, 2024

Hi @oubidar-Abderrahim, I see that you've assigned me to this issue. I probably won't end up working on this for a while and don't want to give the impression that this is actively being worked on, in case someone else wants to give it a shot.

However, if no one at Oracle plans on taking this issue, feel free to keep me assigned in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants