|
1 |
| -# Monitoring |
| 1 | +# How to Set Up Monitoring on Nebari |
2 | 2 |
|
3 | 3 | In Nebari, we've integrated Grafana, Prometheus, and Loki to provide robust monitoring capabilities for
|
4 | 4 | your data science platform. This integration allows you to visualize metrics, monitor system health, and
|
@@ -28,37 +28,9 @@ metrics from configured targets, stores them efficiently, and allows querying th
|
28 | 28 |
|
29 | 29 | [Loki](https://grafana.com/docs/loki/latest/) is a horizontally-scalable, highly available, multi-tenant log
|
30 | 30 | aggregation system inspired by Prometheus. It is designed to be very cost-effective and easy to operate, as it
|
31 |
| -does not index the contents of the logs, but rather a set of labels for each log stream. Below is a step-by-step |
32 |
| -walkthrough of how to view JupyterHub pod logs in Grafana Loki: |
| 31 | +does not index the contents of the logs, but rather a set of labels for each log stream. |
33 | 32 |
|
34 |
| -Go to explore section of monitoring of your Nebari installation at: |
35 |
| -
|
36 |
| -https://{your-nebari-domain}/monitoring/ |
37 |
| -
|
38 |
| - |
39 |
| -
|
40 |
| -Select Loki Data source at the top: |
41 |
| -
|
42 |
| - |
43 |
| -
|
44 |
| -Click on the Log browser and select labels to search in, in this case we have selected pod: |
45 |
| -
|
46 |
| - |
47 |
| -
|
48 |
| -Type the pod name initials for the pod you're looking to search logs for, in this case we are looking |
49 |
| -for hub pod: |
50 |
| -
|
51 |
| - |
52 |
| -
|
53 |
| -Select the pod from the list of pods and then click on "Show logs": |
54 |
| -
|
55 |
| - |
56 |
| -
|
57 |
| -After clicking on "Show logs", you should be able to see logs for JupyterHub pod as shown below: |
58 |
| -
|
59 |
| - |
60 |
| -
|
61 |
| -You can also filter by time, by clicking on the time filter on top right, next to "Run query". |
| 33 | +See [How to access system logs (Loki) via Grafana][access-logs-loki] for more information on using Loki in Nebari. |
62 | 34 |
|
63 | 35 | ## Terraform Overrides
|
64 | 36 |
|
@@ -147,3 +119,30 @@ monitoring:
|
147 | 119 | compactor:
|
148 | 120 | retention_enabled: false
|
149 | 121 | ```
|
| 122 | + |
| 123 | +## Logging architecture |
| 124 | + |
| 125 | +The architecture diagram below shows a simplified, high level explanation of the logging components on Nebari. |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | +`Grafana` is the dashboarding user interface which allows us to use `Loki` as the data source for our logs. `Loki` connects to [`promtail`](https://grafana.com/docs/loki/latest/send-data/promtail/) as it's source. |
| 130 | + |
| 131 | +The `promtail` component scrapes logs from various pods on the kubernetes nodes. The `kube api server` provides the API endpoints which `promtail` uses for for discovering and scraping its targeted resources |
| 132 | + |
| 133 | +End users viewing the logs in `Grafana` will create queries using `Loki` as the data source, typically querying based on `labels`. However, it's important to note that Grafana labels differ from Kubernetes labels, as their main goal is to act as an aggregation layer of logs from multiple matching resources into a single "stream," allowing users to easily access a collection of logs from various Kubernetes resources with just a single logical label. |
| 134 | + |
| 135 | +:::note |
| 136 | +Loki's "labels" are used to filter collections of logs from the available [kubernetes_sd](https://grafana.com/docs/loki/latest/send-data/promtail/configuration/#kubernetes_sd_config) API endpoints, in a similar way as to how Prometheus handles metrics. These labels are configured through Promtail, which is the agent responsible for collecting and shipping logs to Loki, based on the defined [targets](https://grafana.com/docs/loki/latest/send-data/promtail/configuration/#scrape_configs) and scraping configurations. |
| 137 | +::: |
| 138 | + |
| 139 | +For details on how to view specific logs in Loki, check out the document ["How to access system logs (Loki) via Grafana"](access-logs-loki) |
| 140 | + |
| 141 | +## References |
| 142 | + |
| 143 | +[More information on promtail configurations](https://grafana.com/docs/loki/latest/send-data/promtail/configuration/) |
| 144 | +[Understanding labels in Loki](https://grafana.com/docs/loki/latest/get-started/labels/#understand-labels) |
| 145 | + |
| 146 | +<!-- Internal links --> |
| 147 | + |
| 148 | +[access-logs-loki]: /how-tos/access-logs-loki.md |
0 commit comments