Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

After installing Prometheus, by connecting to its dashboard, you will notice a list of services already under monitoring: these are useful resources for the functioning of Prometheus itself (e.g. alertmanager, Grafana) or typical of each K8s cluster (apiserver, controller-manager, scheduler). But how do you monitor an application in general?  As As an example, let's try to monitor Longhorn, a distributed block storage system for Kubernetes.

...

Code Block
languagebash
titlePrometheus CRD
collapsetrue
# This is just an excerpt from the output of the "describe" command
$ kubectl describe -n monitoring prometheus 
spec:
  Service Monitor serviceMonitorSelectorSelector:
    matchLabelsMatch Labels:
      releaseRelease:  mon

After a few seconds, connecting to the Target list of the Prometheus dashboard, you will notice a new line. Of course, you will have Longhorn Metrics for Monitoring available to keep your application under control at all times.

...