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

Support for extra metrics #1124

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

karina-calma
Copy link

This PR has a dependency on PR. If this functionality is of interest then that PR will be merged first and then this one.

Some of our mbeans only have string attributes, so we won't have any metrics at all, as only numeric or boolean attributes will generate values. We have implemented a way to define a custom value via the configuration file. Here is an example: we want to generate a new metric, such as "isActive" with the value true (1.0)

includeObjectNames: ["io.prometheus.jmx:type=stringValue"]
metricCustomizers:

  • mbeanFilter:
    domain: io.prometheus.jmx
    properties:
    type: stringValue
    extraMetrics:
    • name: isActive
      value: true
      description: This is a boolean value indicating if the scenario is still active or is completed.

If someone does not explicitly configure metricCustomizers, they should see no impact to performance. When the feature is used, we will go through all the elements in the metricCustomizers block and perform string comparison on the domain and the (optional) properties with every MBean that is matched by the defined rules. For those metrics that match, we will create a new metric with defined name and value. The description is used in the "HELP" section of the logs and indicates what purpose the metric serves.

MaBiConti and others added 3 commits January 16, 2025 17:09
Co-authored-by: Karina Calma <[email protected]>
Signed-off-by: Martin Bickel <[email protected]>
Co-authored-by: Karina Calma <[email protected]>
Signed-off-by: Martin Bickel <[email protected]>
Co-authored-by: Karina Calma <[email protected]>
Signed-off-by: Martin Bickel <[email protected]>
@dhoard
Copy link
Collaborator

dhoard commented Jan 30, 2025

@karina-calma I believe this can already be accomplished using existing functionality.

See https://www.robustperception.io/converting-string-states-to-booleans-with-the-jmx-exporter/

@karina-calma
Copy link
Author

Hi @dhoard,

We took a look on this approach, but we have some concerns in term of performance, because this solution involves pattern matching for all the mbeans and all the rules.

We have a significant number of mbeans and this approach will put a load on the server and increase response time.
We proposed an alternative solution that is based on string comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants