Monitoring metrics in Qlik Sense Enterprise on Kubernetes

All Qlik Sense Enterprise on Kubernetes services expose metrics that can be used to monitor activities, health and performance data.

The data can be surfaced and collated using open source components. The example below shows how to use Prometheus and Grafana to scrape and analyze metrics in real time.

Viewing metrics with Prometheus

Prometheus is a system monitoring and alerting toolkit that can be used for scraping and storing metrics. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.

Prometheus finds the metrics by looking for Kubernetes annotations that have been added to the services.

prometheus.io/port=8080 prometheus.io/scrape=true

Installing the Prometheus chart

Run the following command to install the stable/prometheus chart.

Note: Adjust the configuration of your cluster settings, such as RBAC.
helm upgrade --install prometheus stable/prometheus --set=rbac.create=true,alertmanager.enabled=false,pushgateway.enabled=false

Viewing the metrics

View the metrics with the following command:

export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,release=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:9090 to access prometheus" kubectl port-forward $POD_NAME 9090

Viewing metrics with Grafana

Grafana is another tool for monitoring and analyzing metrics.

Installing Grafana

Run the following command to install Grafana:

helm upgrade --install grafana stable/grafana -f grafana.yaml

The example YAML file referenced in the command above provides the following abilities:

  • Configure Grafana to look at Prometheus metrics.
  • Preload a GO Services dashboard for exposing Golang metrics.
  • Preload a Kubernetes dashboard with general metrics.
  • Preload a Kubernetes container details dashboard with more specific POD metrics.

Example:  

Viewing the metrics

Run the following command to retrieve your admin user password:

kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

In the same shell, run the following command to retrieve the Grafana URL:

export POD_NAME=$(kubectl get pods --namespace default -l "app=grafana,release=grafana" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:3000 to access grafana" export GRAFANA_PASSWORD=$(kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo) echo "Login as admin:$GRAFANA_PASSWORD" kubectl port-forward $POD_NAME 3000

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?