grafana/dashboard-linter

Dashboard variable with type prometheus without $dashboard is not flagged by linter

alex-vinnik-sp opened this issue · 0 comments

Dashboard variable like below is not flagged by linter. You can see that UID is assigned specific value pjNv0fYGz. Such dashboard is not portable across different grafana environments. It would be nice for a linter to flag such case.

      {¬
        "current": {¬
          "selected": false,¬
          "text": "X",¬
          "value": "X"¬
        },¬
        "datasource": {¬
          "type": "prometheus",¬
          "uid": "pjNv0fYGz"¬
        },¬
        "definition": "definition",¬
        "hide": 0,¬
        "includeAll": false,¬
        "label": "Customer ID",¬
        "multi": false,¬
        "name": "customerid",¬
        "options": [],¬
        "query": {¬
          "query": "PromQL",¬
          "refId": "StandardVariableQuery"¬
        },¬
        "refresh": 2,¬
        "regex": "",¬
        "skipUrlSync": false,¬
        "sort": 0,¬
        "type": "query"¬
      }