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

QA:Do jmx_prometheus_httpserver scrapy data from jmx server proactively when without prometheus? #876

Closed hanson2021 closed 6 months ago

hanson2021 commented 1 year ago

When i only start jmx_prometheus_httpserver ,whether it will proactively scrapy data or not? If it will, is there any configure to control frequency?

fstab commented 1 year ago

No, it's just callbacks waiting for the Prometheus server to scrape. If the metrics endpoint is not called, nothing will happen.

mustajibmk commented 1 year ago

Can we have an option to enable active scraping at certain intervals? That way we can remove the dependency on the Prometheus server and jmx_exporter be used as a standalone tool.

fstab commented 1 year ago

I think I don't understand your question. What are you trying to achieve? You need a Prometheus server to do Prometheus monitoring, right?

mustajibmk commented 1 year ago

Most of the time, yes we would have a Prometheus server which would do it for us. I was referring to the case where jmx_exporter was not being called by the Prometheus server but rather by custom Java code/application.

dhoard commented 1 year ago

The JMX exporter exposes a REST API to collect metrics from JMX MBeans. Each REST API call collects metrics and returns a metrics response.

The application (Prometheus, custom application, etc.) calling the REST API doesn't matter.

The scraping interval is a function of the application calling the REST API.