Hi Brian, Sorry to revive an old thread. You mentioned we can drop all java_lang stuff as jvm_ prefixed metrics are provided out of the box and are better structured. I was not able to see any of the jvm metrics. When using the JMX prometheus exporter, I set my rules to: - pattern: ".*
The only metrics I am able to see are java_lang prefixed metrics. No jvm_ prefix. This is with corretto openJDK 1.8.0_265. On Wednesday, November 25, 2020 at 5:57:36 AM UTC-8 Brian Brazil wrote: > On Wed, 25 Nov 2020 at 13:35, Tigran <[email protected]> wrote: > >> Hello, >> >> I am running a k8s cluster with 2 instances, and I noticed that I have a >> lot of difference between this two metrics, I would like to undertand why >> they return a different value. >> >> *metrics from jvm_memory_bytes_used{service="x", area="heap"} (instance >> 1 and 2)* >> >> *java_lang_memory_heapmemoryusage_used{service="x"} (intsance 1 and 2)* >> >> >> The difference is ~20mb for the first instance of x and ~10mb for the >> second. >> >> I am using jmx_prometheus_javaagent:0.14.0 exporter in a tomcat runing >> azul jdk >> > > Most likely a race due to them being fetched at slightly different times > in the scrape, as the value is coming from the exact same mBean. You can > drop all the java_lang stuff when using the jmx exporter, > as jvm_memory_bytes_used and friends already provide you with that out of > the box and is a better structured metric. > > -- > Brian Brazil > www.robustperception.io > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c1b7bb5b-4ef1-41f3-8e7f-7332ec9d8ed7n%40googlegroups.com.

