Skip to content

Commit a648a2e

Browse files
Sync docs from Discourse (#313)
Sync charm docs from https://discourse.charmhub.io Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent bd2f317 commit a648a2e

24 files changed

+211
-65
lines changed
File renamed without changes.
File renamed without changes.

docs/how-to/h-monitor/h-enable-monitoring.md renamed to docs/how-to/h-enable-monitoring.md

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,56 @@
1-
# Enable monitoring
1+
[note]
2+
**Note**: All commands are written for [`juju >= v3.0`](https://juju.is/docs/juju/roadmap#heading--juju-3-0-0---22-oct-2022)
3+
[/note]
24

3-
> **:information_source: Hint**: Use [Juju 3](/t/5064). Otherwise replace `juju run ...` with `juju run-action --wait ...` and `juju integrate` with `juju relate` for Juju 2.9
5+
# How to enable monitoring with COS and Grafana
46

5-
Enabling monitoring requires that you:
7+
This guide goes over the steps to integrate MySQL Router K8s deployment with COS to enable monitoring in Grafana.
68

7-
* [Have a Charmed MySQLRouter K8s deployed](https://charmhub.io/mysql-router/docs/t-deploy-charm?channel=dpe/edge)
8-
* [Deploy cos-lite bundle in a Kubernetes environment](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s)
9+
To learn about Alert Rules, see [Charmed MySQL K8s > How to enable COS Alert Rules](https://charmhub.io/mysql-k8s/docs/h-enable-alert-rules).
910

10-
Switch to the COS K8s environment and offer COS interfaces to be cross-model related with Charmed MySQLRouter K8s model:
11+
## Prerequisites
12+
* A deployed [Charmed MySQL Router K8s](/t/12233) operator
13+
* A deployed [‘cos-lite’ bundle in a Kubernetes environment](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s)
14+
15+
## Summary
16+
* [Offer interfaces via the COS controller](#offer-interfaces-via-the-cos-controller)
17+
* [Consume offers via the MySQL Router K8s model](#consume-offers-via-the-mysql-router-k8s-model)
18+
* [Deploy and integrate Grafana](#deploy-and-integrate-grafana)
19+
* [Connect to the Grafana web interface](#connect-to-the-grafana-web-interface)
20+
21+
---
22+
23+
## Offer interfaces via the COS controller
24+
25+
First, we will switch to the COS K8s environment and offer COS interfaces to be cross-model integrated with the Charmed MySQLRouter K8s model.
26+
27+
To switch to the Kubernetes controller for the COS model, run
1128

1229
```shell
13-
# Switch to the Kubernetes controller, on the COS model
14-
juju switch <k8s_cos_controller>:<cos_model_name>
30+
juju switch <k8s_controller>:<cos_model_name>
31+
```
1532

33+
To offer the COS interfaces, run
34+
```shell
1635
juju offer grafana:grafana-dashboard
1736
juju offer loki:logging
1837
juju offer prometheus:receive-remote-write
1938
```
39+
## Consume offers via the MySQL Router K8s model
2040

21-
Switch to the Charmed MySQLRouter K8s model, find offers and consume them:
41+
Next, we will switch to the Charmed MySQL Router K8s model, find offers, and consume them.
42+
43+
We are currently on the Kubernetes controller for the COS model. To switch to the MySQL Router K8smodel, run
2244

2345
```shell
24-
# We are on the Kubernetes controller, on the COS model. Switch the mysqlrouter model
2546
juju switch <k8s_db_controller>:<mysql_router_model_name>
26-
47+
```
48+
Display a list of available interfaces with the following command:
49+
```shell
2750
juju find-offers <k8s_cos_controller>: # Do not miss the ':' here!
2851
```
2952

30-
A similar output should appear, if `k8s` is the k8s controller name and `cos` is the model where cos-lite has been deployed:
53+
In the sample output below, `k8s` is the k8s controller name and `cos` is the model where `cos-lite` has been deployed:
3154

3255
```shell
3356
Store URL Access Interfaces
@@ -36,31 +59,36 @@ k8s admin/cos.loki admin loki_push_api:logging
3659
k8s admin/cos.prometheus admin prometheus_remote_write:receive-remote-write
3760
```
3861

39-
Consume the offers to be reachable in the current model:
62+
To consume offers to be reachable in the current model, run
4063

4164
```shell
4265
juju consume k8s:admin/cos.grafana
4366
juju consume k8s:admin/cos.loki
4467
juju consume k8s:admin/cos.prometheus
4568
```
4669

47-
Now, deploy ‘[grafana-agent-k8s](https://charmhub.io/grafana-agent-k8s)and integrate (relate) it with Charmed MySQLRouter K8s, then later integrate (relate) `grafana-agent-k8s` with the consumed COS offers:
70+
## Deploy and integrate Grafana
4871

72+
First, deploy [grafana-agent](https://charmhub.io/grafana-agent):
4973
```shell
5074
juju deploy grafana-agent-k8s --trust
51-
75+
```
76+
Then, integrate (previously known as "[relate](https://juju.is/docs/juju/integration)") `grafana-agent` with Charmed MySQL Router K8s:
77+
```shell
5278
juju integrate grafana-agent-k8s grafana
5379
juju integrate grafana-agent-k8s loki
5480
juju integrate grafana-agent-k8s prometheus
55-
81+
```
82+
Finally, integrate `grafana-agent-k8s` with the consumed COS offers:
83+
```shell
5684
juju integrate grafana-agent-k8s mysql-router-k8s:grafana-dashboard
5785
juju integrate grafana-agent-k8s mysql-router-k8s:logging
5886
juju integrate grafana-agent-k8s mysql-router-k8s:metrics-endpoint
5987
```
6088

61-
After this is complete, Grafana will show the new dashboards `MySQLRouter Exporter` and allow access for Charmed MySQLRouter K8s logs on Loki.
89+
After this is complete, Grafana will show the new dashboards `MySQLRouter Exporter` and allow access for Charmed MySQL Router K8s logs on Loki.
6290

63-
An example of `juju status` on Charmed MySQLRouter K8s model:
91+
An example of `juju status` on Charmed MySQL Router K8s model:
6492

6593
```shell
6694
ubuntu@localhost:~$ juju status
@@ -114,7 +142,9 @@ loki loki loki-k8s 124 2/2 logging loki_push_api
114142
prometheus prometheus prometheus-k8s 171 2/2 receive-remote-write prometheus_remote_write provider
115143
```
116144

117-
To connect Grafana WEB interface, follow the COS section “[Browse dashboards](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s#heading--browse-dashboards)”:
145+
## Connect to Grafana web interface
146+
147+
To connect to the Grafana web interface, follow the [Browse dashboards](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s?_ga=2.201254254.1948444620.1704703837-757109492.1701777558#heading--browse-dashboards) section of the MicroK8s "Getting started" guide.
118148

119149
```shell
120150
juju run grafana/leader get-admin-password --model <k8s_controller>:<cos_model_name>

docs/how-to/h-monitor/h-enable-tracing.md renamed to docs/how-to/h-enable-tracing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Integrate `tempo-k8s` with the COS charms as follows:
4949
```shell
5050
juju integrate tempo-k8s:grafana-dashboard grafana:grafana-dashboard
5151
juju integrate tempo-k8s:grafana-source grafana:grafana-source
52-
juju integrate tempo-k8s:ingress traefik:traefik
52+
juju integrate tempo-k8s:ingress traefik:traefik-route
5353
juju integrate tempo-k8s:metrics-endpoint prometheus:metrics-endpoint
5454
juju integrate tempo-k8s:logging loki:logging
5555
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)