Closed ghannington-Rocket closed 2 weeks ago
Hi @ghannington-Rocket
I just tried and for me the keys actually are working as expected:
String runtime = java.lang.System.getProperty("java.runtime.name");
String runtimeVersion = java.lang.System.getProperty("java.runtime.version");
The result is:
Did you tried something that didn't work?
The property keys you suggested return different values:
So I think actually what we have is correct, as it's returning the runtime info, not the vm info.
I'm wrong. Sincere apologies for wasting your time.
I should have tried this myself, but didn't. I'm a Java noob. I relied on the Oracle docs topic that I cited, System Properties, to be comprehensive. I'm guessing there are technical reasons why java.runtime.name
and java.runtime.version
don't appear in that topic, but are returned by System.getProperties()
. I'm on a learning curve.
Thanks for correcting me gently!
No problem :). I'm going to close this issue then.
Excerpt of content
From the Markdown source of the topic "Process and Process Runtime Resources":
Issue
The qualifier
runtime
injava.runtime.name
andjava.runtime.version
is a typo. There are no such Java system properties.Suggestion
In those particular references, replace the
runtime
qualifier withvm
.Discussion
I think the docs are referring to the Java system properties
java.vm.name
andjava.vm.version
. I suspect that the writer has muddledprocess.runtime.*
OpenTelemetry attributes withjava.vm.*
Java system properties.References