Integrate with the Canonical Observability Stack

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

  • A running COS-Lite bundle. You can follow the Getting started on MicroK8s tutorial to get you started. Make sure to additionally follow the section on setting up overlays so that application offers are ready to be consumed (for cross-model relations).
  • 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:

  1. If you want to send metrics and logs directly to the observability platform components follow the Integrate Livepatch with COS-Lite Directly section. This approach is possible in scenarios where Livepatch and COS are deployed in the same K8s cluster or if Livepatch is deployed on machines.
  2. If you prefer using a telemetry collector component follow the Integrate Livepatch with COS-Lite through Grafana-Agent section. This approach is appropriate if COS and Livepatch are deployed in separate K8s clusters.

Integrate Livepatch with COS-Lite Directly

Dashboards, Logs and Metrics Integration

Assuming the COS-Lite stack is deployed in a separate Juju model to Livepatch, with user admin, use the following commands to integrate COS and Livepatch with application offers.

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 do not face this issue 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

This approach will involve 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 the COS-Lite bundle is deployed in the model cos-model with user admin, use these commands to integrate the Grafana-Agent with Prometheus and Loki.

juju integrate grafana-agent-k8s admin/cos-model.prometheus-receive-remote-write
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.