Grafana

Configuring Grafana to Work with Dubbo

Grafana is an open-source monitoring solution that can be used to configure visual dashboards for Dubbo, allowing you to monitor the health of your Dubbo cluster.

Configuring Visual Dashboards

Here are the default metrics dashboards provided by the Dubbo community. You can quickly use them after configuring the data source and importing directly. If the default dashboards do not meet your requirements, you can customize your Grafana dashboards.

You can quickly import Grafana monitoring dashboards in the following ways.

Method 1: Kubernetes Installation

You can quickly install Grafana using the sample configuration provided by the Dubbo community, which comes with the default community metrics dashboards.

  1. kubectl create -f https://raw.githubusercontent.com/apache/dubbo-kubernetes/master/deploy/kubernetes/grafana.yaml

You may need to port-forward to access it: $ kubectl port-forward service/grafana 3000:3000, then open the browser and visit http://localhost:3000.

Retrieve login information

  1. kubectl get secrets grafana -o jsonpath="{.data.admin-user}" | base64 --decode ; echo && kubectl get secrets grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

Method 2: Importing Dashboard into an Already Installed Cluster

If you already have Grafana installed, you can import the dashboard via the import menu in the Grafana console. The Prometheus data source address must also be specified during the import process.

You can also use the following script for quick importing.

  1. $ # Address of Grafana
  2. $ GRAFANA_HOST="http://localhost:3000"
  3. $ # Login credentials, if authentication is used
  4. $ GRAFANA_CRED="USER:PASSWORD"
  5. $ # The name of the Prometheus data source to use
  6. $ GRAFANA_DATASOURCE="Prometheus"
  7. $ # The version of Dubbo to deploy
  8. $ VERSION=3.2.0
  9. $ # Import all Dubbo dashboards
  10. $ for DASHBOARD in 18469 4701; do
  11. $ #REVISION="$(curl -s https://grafana.com/api/dashboards/${DASHBOARD}/revisions -s | jq ".items[] | select(.description | contains(\"${VERSION}\")) | .revision")"
  12. $ REVISION=1
  13. $ curl -s https://grafana.com/api/dashboards/${DASHBOARD}/revisions/${REVISION}/download > /tmp/dashboard.json
  14. $ echo "Importing $(cat /tmp/dashboard.json | jq -r '.title') (revision ${REVISION}, id ${DASHBOARD})..."
  15. $ curl -s -k -u "$GRAFANA_CRED" -XPOST \
  16. $ -H "Accept: application/json" \
  17. $ -H "Content-Type: application/json" \
  18. $ -d "{\"dashboard\":$(cat /tmp/dashboard.json),\"overwrite\":true, \
  19. $ \"inputs\":[{\"name\":\"DS_PROMETHEUS\",\"type\":\"datasource\", \
  20. $ \"pluginId\":\"prometheus\",\"value\":\"$GRAFANA_DATASOURCE\"}]}" \
  21. $ $GRAFANA_HOST/api/dashboards/import
  22. $ echo -e "\nDone\n"
  23. $ done

Method 3: Customization

Grafana can be installed and configured through other methods; refer to the documentation on installation methods to learn how to create and import Dubbo monitoring dashboards.

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)