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

Grafana Dashboard in Helm Chart doesn't work #256

Open
maxpain opened this issue Nov 3, 2024 · 11 comments
Open

Grafana Dashboard in Helm Chart doesn't work #256

maxpain opened this issue Nov 3, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@maxpain
Copy link

maxpain commented Nov 3, 2024

Hello. I've deployed the dragonfly-operator Helm chart with the following values:

serviceMonitor:
  enabled: true

grafanaDashboard:
  enabled: true

But getting this error:

image
@Pothulapati
Copy link
Collaborator

@maxpain With Dragonfly, We don't deploy the prometheus. The issue seems to be that the datasource is misconfigured. Can you check for the same?

Thanks

@maxpain
Copy link
Author

maxpain commented Nov 7, 2024

Yes, the provisioned dashboard doesn't have datasource variable

@Pothulapati
Copy link
Collaborator

Pothulapati commented Nov 8, 2024

You should be provisioning a prometheus instance right? if you already have one, add it into grafana and set it as the datasource of the dashboard.

The service monitor only configures prometheus to collect metrics 🤔

@maxpain
Copy link
Author

maxpain commented Nov 8, 2024

@Pothulapati Yes, I have configured Prometheus (actually VictoriaMetrics, which is much better) for my Grafana installation.
All my Grafana dashboards are declaratively provisioned via ConfigMaps. Almost all of them are from Helm charts and are working fine (CNPG, for example).

So, the Dragonfly grafana dashboard from the helm chart should be fixed.

@Pothulapati
Copy link
Collaborator

@maxpain Sure!

So, probably a way to pass the prometheus data source (including VictoriaMetrics) as a config through the helm chart?

@maxpain
Copy link
Author

maxpain commented Nov 12, 2024

@Pothulapati I don't know how exactly, but all other helm charts with built-in grafana dashboards don't require configuring the Prometheus data source via helm values. They work out of the box.

@maxpain
Copy link
Author

maxpain commented Nov 12, 2024

Here is an example:
https://github.com/cloudnative-pg/grafana-dashboards/blob/main/charts/cluster/grafana-dashboard.json#L4
They use DS_PROMETHEUS variable.

@Pothulapati
Copy link
Collaborator

Looks like DS_Prometheus is a good answer where the user gets the option to select the datasource at the top.

@Pothulapati Pothulapati added the enhancement New feature or request label Dec 11, 2024
@risen228
Copy link

risen228 commented Dec 20, 2024

I also encountered a similar problem - no datasource selection and the entire dashboard is empty with errors. I was able to fix it locally by adding datasource selection similar to cloudnative-pg to templating.list:

- {
-   "hide": 2,
-   "name": "DS_PROMETHEUS",
-   "query": "prometheus",
-   "skipUrlSync": true,
-   "type": "constant"
- },
+ {
+   "current": {
+     "selected": false,
+     "text": "Prometheus",
+     "value": "prometheus"
+   },
+   "hide": 0,
+   "includeAll": false,
+   "label": "Datasource",
+   "multi": false,
+   "name": "DS_PROMETHEUS",
+   "options": [],
+   "query": "prometheus",
+   "queryValue": "",
+   "refresh": 1,
+   "regex": "",
+   "skipUrlSync": false,
+   "type": "datasource"
+ },

Can we try testing this solution? I think the problem is that "prometheus" query is hardcoded and all $DS_PROMETHEUS mentions are interpolated with this string. So, grafana doesn't ever try to use first available datasource with prometheus type. VictoriaMetrics users usually don't name their datasources "prometheus". For example, mine is called "VictoriaMetrics".

@Pothulapati
Copy link
Collaborator

Sure! @risen228 Can you raise a PR?

risen228 added a commit to risen228/dragonfly-operator that referenced this issue Dec 23, 2024
@risen228
Copy link

@Pothulapati done: #279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants