Skip to content

improve grafana configuration steps #5795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 5, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions docs/snippets/collecting-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,61 @@ aggregating timeseries metrics and alerting. It can also be used to scrape the O
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/servicemonitor.yaml
```

1. Grafana dashboards can be imported from the [`knative-extensions` repository](https://github.com/knative-extensions/monitoring/tree/main/grafana).
### Access the Prometheus instance locally

By default, the Prometheus instance is only exposed on a private service named `prometheus-kube-prometheus-prometheus`.

To access the console in your web browser:

1. Enter the command:

```bash
kubectl port-forward -n default svc/prometheus-kube-prometheus-prometheus 9090:9090
```

1. Access the console in your browser via `http://localhost:9090`.

### Setting up Grafana
Copy link
Contributor

@skonto skonto Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Setting up Grafana dashboards? 🤔
Otherwise it seems like we are installing Grafana, maybe the top level title should be: "Setting up the Prometheus Stack" and mention that it includes Grafana by default.


1. Grafana dashboards can be imported from the [`monitoring` repository](https://github.com/knative-extensions/monitoring/tree/main/grafana).

1. If you are using the Grafana Helm Chart with the Dashboard Sidecar enabled, you can load the dashboards by applying the following configmaps.

```bash
kubectl apply -f https://raw.githubusercontent.com/knative-extensions/monitoring/main/grafana/dashboards.yaml
```

### Access the Prometheus instance locally
!!! caution
You will need to ensure that the helm chart has following values configured, otherwise the dashboards loading will not work.
```yaml
grafana:
sidecar:
dashboards:
enabled: true
searchNamespace: ALL
```
If you have an existing configmap and the dashboards loading doesn't work, add the `labelValue: true` attribute to the helm chart after the `searchNamespace: ALL` declaration.

By default, the Prometheus instance is only exposed on a private service named `prometheus-operated`.
#### Access the Grafana instance locally
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be one level up, ###


To access the console in your web browser:
By default, the Grafana instance is only exposed on a private service named `prometheus-grafana`.

To access the dashboards in your web browser:

1. Enter the command:

```bash
kubectl port-forward -n default svc/prometheus-operated 9090
kubectl port-forward -n default svc/prometheus-grafana 3000:80
```

1. Access the console in your browser via `http://localhost:9090`.
1. Access the dashboards in your browser via `http://localhost:3000`.

1. Use the default credentials to login:

```text
username: admin
password: prom-operator
```

## About OpenTelemetry

Expand Down