Monitoring charmed MAAS with COS

How to do charm-level tracing

The MAAS region charm supports charm-level tracing out of the box. All you have to do is integrate the MAAS region charm with the Tempo HA charm. This article will show you how.

Prerequisites

You should have a deployed COS Lite bundle with Tempo HA charm on top of it. See this guide for instructions on setting this up.

Integrate MAAS charm with Tempo

Once you have the COS lite model ready, you can quickly integrate Tempo with the MAAS charm.

In the COS lite model, ensure that charmed Tempo is providing an offer over tracing:

juju find-offers

Search for a line that looks like this:

Store           URL              Access  Interfaces
k8s-controller  admin/cos.tempo  admin   tracing:tracing

If you don’t see an offer like that, enable it with the following command:

juju offer tempo:tracing

Now switch to the model where you have charmed MAAS deployed:

juju switch maas-controller:maas-model

Finally, relate the MAAS and Tempo charms over the tracing interface

juju relate maas-region:tracing tempo:tracing

Visualize traces in Grafana

To view the traces of the MAAS region charm:

  • Open Grafana in your browser (see here for detailed instructions)
  • Go to the Explore tab
  • Select the Tempo datasource
  • Select the Search query type
  • Pick maas-region-charm as the service
  • Query it!

You should now see a list of traces from the charm. You can inspect them by clicking on a trace ID. Here is a sample screenshot: