Why some classes in io.opentelemetry.instrumentation.jmx.engine are not public? #15498
Replies: 5 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
|
Some classes of JMX Insight are not public, just because public access was not needed. If I understand your intentions correctly, you'd like to create subclasses for MetricAttributeExtractor. Is this to be used by your agent extension only, or would you like it to be part of a repo? |
Beta Was this translation helpful? Give feedback.
-
|
Access to internal classes will soon be removed with changes related to #14674, so this is definitely not something I would suggest to rely on. Could you describe how would your own implementation of
Providing the ability to extend how MBeans are accessed could be done with:
|
Beta Was this translation helpful? Give feedback.
-
|
Well, perhaps I asked the question a bit too early—I don’t yet have an implementation for the Otel Java agent. JMX works fine in general. From the agent’s log, the issue occurs for This error is known to appear with some other APMs when querying proprietary application server MBeans. However, it has not been observed for standard JVM MBeans from java.lang.management.* that are used for basic JVM metrics such as memory or CPU utilization. So, MetricAttributeExtractor is probably not enough. |
Beta Was this translation helpful? Give feedback.
-
|
I see, so in order to invoke some of those MBeans on this application you need to use application-provided Outside of the permission problem, are there any application-specific classes really needed ? In other words, if we leave the permissions aside does those MBeans work like other JVM MBeans and we can use the usual JMX API to query them ? What I find a bit surprising here that those MBeans like The good news here is that you may already have an existing solution for this, so at least you know have one possible implementation for it, just not how to do it with OpenTelemetry instrumentation. In order to investigate this further it could help to provide the following:
If the problem here is just a "permission check" and no specific class is needed to query the MBeans, I think the simplest solution would be to instrument the part that does the permission checks to allow querying metrics. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the io.opentelemetry.instrumentation.jmx.engine in the library some classes are declared as public, but some not. Why?
Examples of public classes are
Examples of classes with package access are
I am trying to enhance the current implementation by a custom MetricAttributeExtractor. In my environment there are security issues for some MBeans. For example, there are following exceptions in the agent's log file
This is a kind of known issue which may be fixed in an extension. Ideally, the JMX rules .yaml would support extending by a “declarative instantiation”: that is, have an additional property to specify a MetricAttributeExtractor implementation from an extension. E.g.
If it can work that way, of course))
It seems it can only be changed right now by copy&paste of JmxMetricInsight and JmxMetricInsightInstaller etc. It would be nice when other classes were public.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions