Hi Karina,

Thanks a lot for your proposals. Could you open a Github issue on 
https://github.com/prometheus/jmx_exporter and copy the content of this 
email into the issue? That will make it easier to involve Doug in the 
discussion, he's the main maintainer of jmx_exporter.

Fabian

On Friday, March 29, 2024 at 3:11:30 PM UTC+1 Karina Ciupa wrote:

> Hi all,
>
> I am reaching out with a proposal for two different extensions of your 
> project.
>
> In the company that I work for, we needed to extend your project in order 
> to collect additional data from non-standard mbeans. I am opening this 
> discussion to check if you would be interested in merging these extensions 
> in your project.
>
>
> 1. Exposing string-type mbean attributes as labels.
>
> The mbeans that we are working with have a lot of string-type attributes 
> which are not converted into metrics by your project.
>
> However, we need to expose the information offered by these string 
> attributes to Prometheus, such that they can be used in queries, or be 
> displayed in graphs.
>
> The best way to do this (that we were able to find) is to expose these 
> attributes as labels on the other metrics. We made this behavior 
> configurable in the rules section of the yaml configuration file. Here is 
> an example:
>
> rules:
>
>   - pattern: '{some mbean pattern}'
>
>      name: some_metric
>
>      attributesAsLabels:
>
>         - firstStringAttribute
>
>         - secondStringAttribute
>
> This produces a metric that looks like this:
>
> some_metric_attribute{firstStringAttribute="something",secondStringAttribute="something
>  
> else"} 123
>
>  
>
> 2. Adding additional metrics to an mbean.
>
> Some of the mbeans that we are working with do not expose any useful 
> metrics, so we implemented a way to define a custom metric through the 
> configuration file. This is also configurable in the rules section of the 
> yaml configuration file. Here is an example:
>
>   - pattern: '{some mbean pattern}'
>
>      name: some_metric
>
>      extraMetrics:
>
>         - name: someName
>
>           value: someValue
>
>           description: someDescription
>
> This produces a metric that looks like this:
>
> some_metric_someName{...} someValue
>
> The description is used in the "HELP" section of the logs and indicates 
> what purpose the metric serves.
>
> Please let me know if you are interested in these features. If you are, I 
> will open separate pull requests.
>
> Also, please tell me if there is any way to achieve this behavior in 
> another way that is already available in your project.
>
>
> Kind regards,
>
> Karina Ciupa
> [email protected]
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/bb260402-cfcb-46cd-bc92-19bdecffdb23n%40googlegroups.com.

Reply via email to