fstab / promagent

Prometheus Monitoring for Java Web Applications without Modifying their Source Code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Private methods and protected methods hooks are not intercepted

cool-dude-9 opened this issue · comments

Hi, I am trying to use promagent to collect some metrics, I was not able to intercept any private and protected methods with this library, could you please throw some light on this?

The current implementation instruments only public methods. From a quick look at the code it seems that it could be quite easy to support protected and private methods as well: Just remove the isPublic() check in io.promagent.internal.Promagent.matchAnyMethodIn() line 111. However, I didn't try it. I will get back to this as soon as I got the time to test it properly, but in the meantime you could just give it a try and comment out this line.

Great. Removed the line from the code.