How to integrate with COS
This guide demonstrates the process of integrating with the Canonical Observability Stack (COS) using the optional cos-agent
integration provided by this charm.
The cos-agent
integration can be consumed by the grafana-agent charm, which is responsible for transmitting logs, Prometheus metrics, and Grafana dashboards to the COS stack.
Note: The Github Runner charm and grafana-agent charm function as machine charms, while the COS stack comprises Kubernetes charms. Therefore, establishing cross-model integrations is necessary, along with potential firewall rule configurations to allow inter-model traffic.
Prerequisites
- Deploy the Github Runner Charm with the application name
github-runner
in themachine-model
. - Deploy the COS stack on a Kubernetes cloud (refer to this tutorial).
- Ensure
loki
,prometheus
,grafana
, andtraefik
charms are deployed within a model namedk8s-model
. - Integration between
loki
andtraefik
is required to enablegrafana-agent
to transmit logs by setting a public IP for the loki service accessible from the machine cloud. - Confirm that both models exist in the same Juju controller. If not, adjust the model names by appending the respective controller name (followed by “:”) in the subsequent steps. Ensure you have the necessary permissions to consume the offers.
- Ensure
Steps
- Deploy the
grafana-agent
charm in the machine model.juju switch machine-model juju deploy grafana-agent --channel latest/edge
- Integrate the
grafana-agent
charm with the Github Runner charm.juju integrate github-runner grafana-agent
- Create offers for
loki
,prometheus
, andgrafana-agent
in thek8s-model
.juju switch k8s-model juju offer loki:logging juju offer prometheus:receive-remote-write juju offer grafana:grafana-dashboard
- Consume the offers in the machine model.
juju switch machine-model juju consume loki juju consume prometheus juju consume grafana
- Integrate the
grafana-agent
charm withloki
,prometheus
, andgrafana
.juju integrate loki-k8s grafana-agent juju integrate prometheus-k8s grafana-agent juju integrate grafana-k8s grafana-agent
You should now be able to access a Grafana Dashboard named GitHub Self-Hosted Runner Metrics
, displaying metrics, and another named System Resources
exhibiting host resources in Grafana.
Additionally, you can explore Loki logs using Grafana’s Explore function. For detailed information about the specific metrics in the GitHub Self-Hosted Runner Metrics
dashboard, refer to Metrics.