Monitor routers with prometheus
Following are instructions for using prometheus / grafana to monitor a Kubernetes cluster that is running Apache Qpid Dispatch Router.
Notes
These examples are provided for developers to quickly get started with monitoring the dispatch router and are not intended for use in production environments.
These instruction will only setup monitoring of the routers in the cluster. It will not monitor any user applications that connect to those routers.
Prerequisites / assumptions
You will need access to a Kubernetes cluster running a deployment of the router. See qdr-operator for instructions on how to install the qdr-operator into your cluster.
This guide assumes you are using a project named 'myproject'. If not, change all namespace definitions to your current project name.
Router network
After the qdr-operator is installed, the router network used in this example is deployed using:
$ kubectl apply -f mesh-3.yamlCheck to ensure the router network is available:
$ kubectl rollout status deployment/example-interconnect -w -n myprojectDeploy prometheus / grafana
All of the commands needed to install prometheus/grafana monitoring are in the deploy-monitoring script:
$ ./deploy-monitoring.shIf you recieve any errors, you can run the individual command separately:
Create the prometheus deployment and alertmanager
$ kubectl apply -f ./monitoring/alerting-interconnect.yaml -n myproject
$ kubectl apply -f ./monitoring/prometheus.yaml -n myproject
$ kubectl apply -f ./monitoring/alertmanager.yaml -n myprojectWait for Prometheus server to be ready
$ kubectl rollout status deployment/prometheus -w -n myproject
$ kubectl rollout status deployment/alertmanager -w -n myproject
$ kubectl create -f ./monitoring/route-alertmanager.yaml -n myproject
$ kubectl create -f ./monitoring/route-prometheus.yaml -n myprojectPrepare Grafana datasource and dashboards
$ kubectl create configmap grafana-config \
--from-file=datasource.yaml=./monitoring/dashboards/datasource.yaml \
--from-file=grafana-dashboard-provider.yaml=./monitoring/grafana-dashboard-provider.yaml \
--from-file=interconnect-dashboard.json=./monitoring/dashboards/interconnect-raw.json \
--from-file=interconnect-dashboard-delayed.json=./monitoring/dashboards/interconnect-delayed.json \
-n myproject
Deploy grafana
$ kubectl apply -f ./monitoring/grafana.yaml -n myprojectWait for Grafana server to be ready
$ kubectl rollout status deployment/grafana -w -n myproject
$ kubectl create -f ./monitoring/route-grafana.yaml -n myproject