How to import dashboards by grafana sidecar #1338
Replies: 8 comments 1 reply
-
I've reproduced this issue, although I'm unsure if the root cause is the same. The problem is that the sidecar tries to do basic authentication using Grafana credentials in the HTTP request to {
"code": "InvalidCredentials",
"message": "Invalid password",
"requestId": "18f1a4bd-fc89-4716-ad16-67682896831a"
} If you tail the logs from Grafana server (Grafana running in your k8s), do you see errors similar to this?
|
Beta Was this translation helpful? Give feedback.
-
Regarding the data sources, I can import data sources without issues. I created the following ---
apiVersion: v1
kind: Secret
metadata:
name: prometheus-ds
namespace: grafana
labels:
grafana_datasource: "true"
stringData:
prometheus.yaml: |-
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server.prometheus.svc
access: server
isDefault: true Note that my Prometheus is deployed in sidecar:
datasources:
enabled: true
label: grafana_datasource
labelValue: "true"
skipReload: false |
Beta Was this translation helpful? Give feedback.
-
Hi Zerpet, Thanks for your response. Actually I checked my grafana-server, and it didn't report any error, just some warnings to suggest enable TLS. |
Beta Was this translation helpful? Give feedback.
-
My way is following the rabbitmq document: https://www.rabbitmq.com/kubernetes/operator/operator-monitoring.html#prom-operator, install prometheus operator first, then install prometheus by "prometheus" CRD, which referred: https://prometheus-operator.dev/docs/user-guides/getting-started/#installing-the-operator. Although rabbitmq document provides the podmonitor and servicemonitor spec to apply, it doesn't work well due to we must configure the label, so that we can specify the label name in prometheus spec for installation. (This also cost me a lot of time to figure out why prometheus cannot find the podmonitor and servicemonitor resources). After I verified prometheus found the resources successfully, the process was pending on configuring grafana sidecar due to lack of neccessary configuration example reference. I have now deployed prometheus and grafana in one click using kube-prometheus-stack to replace the previous installation. but from the provided dashboard, not quite as cool as rabbitmq-overview indeed. (manually import rabbitmq-overview still does not work well, no data or N/A shown in the dashboard) I'll look into it later, or try the secret you provided to see if it works. |
Beta Was this translation helpful? Give feedback.
-
That is correct. We have the following comment in the YAML: I guess we could add the same warning to the docs.
I agree the sidecar configuration is not well documented on the Grafana side. It also took me a while to figure out how to use it properly. However, I don't think we should overlap our docs with Grafana specific configuration. I noticed an issue with our dashboards that I'm planning to fix in #1334.
Do you have errors reported in the dashboards? |
Beta Was this translation helpful? Give feedback.
-
Yes, overlap docs are not neccessary from RabbitMQ side, but I suggest enrich the examples of necessary configurations(like: secret, data-source configuration and so on) on this path: https://github.com/rabbitmq/cluster-operator/tree/main/observability/grafana/dashboards, not only dashboards floder. Because only dashboards can not make grafana working well. |
Beta Was this translation helpful? Give feedback.
-
The error is no data sources found, which looks grafana can not find prometheus data sources successfully. |
Beta Was this translation helpful? Give feedback.
-
I don't think we should document data-sources in our repo, because it depends entirely on how a user deploys Prometheus. For example, Prometheus can be deployed in any namespace, it can be queried directly, via Thanos, via Grafana Mimir, and other methods. Each deployment type would require a specific data source example, and probably clarifications and concrete instructions. At that point, we would be documenting how to configure Grafana data-sources, and the best place for those instructions is Grafana docs, not RabbitMQ docs 🙂
It looks like Prometheus data source is not configured correctly. If you deployed Prometheus using Prometheus Operator, it probably deployed a Pay also attention to the labels in your P.s: I'm going to convert this issue to a discussion, since this is a troubleshooting effort. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I referred the document: https://www.rabbitmq.com/kubernetes/operator/operator-monitoring.html and tried to import example dashboards into grafana: https://github.com/rabbitmq/cluster-operator/tree/main/observability/grafana/dashboards.
But the document was so brief both in rabbitmq and grafana side, which took me a long time to figure out how I needed to specify helm chart values during the grafana installation.
My environment was (following the rabbitmq document to "kubectl apply all of examples"):
And I tried to configure following values for grafana helm chart:
But it didn't wok well that the grafana UI said no datasources found, and the dashboard was not fully imported:
Please advise how to configure the grafana helm chart values to import the example dashboards.
Beta Was this translation helpful? Give feedback.
All reactions