Prometheus module stop working with new metrics format

I used to have an thirdparty prometheus exporter (Microprofile metrics) and the prometheus metricbeat module worked fine. Here an example of the working format:

# HELP base:thread_max_count Displays the peak live thread count since the Java virtual machine started or peak was reset. This includes daemon and non-daemon threads.
# TYPE base:thread_max_count counter
base:thread_max_count 79.0
# HELP base:cpu_available_processors Displays the number of processors available to the Java virtual machine. This value may change during a particular invocation of the virtual machine.
# TYPE base:cpu_available_processors gauge
base:cpu_available_processors 1.0
# HELP base:thread_daemon_count Displays the current number of live daemon threads.
# TYPE base:thread_daemon_count counter
base:thread_daemon_count 26.0

But now i have updated the exporter and metricbeat stopped working. When I run this test:

metricbeat test modules -v

The response is:

prometheus...
  collector...
    error... ERROR timeout waiting for an event

Here an example of the format of the new exporter:

# HELP base:thread_max_count Displays the peak live thread count since the Java virtual machine started or peak was reset. This includes daemon and non-daemon threads.
# TYPE base:thread_max_count counter
base:thread_max_count 79.0
# HELP base_thread_daemon_count Displays the current number of live daemon threads.
# TYPE base_thread_daemon_count gauge
base_thread_daemon_count 7.0

How can I at least debug this error?

Hmm what version of metricbeat are you running?
I tested on master branch with adding your new exporter format example into github.com/elastic/beats/metricbeat/module/prometheus/collector/_meta/testdata/docs.plain:

# HELP base:thread_max_count Displays the peak live thread count since the Java virtual machine started or peak was reset. This includes daemon and non-daemon threads.
# TYPE base:thread_max_count counter
base:thread_max_count 79.0
# HELP base_thread_daemon_count Displays the current number of live daemon threads.
# TYPE base_thread_daemon_count gauge
base_thread_daemon_count 7.0

and after running go test -generate, I can see in github.com/elastic/beats/metricbeat/module/prometheus/collector/_meta/testdata/docs.plain-expected.json:

[
    {
        "event": {
            "dataset": "prometheus.collector",
            "duration": 115000,
            "module": "prometheus"
        },
        "metricset": {
            "name": "collector",
            "period": 10000
        },
        "prometheus": {
            "metrics": {
                "base:thread_max_count": 79,
                "base_thread_daemon_count": 7
            }
        },
        "service": {
            "address": "127.0.0.1:55555",
            "type": "prometheus"
        }
    }
]

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.