Grafana dashboard: Zammad: Chats
Description: Sample Dashboard for displaying Chat Statistics of your Zammad instance. Features chat origins, topic ratios and other Metas.

You can find a full setup how to on our documentation: [Zammad documentation](https://docs.zammad.org/en/latest/appendix/reporting-tools-thirdparty/grafana.html).

All our sample dashboards are stored in this GitHub repository:
[https://github.com/zammad/grafana-dashboards](https://github.com/zammad/grafana-dashboards)

If you have trouble with Zammad or your particular Zammad related dashboards, please consult the [Zammad community](https://community.zammad.org) - we're not monitoring other places.

---

Wanna fiddle on your own? You may find our documentation page for [Elasticsearch index attributes](https://docs.zammad.org/en/latest/install/elasticsearch/indexed-attributes.html) useful!

{
  "__inputs": [
    {
      "name": "DS_ES_- CHAT SESSIONS",
      "label": "ES - Chat Sessions",
      "description": "Ticket indice with timefield \"created_at\"",
      "type": "datasource",
      "pluginId": "elasticsearch",
      "pluginName": "Elasticsearch"
    }
  ],
  "__requires": [
    {
      "type": "datasource",
      "id": "elasticsearch",
      "name": "Elasticsearch",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.5.1"
    },
    {
      "type": "panel",
      "id": "grafana-worldmap-panel",
      "name": "Worldmap Panel",
      "version": "0.3.2"
    },
    {
      "type": "panel",
      "id": "piechart",
      "name": "Pie chart v2",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 14224,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1618395099607,
  "links": [],
  "panels": [
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 25,
            "gradientMode": "opacity",
            "hideFrom": {
              "graph": false,
              "legend": false,
              "tooltip": false
            },
            "lineInterpolation": "smooth",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "interval": "${interval_graphs}",
      "options": {
        "graph": {},
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltipOptions": {
          "mode": "single"
        }
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "created_at",
              "id": "2",
              "settings": {
                "interval": "auto"
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "title": "Chat Sessions per day",
      "type": "timeseries"
    },
    {
      "circleMaxSize": "30",
      "circleMinSize": 2,
      "colors": [
        "#73BF69",
        "rgba(237, 129, 40, 0.89)",
        "#F2495C"
      ],
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "decimals": 0,
      "esMetric": "Count",
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "hideEmpty": true,
      "hideZero": true,
      "id": 9,
      "initialZoom": "1.7",
      "locationData": "countries",
      "mapCenter": "Europe",
      "mapCenterLatitude": 46,
      "mapCenterLongitude": 14,
      "maxDataPoints": 1,
      "mouseWheelZoom": true,
      "pluginVersion": "7.5.1",
      "showLegend": true,
      "stickyLabels": false,
      "tableQueryOptions": {
        "geohashField": "geohash",
        "labelField": "country",
        "latitudeField": "latitude",
        "longitudeField": "longitude",
        "metricField": "metric",
        "queryType": "coordinates"
      },
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "preferences.geo_ip.country_code.keyword",
              "id": "2",
              "settings": {
                "min_doc_count": "0",
                "order": "desc",
                "orderBy": "_term",
                "size": "10"
              },
              "type": "terms"
            },
            {
              "field": "created_at",
              "id": "1",
              "settings": {
                "interval": "auto"
              },
              "type": "date_histogram"
            }
          ],
          "hide": false,
          "metrics": [
            {
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "thresholds": "10,30",
      "title": "Chatting countries (origin)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "pattern": ""
            }
          }
        }
      ],
      "type": "grafana-worldmap-panel",
      "unitPlural": "",
      "unitSingle": "",
      "valueName": "total"
    },
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "tags.keyword"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Tag"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Count"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "basic"
              },
              {
                "id": "displayName",
                "value": "Chat-Sessions"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 4,
        "x": 0,
        "y": 10
      },
      "id": 6,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "tags.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "1",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "hide": false,
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "title": "Top 10 Chat tags",
      "type": "table"
    },
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "user.login.keyword"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Login"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Count"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "basic"
              },
              {
                "id": "displayName",
                "value": "Chat-Sessions"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 4,
        "x": 4,
        "y": 10
      },
      "id": 10,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "user.login.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "1",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "hide": false,
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "title": "Top 10 Chat agents",
      "type": "table"
    },
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "description": "This is the last page the chat was used on. If the user browses the website, the URL may change.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "preferences.url.keyword"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "URL"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Count"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "basic"
              },
              {
                "id": "displayName",
                "value": "Chat-Sessions"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 4,
        "x": 8,
        "y": 10
      },
      "id": 5,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "preferences.url.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "1",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "hide": false,
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "title": "Top 10 Chat exit pages",
      "type": "table"
    },
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "preferences.geo_ip.city_name.keyword"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "City"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Count"
            },
            "properties": [
              {
                "id": "custom.displayMode",
                "value": "basic"
              },
              {
                "id": "displayName",
                "value": "Chat-Sessions"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 4,
        "x": 12,
        "y": 10
      },
      "id": 15,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "preferences.geo_ip.city_name.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "1",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "hide": false,
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "title": "Top 10 City origins",
      "type": "table"
    },
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 1,
          "mappings": [],
          "max": 55,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 20
              },
              {
                "color": "#EF843C",
                "value": 30
              },
              {
                "color": "red",
                "value": 50
              }
            ]
          },
          "unit": "Messages"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 4,
        "x": 16,
        "y": 10
      },
      "id": 14,
      "interval": null,
      "options": {
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "/^Unique Count$/",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true,
        "text": {}
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "created_at",
              "id": "4",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "field": "messages.id",
              "id": "1",
              "type": "cardinality"
            }
          ],
          "query": "state: \"closed\"",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Average number of messages",
      "transformations": [],
      "type": "gauge"
    },
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 12,
        "w": 4,
        "x": 20,
        "y": 10
      },
      "id": 13,
      "options": {
        "displayLabels": [
          "name",
          "percent"
        ],
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "values": []
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {}
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "chat.name.keyword",
              "id": "3",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "1",
                "size": "15"
              },
              "type": "terms"
            },
            {
              "field": "created_at",
              "id": "4",
              "settings": {
                "interval": "auto",
                "min_doc_count": "1",
                "trimEdges": "0"
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "hide": false,
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "title": "Chat topic ratio",
      "type": "piechart"
    },
    {
      "datasource": "${DS_ES_- CHAT SESSIONS}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "max": 950000,
          "min": 200000,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 300000
              },
              {
                "color": "#EF843C",
                "value": 600000
              },
              {
                "color": "red",
                "value": 900000
              }
            ]
          },
          "unit": "dtdurationms"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 4,
        "x": 16,
        "y": 16
      },
      "id": 12,
      "interval": null,
      "options": {
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "/^Duration$/",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true,
        "text": {}
      },
      "pluginVersion": "7.5.1",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "id",
              "id": "3",
              "settings": {
                "min_doc_count": "1",
                "missing": "0",
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "updated_at",
              "id": "4",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            }
          ],
          "hide": false,
          "metrics": [
            {
              "hide": true,
              "id": "1",
              "type": "count"
            }
          ],
          "query": "state: \"closed\"",
          "refId": "B",
          "timeField": "created_at"
        },
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "id",
              "id": "3",
              "settings": {
                "min_doc_count": "1",
                "missing": "0",
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "field": "created_at",
              "id": "4",
              "settings": {
                "min_doc_count": "1",
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "hide": true,
              "id": "1",
              "type": "count"
            }
          ],
          "query": "state: \"closed\"",
          "queryType": "randomWalk",
          "refId": "A",
          "timeField": "created_at"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Average chatting time",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Count": false,
              "id": false
            },
            "indexByName": {
              "Count": 3,
              "created_at": 0,
              "id": 2,
              "updated_at": 1
            },
            "renameByName": {}
          }
        },
        {
          "id": "calculateField",
          "options": {
            "alias": "Duration",
            "mode": "reduceRow",
            "reduce": {
              "include": [
                "updated_at",
                "created_at"
              ],
              "reducer": "diff"
            },
            "replaceFields": true
          }
        }
      ],
      "type": "gauge"
    }
  ],
  "refresh": false,
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "auto": false,
        "auto_count": 30,
        "auto_min": "10s",
        "current": {
          "selected": false,
          "text": "1d",
          "value": "1d"
        },
        "description": "Allows you to set the minimum data point size. The bigger the less details you'll have.",
        "error": null,
        "hide": 0,
        "label": "Graph Intervall",
        "name": "interval_graphs",
        "options": [
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": true,
            "text": "1d",
            "value": "1d"
          },
          {
            "selected": false,
            "text": "2d",
            "value": "2d"
          },
          {
            "selected": false,
            "text": "7d",
            "value": "7d"
          },
          {
            "selected": false,
            "text": "30d",
            "value": "30d"
          }
        ],
        "query": "1h,1d,2d,7d,30d",
        "queryValue": "",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      }
    ]
  },
  "time": {
    "from": "now-90d",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Zammad: Chats",
  "uid": "fZ6YLr_Gk",
  "version": 17,
  "description": "Sample Dashboard for displaying Chat Statistics of your Zammad instance. Features chat origins, topic ratios and other Metas."
}