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

config.yaml Rules are not fetching all attributes metrics when using selective Object for Mbean #1020

Closed
KMTahir opened this issue Oct 28, 2024 · 2 comments

Comments

@KMTahir
Copy link

KMTahir commented Oct 28, 2024

Hi,
I am trying to get the tomcat JVM metrics using Java Agent jmx_prometheus_javaagent ( have tried 0.20.0 and 1.0.1 both version )

My issue is that if I use * in Rule file like below

rules:
- pattern: ".*"

It work properly and fetch all attribute etc. But I want to get specfic Mbeans only ( Memory , Threading,Garbagecollection and ClassLoading ). I am using the below configuration for it

rules:
- pattern: "java.lang:type=Memory"
- pattern: "java.lang:type=Threading"
- pattern: "java.lang:type=GarbageCollector,name=(.*)"
- pattern: "java.lang:type=ClassLoading"

while using above config. it is not fetching many attribute which are part of these Mbeans. Like java_lang_ClassLoading_LoadedClassCount is atttribute of ojbect ClassLoading but it is not receiving.

Similarly their are some other attributes which are missing if I don't use ".*" in config.yaml file

am I missing something or its a bug of jmx_prometheus_javaagent ?

Just for info, I am verifying the list of metrics like below

curl localhost:9093/metrics

@dhoard
Copy link
Collaborator

dhoard commented Oct 28, 2024

@KMTahir try these rules...

rules:
  - pattern: "java.lang<type=Memory(.*)><(.*)>"
  - pattern: "java.lang<type=Threading(.*)><(.*)>"
  - pattern: "java.lang<type=GarbageCollector(.*)><(.*)>"
  - pattern: "java.lang<type=ClassLoading(.*)><(.*)>"

@KMTahir
Copy link
Author

KMTahir commented Oct 29, 2024

Dear @dhoard
Thank you for your prompt and accurate reply. I am now receiving all attributes using your suggested configuration. I really appreciate your support.
Best regards,

@KMTahir KMTahir closed this as completed Oct 29, 2024
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

2 participants