vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.59k stars 1.39k forks source link

Where in Git can I find the Grafana dashboard json URL so it can be used with dashboardProviders #8053

Open darnone opened 1 month ago

darnone commented 1 month ago

What steps did you take and what happened: This is not really an issue - more like a question. Trying to import dashboard 16829 using grafana dashboardProvider but I don't have a url path to the dashboard json. I that available?

What did you expect to happen: Just looking for the dashboard json path. Something like

                          https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes
blackpiglet commented 1 month ago

Is this the link you are looking for? https://grafana.com/grafana/dashboards/16829-kubernetes-tanzu-velero/

darnone commented 1 month ago

The link I am looking for would end in .json

kaovilai commented 1 month ago

If you open this in the browser it would download a .json https://grafana.com/api/dashboards/16829/revisions/latest/download

darnone commented 1 month ago

I am aware of how to download the json. Perhaps I am asking the wrong question When we deploy the kube-prometheus-stack, grafana is configured to install the Kubernetes dashboards automatically. It looks like the following. At the bottom, you can see how I am pulling in the dashboards straight from Git. I suppose I could pull a local file, however,

1.) I am new to this 2.) the kube-prometheus-stack is deployed by terraform helm release and we do use any external files

So if the dashboard cannot be pulled this way, I am looking for ideas of how to do this, working around the manual step of installing a json, in the interest of automation.

dashboardProviders:
    dashboardproviders.yaml:
      apiVersion: 1
      providers:
        - name: "grafana-dashboards-kubernetes"
          orgId: 1
          folder: "Kubernetes"
          type: file
          disableDeletion: true
          editable: true
          options:
            path: /var/lib/grafana/dashboards/grafana-dashboards-kubernetes
        - name: "grafana-dashboards-cloudbees"
          orgId: 1
          folder: "CloudBees"
          type: file
          disableDeletion: false
          editable: true
          options:
            path: /var/lib/grafana/dashboards/grafana-dashboards-cloudbees
  dashboards:
    grafana-dashboards-kubernetes:
      k8s-views-global:
        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json
        token: ""
      k8s-views-namespaces:
        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json
        token: ""
      k8s-views-nodes:
        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json
        token: ""
      k8s-views-pods:
        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json
        token: ""
    grafana-dashboards-cloudbees:
      cb-controllers:
        url: https://raw.githubusercontent.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/main/blueprints/02-at-scale/k8s/kube-prom-stack-grafana-db.json
        token: ""
kaovilai commented 1 month ago

Can you not replace json url with this /download link?

Here's curl result, without even needing to use -L to follow redirects.

curl https://grafana.com/api/dashboards/16829/revisions/latest/download
{
  "annotations": {
    "list": [
  ...
kaovilai commented 1 month ago

Here's an example following your syntax I found on github. I assume it should work for you too. https://github.com/mhumeSF/nix-media/blob/ec4cfe7053926e80617290705034e61551e892f0/cluster/apps/monitoring/grafana/app/helmrelease.yaml#L191

kaovilai commented 1 month ago

The link need not end in .json