This document shows how to integrate the different components of the On-prem Livepatch server with the Canonical Observability Stack to enable the preconfigured dashboard and alerting rules. Note that the Livepatch server charm comes in several flavours and only the most recent operator framework charms support COS integration. See this page to understand the support matrix.
The Canonical Observability Stack (COS-Lite) is a Juju bundle that includes a series of open source observability applications and related automation. For the complete list of components in the COS, read the Component List.
Contents:
- Prerequisites
- Integration approaches
- Integrate the Livepatch charm with COS-Lite
- Integrate the Livepatch charm with COS-Lite through Grafana-Agent
- Access the dashboards
Prerequisites
- A running COS-Lite bundle. You can follow the Getting started on MicroK8s tutorial to get you started. Make sure to follow the section Deploy the COS Lite bundle with overlays sections.
- A running Canonical Livepatch on-prem server. Please refer to the tutorial.
It is generally recommended to keep the observability stack separate from any observed applications to separate failure domains. This document assumes that the Livepatch server and the COS bundles are deployed to different models.
Integration approaches
There are 2 possible integration approaches depending on your networking / deployment setup setup:
- If you are able to send metrics and logs directly to the observability platform components follow the Integrate Livepatch with COS-Lite through Grafana-Agent section.
- If you prefer using a telemetry collector component follow the Integrate Livepatch with COS-Lite through Grafana-Agent section
Integrate Livepatch with COS-Lite
Dashboards, Logs and Metrics Integration
Assuming you deployed the COS-Lite bundle in model cos-model with user admin, use the following commands to integrate Livepatch by means of an application offer.
Note that in order for this approach to be functional, Prometheus must be able to reach Livepatch server’s /metrics
endpoint. This may not be possible if Livepatch and COS are deployed in two separate Kubernetes clusters for example, in which case see the approach integrating with Grafana-agent to push metrics instead. Logs are usually less problematic as they are a push based system and can take either approach.
juju integrate livepatch-server admin/cos-model.grafana-dashboards
juju integrate livepatch-server admin/cos-model.loki-logging
juju integrate livepatch-server admin/cos-model.prometheus-scrape
Integrate Livepatch with COS-Lite through Grafana-Agent
You first need to deploy the Grafana-Agent operator either for k8s or VMs, which is a telemetry collector used to aggregate and push information to the COS-lite bundle.
To deploy Grafana-Agent run:
juju deploy grafana-agent-k8s/grafana-agent grafana-agent --channel edge --trust
Above we have named the deployed application as simply grafana-agent to simplify the following instructions.
Dashboards, Logs and Metrics Integration
Integrate Grafana-Agent with Livepatch by running the following commands:
juju integrate grafana-agent livepatch-server:metrics-endpoint
juju integrate grafana-agent livepatch-server:logging
Dashboards are still integrated directly with Grafana, use the following command:
juju integrate livepatch-server admin/cos-model.grafana-dashboards
Integrate Grafana-Agent with COS-Lite
Assuming you deployed the COS-Lite bundle in model cos-model with user admin, use this command to integrate the Grafana-Agent with Prometheus by means of an application offer.
juju integrate grafana-agent-k8s admin/cos-model.prometheus-receive-remote-write
Assuming you deployed the COS-Lite bundle in model cos-model with user admin, use this command to integrate the Grafana-Agent with Loki by means of an application offer.
juju integrate grafana-agent-k8s admin/cos-model.loki-logging
Access the dashboards
You can get the Grafana IP address with the juju status command. The default port for the Grafana HTTP server is 3000.
The default credentials are:
**Username**: admin
**Password** you can get the password with the juju action [get-admin-password](https://charmhub.io/grafana-k8s/actions).
Once in, you will see a vertical menu bar on the left side of the page. You will find the available alerts by clicking on the Alerting menu. You will find the available dashboards by clicking on the Dashboards menu.