-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(prom-grafana docs): revamp prometheus and grafana pages (#809)
# Description * fix instructions for Prometheus and Grafana installation * revamp and restructure ## Related Issue fix #758 ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [x] I have updated the documentation, if necessary. - [x] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ![image](https://github.com/user-attachments/assets/9c5b742a-f4bd-4003-b2f4-078c2a5d319e) ![image](https://github.com/user-attachments/assets/5e1880f4-bd82-4a19-894c-82cf4482d900) ![image](https://github.com/user-attachments/assets/1d9c37df-480c-4409-9cf1-28e195fc7b3a) ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Simone Rodigari <[email protected]>
- Loading branch information
Showing
16 changed files
with
101 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Prometheus | ||
|
||
Prometheus is an open-source system monitoring and alerting toolkit originally built at SoundCloud. It is now a standalone open source project and maintained independently of any company. Prometheus's main features include a multi-dimensional data model, a flexible query language, efficient time series database, and modern alerting approach. For more information, visit the [Prometheus website](https://prometheus.io). | ||
|
||
## Pre-Requisites | ||
|
||
1. Create a Kubernetes cluster. | ||
2. Install Retina DaemonSet (see [Quick Installation](./01-Setup.md)). | ||
|
||
## Install Prometheus via Helm | ||
|
||
1. In this example, we will install Prometheus via the community supported helm chart. If you already have this chart deployed, skip to step 3. | ||
|
||
```shell | ||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | ||
helm repo update | ||
``` | ||
|
||
1. Install the Prometheus chart | ||
|
||
```shell | ||
helm install prometheus -n kube-system -f deploy/legacy/prometheus/values.yaml prometheus-community/kube-prometheus-stack | ||
``` | ||
|
||
Or if you already have the chart installed, upgrade how you see fit, providing the new job name as an additional scrape config, ex: | ||
|
||
```shell | ||
helm upgrade prometheus -n kube-system -f deploy/legacy/prometheus/values.yaml prometheus-community/kube-prometheus-stack | ||
``` | ||
|
||
> Note: Grafana and kube-state metrics may schedule on Windows nodes, the current chart doesn't have node affinity for those components. Some manual intervention may be required. | ||
## Access Prometheus UI | ||
|
||
1. Use port forwarding to accees Prometheus UI: | ||
|
||
```shell | ||
kubectl port-forward --namespace kube-system svc/prometheus-operated 9090 | ||
``` | ||
|
||
1. Go to [localhost:9090/targets](http://localhost:9090/targets) to see the Retina Pods being discovered and scraped by Prometheus | ||
|
||
![Prometheus Retina Targets](./img/prometheus-retina-targets.png) | ||
|
||
## Next steps | ||
|
||
Follow [Configuring Grafana](./05-grafana.md) to visualise metrics in dashboards. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Grafana | ||
|
||
Grafana is an open-source platform for monitoring and observability. It allows you to query, visualize, alert on, and explore your metrics no matter where they are stored. For more information, visit the [Grafana open-source section](https://grafana.com/oss/). | ||
|
||
## Pre-Requisites | ||
|
||
Make sure that you're still port-forwarding your server to [localhost:9090](http://localhost:9090) as part of [Prometheus](./04-prometheus.md) setup. Alternatively you can configure your server for some other HTTP endpoint, but that is not covered in the following instructions. | ||
|
||
## Configuring Grafana | ||
|
||
If you followed the steps to install and configure [Prometheus](./04-prometheus.md), you will already have Grafana installed as part of the `kube-prometheus-stack` Helm chart. | ||
|
||
1. Get Grafana user | ||
|
||
```shell | ||
kubectl get secret -n kube-system prometheus-grafana -o jsonpath="{.data.admin-user}" | base64 --decode ; echo | ||
``` | ||
|
||
2. Get Grafana password | ||
|
||
```shell | ||
kubectl get secret -n kube-system prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo | ||
``` | ||
|
||
3. Use port forwarding to access Grafana UI at [localhost:8080](http://localhost:8080) and enter you login credentials | ||
|
||
```shell | ||
kubectl port-forward --namespace kube-system svc/prometheus-grafana 8080:80 | ||
``` | ||
|
||
![Grafana login](./img/grafana-login.png) | ||
|
||
4. Make sure Prometheus is set as a default under Grafana datasources [localhost:8080/connections/datasources](http://localhost:8080/connections/datasources) | ||
|
||
![Grafana datasources](./img/grafana-datasources.png) | ||
|
||
5. Import the [kubernetes-networking-observability](https://grafana.com/grafana/dashboards/18814/) dashboard by id `18814` at [localhost:8080/dashboard/import](http://localhost:8080/dashboard/import) | ||
|
||
![Grafana import](./img/grafana-import.png) | ||
|
||
6. Kubernetes cluster metrics shouold be visible | ||
|
||
![Grafana kubernetes-networking-observability dashboard](./img/grafana-kubernetes-networking-dash.png) | ||
|
||
## Retina Dashboards | ||
|
||
There is a set of Retina dashboards that you can import directly into Grafana as json files. The dashboards are found under `deploy/legacy/grafana/dashboards/` if you installed retina legacy controlplane, and under `deploy/hubble/grafana/dashboards/` if you installed retina hubble controlplane. | ||
|
||
Here is an example of the Retina `dns.json` dashboard. | ||
|
||
![Grafana retina DNS dashboard](./img/grafana-retina-dns-dash.png) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.