Dashboard links only works after site reload

  • What Grafana version and what operating system are you using?
    v8.1.5 OSS

  • What are you trying to achieve?
    I want to use link urls in my dashboards, which links to different dashboards. Fore example, I’ve got a dashboardds, which shows the resource usage of the entire kubernetes cluster. In this dashboard there is a panel which lists all the namespaces. Clicking on one of these namespaces should redirect you to a dashboard which shows the details of the selected namespace.

  • How are you trying to achieve it?
    Redirections using linkUrl:

"linkUrl": "./d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods?orgId=1&refresh=10s&var-datasource=$datasource&var-cluster=$cluster&var-namespace=$__cell",
  • What happened?
    For example, when clicking on namespace “default” it redirects me to the following path:
/d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods?orgId=1&refresh=10s&var-datasource=default&var-namespace=default

But it shows a 404 Page not found error. When hitting F5 or refreshing the page the expected dashboard is shown.

  • What did you expect to happen?
    The dashboard should be shown without needing to refresh the page.

  • Can you copy/paste the configuration(s) that you are having problems with?
    Here’s the entire panel json:

{
  "id": 8,
  "gridPos": {
    "x": 0,
    "y": 13,
    "w": 24,
    "h": 7
  },
  "type": "table-old",
  "title": "CPU Quota",
  "datasource": "$datasource",
  "thresholds": [],
  "links": [],
  "legend": {
    "avg": false,
    "current": false,
    "max": false,
    "min": false,
    "show": true,
    "total": false,
    "values": false
  },
  "aliasColors": {},
  "dashLength": 10,
  "fill": 1,
  "lines": true,
  "linewidth": 1,
  "nullPointMode": "null as zero",
  "pointradius": 5,
  "renderer": "flot",
  "seriesOverrides": [],
  "spaceLength": 10,
  "styles": [
    {
      "alias": "Time",
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "pattern": "Time",
      "type": "hidden",
      "align": "auto"
    },
    {
      "alias": "Pods",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 0,
      "link": true,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down to pods",
      "linkUrl": "./d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods?orgId=1&refresh=10s&orgId=1&refresh=10s&var-datasource=$datasource&var-cluster=$cluster&var-namespace=$__cell_1",
      "pattern": "Value #A",
      "thresholds": [],
      "type": "number",
      "unit": "short",
      "align": "auto"
    },
    {
      "alias": "Workloads",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 0,
      "link": true,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down to workloads",
      "linkUrl": "./d/a87fb0d919ec0ea5f6543124e16c42a5/k8s-resources-workloads-namespace?var-datasource=$datasource&var-cluster=$cluster&var-namespace=$__cell_1",
      "pattern": "Value #B",
      "thresholds": [],
      "type": "number",
      "unit": "short",
      "align": "auto"
    },
    {
      "alias": "CPU Usage",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "link": false,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down",
      "linkUrl": "",
      "pattern": "Value #C",
      "thresholds": [],
      "type": "number",
      "unit": "short",
      "align": "auto"
    },
    {
      "alias": "CPU Requests",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "link": false,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down",
      "linkUrl": "",
      "pattern": "Value #D",
      "thresholds": [],
      "type": "number",
      "unit": "short",
      "align": "auto"
    },
    {
      "alias": "CPU Requests %",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "link": false,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down",
      "linkUrl": "",
      "pattern": "Value #E",
      "thresholds": [],
      "type": "number",
      "unit": "percentunit",
      "align": "auto"
    },
    {
      "alias": "CPU Limits",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "link": false,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down",
      "linkUrl": "",
      "pattern": "Value #F",
      "thresholds": [],
      "type": "number",
      "unit": "short",
      "align": "auto"
    },
    {
      "alias": "CPU Limits %",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "link": false,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down",
      "linkUrl": "",
      "pattern": "Value #G",
      "thresholds": [],
      "type": "number",
      "unit": "percentunit",
      "align": "auto"
    },
    {
      "alias": "Namespace",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "link": true,
      "linkTargetBlank": false,
      "linkTooltip": "Drill down to pods",
      "linkUrl": "./d/85a562078cdf77779eaa1add43ccec1e/kubernetes-compute-resources-namespace-pods?orgId=1&refresh=10s&var-datasource=$datasource&var-namespace=$__cell",
      "pattern": "namespace",
      "thresholds": [],
      "type": "number",
      "unit": "short",
      "align": "auto"
    },
    {
      "alias": "",
      "colorMode": null,
      "colors": [],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "pattern": "/.*/",
      "thresholds": [],
      "type": "string",
      "unit": "short",
      "align": "auto"
    }
  ],
  "targets": [
    {
      "expr": "sum(kube_pod_owner) by (namespace)",
      "format": "table",
      "instant": true,
      "intervalFactor": 2,
      "legendFormat": "",
      "refId": "A",
      "step": 10
    },
    {
      "expr": "count(avg(namespace_workload_pod:kube_pod_owner:relabel) by (workload, namespace)) by (namespace)",
      "format": "table",
      "instant": true,
      "intervalFactor": 2,
      "legendFormat": "",
      "refId": "B",
      "step": 10
    },
    {
      "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate) by (namespace)",
      "format": "table",
      "instant": true,
      "intervalFactor": 2,
      "legendFormat": "",
      "refId": "C",
      "step": 10
    },
    {
      "expr": "sum(kube_pod_container_resource_requests{resource=\"cpu\",unit=\"core\"}) by (namespace)",
      "format": "table",
      "instant": true,
      "intervalFactor": 2,
      "legendFormat": "",
      "refId": "D",
      "step": 10
    },
    {
      "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate) by (namespace) / sum(kube_pod_container_resource_requests{resource=\"cpu\",unit=\"core\"}) by (namespace)",
      "format": "table",
      "instant": true,
      "intervalFactor": 2,
      "legendFormat": "",
      "refId": "E",
      "step": 10
    },
    {
      "expr": "sum(kube_pod_container_resource_limits{resource=\"cpu\",unit=\"core\"}) by (namespace)",
      "format": "table",
      "instant": true,
      "intervalFactor": 2,
      "legendFormat": "",
      "refId": "F",
      "step": 10
    },
    {
      "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate) by (namespace) / sum(kube_pod_container_resource_limits{resource=\"cpu\",unit=\"core\"}) by (namespace)",
      "format": "table",
      "instant": true,
      "intervalFactor": 2,
      "legendFormat": "",
      "refId": "G",
      "step": 10
    }
  ],
  "tooltip": {
    "shared": false,
    "sort": 0,
    "value_type": "individual"
  },
  "transform": "table",
  "xaxis": {
    "buckets": null,
    "mode": "time",
    "name": null,
    "show": true,
    "values": []
  },
  "yaxes": [
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": 0,
      "show": true
    },
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": null,
      "show": false
    }
  ],
  "showHeader": true,
  "columns": [],
  "fontSize": "100%",
  "sort": {
    "col": 0,
    "desc": true
  },
  "bars": false,
  "dashes": false,
  "percentage": false,
  "points": false,
  "stack": false,
  "steppedLine": false,
  "timeFrom": null,
  "timeShift": null,
  "pageSize": null
}
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Grafana is showing it’s 404 page.
    In chrome’s console it shows following errors:
runRequest.ts:149 runRequest.catchError {type: "cancelled", cancelled: true, data: null, status: -1, statusText: "Request was aborted", …}
hostReportError.js:3 Uncaught e {message: "no elements in sequence", name: "EmptyError"}
2 Likes

I have the same situation with Grafana 8.1.6. When i right click on it and open the link in a new tab it’s works so I don’t understand what’s happening

I‘ve fixed it!
I only had to remove the leading dot:

./d/….
/d/…..

This worked for me

This topic was automatically closed after 365 days. New replies are no longer allowed.