prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Apache License 2.0
3.06k stars 1.2k forks source link

Advice for validating JMX exporter rules #972

Closed AagonP closed 3 weeks ago

AagonP commented 5 months ago

I have read through the documentation but I still encounter some challenges when working JMX exporter rules. So I'm opening this issue only to ask for advice on how we can better handle these scenarios when working with JMX exporter:

  1. When I was writing a rule like:
    - pattern: "kafka.consumer<type=consumer-fetch-manager-metrics, client-id=(.+), topic=(.+), partition=(.+)><>records-lag"
      name: kafka_consumer_fetch_manager_records_lag

    As I forget that JMX exporter rule regex is not anchored, kafka_consumer_fetch_manager_records_lag is actually presenting 3 metrics ( records-lag, records-lag-avg, records-lag-max). How can I avoid situation like this when certainly my goal was just to get the records-lag attribute.

  2. Is there a way we can do linting for the configuration file?

Thanks for your time.

dhoard commented 5 months ago

Currently, there is no linter.

An out-of-band linting tool is hard to implement since the rules are based on the dynamically scraped MBeans.