问题
Hi All this question is in continuation of question here
by now i have single node kafka broker running on node x214 and its reporting metrics using jmx exporter on port 7071
curl -s localhost:7071 | grep -i kafka
# reports many metrics on std out
i want to connect jmx exporter with Prometheus and eventually to grafana for visualization; as described here
i tried installing Prometheus as blogs explains but running into issues; i find launching Prometheus easy with docker container as
docker run -p 9090:9090 -v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
I am running Prometheus on node x215 (different node than kafka broker). i can reach to Prometheus gui on http://x215-ip:9090
prometheus.yaml file is set to following.
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus_master'
scrape_interval: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['IP-215:9090']
- job_name: ‘kafka-server’
static_configs:
- targets: [‘IP-214:7071’]
Issue :-
on Prometheus gui i cant find any kafka metrics; as visible in response of curl
command above
response of metrics page (IP-215:9090/metrics) is here
i feel that JMX exporter is reporting metrics correctly but its not connected to Prometheus correctly. can you help me here?
thanks
来源:https://stackoverflow.com/questions/58634019/jmx-exporter-and-prometheus