Skip to content

Commit 36a780a

Browse files
authored
Merge branch 'main' into remove_env_man_file
2 parents a700f95 + f2915de commit 36a780a

11 files changed

+141
-32
lines changed

docs/docs/how-tos/access-logs-loki.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Access system logs (Loki) via Grafana
3+
description: Access common system logs on Nebari
4+
---
5+
6+
# How to access system logs (Loki) via Grafana
7+
8+
Below is a step-by-step walkthrough of how to view JupyterHub pod logs in Grafana [Loki](https://grafana.com/docs/loki/latest/). As similar approach can be used to find other commonly accessed logs (summarized at the end of this document).
9+
10+
To view the Loki logs via Grafana in Nebari, you'll need to have [set up monitoring](/docs/how-tos/setup-monitoring) on your deployment.
11+
12+
## Getting Started
13+
14+
Access the Monitoring UI for your Nebari installation at https://{your-nebari-domain}/monitoring/.
15+
16+
:::note
17+
The **Explore** functionality shown below is only available to users who have `grafana_admin` permissions. In Nebari's default configuration, only the users in the `admin` Keycloak user group will have this role. `grafana_admin` is a client role in Keycloak which can be assigned to other groups or users. See [Configure Keycloak](/docs/how-tos/configuring-keycloak#in-depth-look-at-roles-and-groups) for more information.
18+
:::
19+
20+
First, click "Explore".
21+
22+
![Grafana Explore Page](/img/how-tos/1_grafana-explore.png)
23+
24+
Select Loki as the data source at the top:
25+
26+
![Grafana Select Loki](/img/how-tos/2_grafana-select-loki.png)
27+
28+
Select a Label to search. For this example, we will select `pod`:
29+
30+
![Grafana Select Loki](/img/how-tos/3_grafana-log-browser-pod.png)
31+
32+
Begin typing the name of the desired pod. In this case we are looking
33+
for a JupyterHub pod. The exact name will vary on each deployment but it will begin with `hub-` followed by a unique identifier.
34+
35+
![Grafana Select Loki](/img/how-tos/4_grafana-log-search-pod.png)
36+
37+
Select the pod from the list of pods and then click on "Run Query":
38+
39+
![Grafana Select Loki](/img/how-tos/5_grafana-log-select-pod.png)
40+
41+
After clicking on "Run Query", you should be able to see logs for JupyterHub pod as shown below:
42+
43+
![Grafana Select Loki](/img/how-tos/6_grafana-view-pod-logs.png)
44+
45+
You can also filter by time by clicking on the time filter on top right (next to "Run query").
46+
47+
## Common Queries
48+
49+
The approach above can be used to access a wide variety of logs on Nebari. Below are some common queries.
50+
51+
### JupyterLab Server Logs
52+
53+
Each user will have their own JupyterLab instance (which may or may not be running at any given time) which will contain its own set of logs. To view the logs for a JupyterLab server, use `pod` label and begin typing the username of interest. The pod name will be `jupyter-{username}`.
54+
55+
### Conda-Store Logs
56+
57+
Conda-store runs multiple pods on the backend. The conda-store server runs continuously while conda-store-workers are only started when an environment is being built. Therefore, worker pods may not always exist. Generally, user requests and access logs will be in the server pod, while logs related to environment builds will be in a worker pod. In the list of conda-store pods shown below, you'll also see pods for `minio`, `postgresql`, and `redis`. These are used internally by conda-store are not likely to have any logs of interest.
58+
59+
- `nebari-conda-store-server-[id]`
60+
- `nebari-conda-store-worker-[id]`
61+
- `nebari-conda-store-minio-[id]`
62+
- `nebari-conda-store-postgresql-postgresql-0`
63+
- `nebari-conda-store-redis-master-0`
64+
65+
### Deployed app logs (via jhub-apps)
66+
67+
If you have `jhub-apps` enabled on your deployment, you can view the logs to debug deployed apps.
68+
69+
To see the logs from **all deployed apps**, use the label filter `container` = `notebook`. The main container in each deployed app pod is named `notebook`.
70+
71+
To see **logs from a specific app**, use the `pod` label and begin typing either the name of the user running the app or the app name to find the correct pod. App pods are named with the convention `jupyter-[username]--[app_name]-[pod_id]`.
72+
73+
## Additional Information
74+
75+
- [Understand Log Query Structure](https://grafana.com/docs/loki/latest/query/log_queries/)
76+
- [Use the Query Editor](https://grafana.com/docs/grafana/latest/datasources/loki/query-editor/#choose-a-query-editing-mode)

docs/docs/how-tos/monitoring.md renamed to docs/docs/how-tos/setup-monitoring.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Monitoring
1+
# How to Set Up Monitoring on Nebari
22

33
In Nebari, we've integrated Grafana, Prometheus, and Loki to provide robust monitoring capabilities for
44
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
2828
2929
[Loki](https://grafana.com/docs/loki/latest/) is a horizontally-scalable, highly available, multi-tenant log
3030
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.
3332
34-
Go to explore section of monitoring of your Nebari installation at:
35-
36-
https://{your-nebari-domain}/monitoring/
37-
38-
![Grafana Explore Page](/img/how-tos/1_grafana-explore.png)
39-
40-
Select Loki Data source at the top:
41-
42-
![Grafana Select Loki](/img/how-tos/2_grafana-select-loki.png)
43-
44-
Click on the Log browser and select labels to search in, in this case we have selected pod:
45-
46-
![Grafana Select Loki](/img/how-tos/3_grafana-log-browser-pod.png)
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-
![Grafana Select Loki](/img/how-tos/4_grafana-log-search-pod.png)
52-
53-
Select the pod from the list of pods and then click on "Show logs":
54-
55-
![Grafana Select Loki](/img/how-tos/5_grafana-log-select-pod.png)
56-
57-
After clicking on "Show logs", you should be able to see logs for JupyterHub pod as shown below:
58-
59-
![Grafana Select Loki](/img/how-tos/6_grafana-view-pod-logs.png)
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.
6234
6335
## Terraform Overrides
6436
@@ -147,3 +119,30 @@ monitoring:
147119
compactor:
148120
retention_enabled: false
149121
```
122+
123+
## Logging architecture
124+
125+
The architecture diagram below shows a simplified, high level explanation of the logging components on Nebari.
126+
127+
![Grafana](/img/how-tos/grafana-loki-promtail-architecture.png)
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

docs/docs/references/RELEASE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,39 @@ This file is copied to nebari-dev/nebari-docs using a GitHub Action. -->
99

1010
---
1111

12+
### Release 2024.7.1 - August 8, 2024
13+
14+
> NOTE: Support for Digital Ocean deployments using CLI commands and related Terraform modules is being deprecated. Although Digital Ocean will no longer be directly supported in future releases, you can still deploy to Digital Ocean infrastructure using the current `existing` deployment option.
15+
16+
## What's Changed
17+
* Enable authentication by default in jupyter-server by @krassowski in https://github.com/nebari-dev/nebari/pull/2288
18+
* remove dns sleep by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2550
19+
* Conda-store permissions v2 + load roles from keycloak by @aktech in https://github.com/nebari-dev/nebari/pull/2531
20+
* Restrict public access and add bucket encryption using cmk by @dcmcand in https://github.com/nebari-dev/nebari/pull/2525
21+
* Add overwrite to AWS coredns addon by @dcmcand in https://github.com/nebari-dev/nebari/pull/2538
22+
* Add a default roles at initialisation by @aktech in https://github.com/nebari-dev/nebari/pull/2546
23+
* Hide gallery section if no exhibits are configured by @krassowski in https://github.com/nebari-dev/nebari/pull/2549
24+
* Add note about ~/.bash_profile by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2575
25+
* Expose jupyterlab-gallery branch and depth options by @krassowski in https://github.com/nebari-dev/nebari/pull/2556
26+
* #2566 Upgrade Jupyterhub ssh image by @arjxn-py in https://github.com/nebari-dev/nebari/pull/2576
27+
* Stop copying unnecessary files into user home directory by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2578
28+
* Include deprecation notes for init/deploy subcommands by @viniciusdc in https://github.com/nebari-dev/nebari/pull/2582
29+
* Only download jar if file doesn't exist by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2588
30+
* Remove unnecessary experimental flag by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2606
31+
* Add typos spell checker to pre-commit by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2568
32+
* Enh 2451 skip conditionals by @BrianCashProf in https://github.com/nebari-dev/nebari/pull/2569
33+
* Improve codespell support: adjust and concentrate config to pyproject.toml and fix more typos by @yarikoptic in https://github.com/nebari-dev/nebari/pull/2583
34+
* Move codespell config to pyproject.toml only by @Adam-D-Lewis in https://github.com/nebari-dev/nebari/pull/2611
35+
* Add `depends_on` for bucket encryption by @viniciusdc in https://github.com/nebari-dev/nebari/pull/2615
36+
37+
## New Contributors
38+
* @BrianCashProf made their first contribution in https://github.com/nebari-dev/nebari/pull/2569
39+
* @yarikoptic made their first contribution in https://github.com/nebari-dev/nebari/pull/2583
40+
41+
42+
**Full Changelog**: https://github.com/nebari-dev/nebari/compare/2024.6.1...2024.7.1
43+
44+
1245
### Release 2024.6.1 - June 26, 2024
1346

1447
> NOTE: This release includes an upgrade to the `kube-prometheus-stack` Helm chart, resulting in a newer version of Grafana. When upgrading your Nebari cluster, you will be prompted to have Nebari update some CRDs and delete a DaemonSet on your behalf. If you prefer, you can also run the commands yourself, which will be shown to you. If you have any custom dashboards, you'll also need to back them up by [exporting them as JSON](https://grafana.com/docs/grafana/latest/dashboards/share-dashboards-panels/#export-a-dashboard-as-json), so you can [import them](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/import-dashboards/#import-a-dashboard) after upgrading.

docs/sidebars.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ module.exports = {
7878
"how-tos/idle-culling",
7979
"how-tos/nebari-extension-system",
8080
"how-tos/telemetry",
81-
"how-tos/monitoring",
81+
"how-tos/setup-monitoring",
82+
"how-tos/access-logs-loki",
8283
"how-tos/use-gpus",
8384
"how-tos/fine-grained-permissions",
8485
],
17.3 KB
Loading
-5.21 KB
Loading
-167 KB
Loading
-105 KB
Loading
-200 KB
Loading
-670 KB
Loading

0 commit comments

Comments
 (0)