-
Notifications
You must be signed in to change notification settings - Fork 881
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
JMX support #6131
Comments
I'd like to work on this issue. Can this be assigned to me? |
sure, assigned! |
Should we make JMX metrics collection part of the Java agent code, or provide an agent extension (to be used with the -Dotel.javaagent.extensions option)? |
I personally think this is pretty useful and should be part of the Java agent code (e.g. we have similar functionality in our distro https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config#jmx-metrics). Unfortunately, in otel javaagent we only have property-based configuration (yaml-based configuration is being discussed at the broader OTel level, and we will probably add that at some point which would be very helpful for other things also, e.g. rule-based sampler configuration for #1060). So for now we may need to be creative how to configure, e.g. maybe?
It would be nice if objectName can be an objectName pattern, and attributeNames can be nested, e.g. It would also be nice if there was an automatic metric naming based on objectName + attributeName, similar what @jack-berg has proposed for kafka metrics in #6138. |
Yes, yaml-based configuration would be nice! We are eager to add it in the future. |
this makes sense to me 👍 |
Alternatively, we could add a single property that points to a yaml configuration file (or many of them, in case we want to have "standard" config files for various frameworks/systems) -- kind of how the view file configuration works. |
Don't all of these configuration options conflate responsibilities with views? With views we have a mechanism to select and disable instruments. It's already fairly powerful, allowing you to select by instrument name (with wildcard syntax), instrument type, and meter name. And the file based configuration makes it easy to configure views while using the agent without having to write any extension. Why not just have a general flag that enables or disables all jmx metrics, powered by generic mapping rules? The readme could include a description of the metrics that are produced, and how they can be selected and disabled with views. |
I see two issues with this approach. One is that there could be literally thousands of JMX metrics available, collecting them all just to get mostly discarded would not be efficient. The second one is that there could be application specific MBeans, which we know nothing about. We could discover them, but we would not have any idea how to report them - are they monotonic? Are they providing Long or Double values? What kind of attributes(dimensions) do they need? etc. |
Until we have configuration file for JMX metrics, the following seems feasible (following @trask suggestion):
I'm not a big fan of appending attribute names to the metric name, I think using metric attributes (dimensions/labels) is a better way, as it allows easier data aggregation (even if it not always makes sense). |
in the what do you think of going ahead with a yaml configuration similar to what was done for metric view configuration, and having a single property that points to the yaml file? if you had a richer configuration format (yaml), would you decompose the |
The proposed syntax for labels would support:
|
Certainly, configuring JMX metrics via system properties is not very convenient (and it looks lame), let's continue with a yaml configuration file. Here is the proposed syntax - the intention is to balance simplicity with expressiveness.
|
makes sense to me 👍 do you have an example in mind where multiple my only other thought is whether having the optional |
I do not have very strong arguments for either, as they are redundant, but they can sometimes make the user's life easier. For example, consider a group of MBeans which use the request URL as part of their ObjectName. The user might be interested in just a few critical URLs, providing a definition like this:
instead of getting dozens or hundreds of not interesting values. Singling out the domain on a separate line (which is fully optional) might make reading and maintaining the file easier, I had no other goal in mind for this. |
makes sense, and the single MBean form can still be written in simpler form (I think?):
I'd personally leave out the Maybe related, what do you think of renaming On other thought, is the
|
Yes, thank you for your comments. For a single MBean the simplified format should be supported, and I'm fine with removing |
I'm good with |
Another change suggestion: instead of specifying |
After several iterations, trying to strike a balance between different needs, here is the latest proposal for the YAML syntax:
This syntax hopefully allows users to write configurations with precise metric definitions, and also to write concise configurations if they only want to cover a lot of attributes without caring about much else. |
Couple of thoughts:
|
Thanks for your comments. |
Solving open-telemetry#6131 (JMX Support).
Solving open-telemetry#6131 (JMX Support).
Solving #6131 (JMX Support). Co-authored-by: Trask Stalnaker <[email protected]>
This issue can be closed now. |
Is your feature request related to a problem? Please describe.
I'd like to collect JMX metrics using a single agent rather than having to rely on another process/workload to gather JMX data
Describe the solution you'd like
Make exporting JMX metrics part of the default feature set of the OTEL Java agent
Describe alternatives you've considered
I considered running the JMX metrics gatherer project but we operate in a highly regulated/secure environment and opening up another port for scraping JMX data is not an option.
The text was updated successfully, but these errors were encountered: