Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
domain: io.prometheus.jmx
properties:
type: stringValue
extraMetrics:
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.