How to integrate with COS

The WireGuard gateway charm provides metrics, logging, and Grafana dashboard integration with the COS solution. This integration is facilitated by the cos-agent relation interface with any charms compatible with the cos-agent relation interface, such as the OpenTelemetry collector charm.

Integrate with OpenTelemetry

The OpenTelemetry collector charm is the entry point for all COS integrations. The OpenTelemetry collector charm installs the OpenTelemetry Collector on the WireGuard gateway charm machine and scrapes metrics, forwards logs, and transmits the Grafana dashboard to upstream metrics and logging charms like Prometheus and Loki, as well as to Grafana dashboard charms.

To integrate the OpenTelemetry collector charm with the WireGuard gateway charm, deploy the OpenTelemetry collector charm and integrate it with the cos-agent relation.

juju deploy opentelemetry-collector
juju integrate wireguard-gateway:cos-agent opentelemetry-collector

Integrate with Prometheus

Once the WireGuard gateway charm is integrated with the OpenTelemetry collector charm, you can integrate the OpenTelemetry collector charm with the Prometheus K8s charm with the send-remote-write relation of the OpenTelemetry collector charm using a cross-model relation. This relation will instruct the OpenTelemetry collector charm to send all WireGuard gateway metrics to the remote Prometheus instance.

juju consume k8s:admin/cos.prometheus
juju integrate opentelemetry-collector:send-remote-write prometheus

Integrate with Loki

You can integrate the OpenTelemetry collector charm with the Loki K8s charm with the send-remote-write relation of the OpenTelemetry collector charm using a cross-model relation. This relation will instruct the OpenTelemetry collector charm to send all logs on the machine to the remote Loki instance.

juju consume k8s:admin/cos.loki
juju integrate opentelemetry-collector:send-loki-logs loki

Integrate with Grafana

You can integrate the OpenTelemetry collector charm with the Grafana K8s charm with the grafana-dashboards-provider relation of the OpenTelemetry collector charm using a cross-model relation. This relation will instruct the OpenTelemetry collector charm to relay the WireGuard gateway Grafana dashboard to the remote Grafana instance.

juju consume k8s:admin/cos.grafana
juju integrate opentelemetry-collector:grafana-dashboards-provider grafana

Access the WireGuard gateway dashboard

After you have set up the WireGuard gateway dashboard with COS, you can access it from the Grafana dashboard list and look for the dashboard named “WireGuard Gateway Operator”.

How you access the Grafana dashboard depends on the COS deployment, especially the ingress option you chose. You can refer to the COS documentation for more detailed guidance.