How to show annotations in a table panel in Grafana 7

I don’t know how to show annotations in a table panel in Grafana 7.x
Can somebody help me with complete screenshots for the settings?
I want to show the annotations from datasource – Grafana –

1 Like

I’ve found a temporary solution for me:

Annotation JSON from Grafana 6.x

{
  "datasource": "-- Grafana --",
  "columns": [],
  "fontSize": "100%",
  "gridPos": {
    "h": 8,
    "w": 12,
    "x": 0,
    "y": 0
  },
  "id": 285,
  "pageSize": null,
  "showHeader": true,
  "sort": {
    "col": 0,
    "desc": true
  },
  "styles": [
    {
      "alias": "Time",
      "align": "auto",
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "pattern": "Time",
      "type": "date"
    },
    {
      "alias": "",
      "align": "right",
      "colorMode": null,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "decimals": 2,
      "mappingType": 1,
      "pattern": "Text",
      "thresholds": [],
      "type": "string",
      "unit": "short"
    },
    {
      "alias": "",
      "align": "auto",
      "colorMode": null,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "mappingType": 1,
      "pattern": "Title",
      "thresholds": [],
      "type": "string",
      "unit": "short"
    },
    {
      "alias": "",
      "align": "auto",
      "colorMode": null,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "mappingType": 1,
      "pattern": "Tags",
      "thresholds": [],
      "type": "string",
      "unit": "short"
    }
  ],
  "timeFrom": null,
  "timeShift": null,
  "title": "Panel Title",
  "transform": "annotations",
  "type": "table"
}
  1. Create a new Panel and format it as table. IMPORTANT
  2. copy new panel ID like 23763571993
  3. Edit old Panel JSON from Version 6.x and paste JSON as JSON for the new Panel (overwrite it):
  4. change old id to the new panel id
    “id”: 285, to “id”: “id”: 23763571993,
  5. Change old type table to new type table-old
    “type”: “table” to “type”: “table-old”
  6. APPLY this JSON
  7. Save dasboard
  8. Reload dashboard

This is the JSON for Grafana 7.x after applying the changes for id and type.

{
  "datasource": "-- Grafana --",
  "columns": [],
  "fontSize": "100%",
  "gridPos": {
    "h": 8,
    "w": 12,
    "x": 0,
    "y": 0
  },
  "id": 23763571993,
  "pageSize": null,
  "showHeader": true,
  "sort": {
    "col": 0,
    "desc": true
  },
  "styles": [
    {
      "alias": "Time",
      "align": "auto",
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "pattern": "Time",
      "type": "date"
    },
    {
      "alias": "",
      "align": "right",
      "colorMode": null,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "decimals": 2,
      "mappingType": 1,
      "pattern": "Text",
      "thresholds": [],
      "type": "string",
      "unit": "short"
    },
    {
      "alias": "",
      "align": "auto",
      "colorMode": null,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "mappingType": 1,
      "pattern": "Title",
      "thresholds": [],
      "type": "string",
      "unit": "short"
    },
    {
      "alias": "",
      "align": "auto",
      "colorMode": null,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "dateFormat": "YYYY-MM-DD HH:mm:ss",
      "decimals": 2,
      "mappingType": 1,
      "pattern": "Tags",
      "thresholds": [],
      "type": "string",
      "unit": "short"
    }
  ],
  "timeFrom": null,
  "timeShift": null,
  "title": "Panel Title",
  "transform": "annotations",
  "type": "table-old"
}

The important lines are:

  "id": 23763571993,
  "transform": "annotations",
  "type": "table-old"

You have to define annotation queries like “aq” and “mhy” in the dashboard options to see you annotations in the table via the annotation tags you’ve given them during creation.

Resulting annotation table

Thanks!
I was able to get this to work for me too.
I hope this gets resolved in the next upgrade!

not supported yet in the new panel. Working on, should be supported again in the next 5 months