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

[victoriametrics-k8s-stack] Grafana dashboard multicluster mode #529

Closed
jpigree opened this issue May 3, 2023 · 8 comments
Closed

[victoriametrics-k8s-stack] Grafana dashboard multicluster mode #529

jpigree opened this issue May 3, 2023 · 8 comments
Labels
question Further information is requested

Comments

@jpigree
Copy link

jpigree commented May 3, 2023

Hi. I want to create a monitoring stack with VictoriaMetrics to monitor multiple Kubernetes cluster. I used the 'victoria-metrics-k8s-stack' chart (version: 0.14.17) to install a VMCluster on one of my Kubernetes cluster and a Grafana instance.

In order to have multicluster dashboards (dashboards with a cluster parameter to filter metrics), I wrote the following in my values file with no effect:

grafana:
  sidecar:
    dashboards:
      enabled: true
      additionalDashboardLabels: {}
      additionalDashboardAnnotations: {}
      multicluster: true

I grep'ed into the chart and from what I saw, the field is used in a script which is never used in the chart.

$ cd victoria-metrics-k8s-stack
$ grep -R "sidecar.dashboards.multicluster" *
hack/sync_grafana_dashboards.py:                '\{\{ if .Values.grafana.sidecar.dashboards.multicluster \}\}0\{\{ else \}\}2\{\{ end \}\}',
README.md:| grafana.sidecar.dashboards.multicluster | bool | `false` |  |
$ grep -R "sync_grafana_dashboards.py" -l *                                                                                                  
hack/README.md
RELEASE_GUIDE.md

I understand that the script unhide the cluster variable in dashboards so it should be okay for dashboards already having the cluster variable defined and used. However, not all dashboards in the chart are made with a cluster variable to begin with (example here).

In short, my questions are:

  • What is the purpose of this multicluster field?
  • Is there a known way to make the packaged dashboards multicluster?

Thanks for your help

@jpigree
Copy link
Author

jpigree commented May 4, 2023

After a bit of thinking, I think the easiest way to implement this without reworking a lot of dashboards is to send metrics to different tenants and to create one datasource for each. Since, a lot of opensource Kubernetes dashboards have the datasource as a visible variable, we will be able to switch the cluster metrics shown by switching the datasource.

@Haleygo Haleygo added the question Further information is requested label Jul 19, 2023
@bdschaap
Copy link

bdschaap commented Oct 24, 2023

I have a similar use case. Though if I use multiple tenants in victoriametrics then I won't be able to query metrics across tenants due to their isolation. I discovered that I can use Custom query parameters in the data source to still use a single tenant but filter clusters through the use of extra_filters. I set extra_filters[]={cluster="cluster1"} to filter on cluster1 and then create a datasource per cluster.

@dhess
Copy link

dhess commented Jan 24, 2024

I can reproduce this, and it's evident by comparing Helm manifests with multicluster enabled or not that this setting has no effect.

@dhess
Copy link

dhess commented Jan 25, 2024

Oh, nice, @dotdc recently added multi-cluster support to their dashboards, so for the Kubernetes dashboards, at least, it should only take an upstream refresh to resolve this:

dotdc/grafana-dashboards-kubernetes#90

@dotdc
Copy link

dotdc commented Jan 25, 2024

Hi 👋
Yes, it should work now!
If you're interested to add multi-cluster support to other dashboards, we used this solution:

Tested on Prometheus 2.0.0 (2017-11-08), and maybe works on older versions too, so it should be safe for most users 😉

@jpigree
Copy link
Author

jpigree commented Feb 19, 2024

Hi. Thanks for the fix. I will give it a try to confirm this issue is solved.

@AndrewChubatiuk
Copy link
Collaborator

it should be fixed since k8s-stack v0.19.0

@dotdc
Copy link

dotdc commented Aug 20, 2024

If it's the case, maybe we can close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants