Skip to content
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

improve grafana configuration steps #5795

Merged
merged 6 commits into from
Jan 5, 2024

Conversation

prushh
Copy link
Contributor

@prushh prushh commented Dec 14, 2023

Proposed Changes

@knative-prow knative-prow bot requested review from skonto and snneji December 14, 2023 16:35
Copy link

netlify bot commented Dec 14, 2023

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b8d6af8
🔍 Latest deploy log https://app.netlify.com/sites/knative/deploys/658577bdb418e40008376c83
😎 Deploy Preview https://deploy-preview-5795--knative.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@knative-prow knative-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 14, 2023
```
If you have an existing configmaps check the value of `grafana_dashboard` label. In case this is `true`, add the `labelValue: true` attribute to the helm chart above.
```bash
kubectl -n knative-serving get configmaps/knative-serving-dashboards -o jsonpath="{.metadata.labels.grafana_dashboard}"; echo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

How can I adapt namespace and cm name based on the selected section? (Serving/Eventing)

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's omit this part about printing that value. Also let's be specific where to add the value. eg after searchNamespace: ALL.

@ReToCode
Copy link
Member

/assign @skonto

enabled: true
searchNamespace: ALL
```
If you have an existing configmaps check the value of `grafana_dashboard` label. In case this is `true`, add the `labelValue: true` attribute to the helm chart above.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/configmaps/configmap

password: prom-operator
```

!!! tip
Copy link
Contributor

@skonto skonto Dec 19, 2023

Choose a reason for hiding this comment

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

Although this might be useful if password changes etc (I know I mentioned it on the other PR), let's omit it for now as it seems a bit not that Knative related, we are going a bit too far. I think it belongs at the Prometheus operator side.
In general it would be nice if we could point to a doc page for the Prometheus operator for all these details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can try to find one that suits us!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did some research, and in my opinion the most useful link is https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/README.md (in particular the Configuration section).

There is also a Further Information section where they linked external resources like Prometheus Operator, Prometheus and Grafana.

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

We could add a pointer to that instead of the tip, but it does not say much about credentials and not sure if it is going to help a novice. So for now let's not add anything, remove the tip and in the future we can always revise it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done with the latest commit 😄

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-operated`.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/prometheus-operated/prometheus-kube-prometheus-prometheus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


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.

Describe kube-prometheus-stack and components

[Prometheus](https://prometheus.io/) is an open-source tool for collecting,
aggregating timeseries metrics and alerting. It can also be used to scrape the OpenTelemetry Collector that is demonstrated below when Prometheus is used.
[Prometheus Stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) is a preconfigured collection of Kubernetes manifests, Grafana dashboards, and Prometheus rules, combined to provide end-to-end Kubernetes cluster monitoring with Prometheus using the Prometheus Operator. The stack includes by default some Prometheus packages and Grafana.
Copy link
Contributor

@skonto skonto Dec 21, 2023

Choose a reason for hiding this comment

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

nit: Let's put this after Prometheus and Grafana bellow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The section titles are okay? I'm not sure about Import Grafana dashboard

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move "Import Grafana dashboards" after "Access the Grafana instance locally". These should be at the same level.


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, ###

@skonto
Copy link
Contributor

skonto commented Jan 5, 2024

@prushh thank you!
/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2024
Copy link

knative-prow bot commented Jan 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: prushh, skonto

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 5, 2024
@knative-prow knative-prow bot merged commit 6630e4b into knative:main Jan 5, 2024
19 checks passed
prushh added a commit to prushh/docs that referenced this pull request Apr 30, 2024
* improve grafana configuration steps

* update metrics documentation

* fix prometheus svc name

* fix section titles

Describe kube-prometheus-stack and components

* fix prometheus stack sections order

* fix grafana sections order and level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants