Grafana dashboard: IP Geo
Description: IP Geo lookup for Akamai Observability with Hydrolix


{
  "__inputs": [
    {
      "name": "Hydrolix_Cluster",
      "label": "Hydrolix Cluster",
      "description": "",
      "type": "datasource",
      "pluginId": "grafana-clickhouse-datasource",
      "pluginName": "ClickHouse"
    },
    {
      "name": "VAR_TABLE",
      "type": "constant",
      "label": "Table Name",
      "value": "",
      "description": ""
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.5.0-cloud.2.f143d34"
    },
    {
      "type": "datasource",
      "id": "grafana-clickhouse-datasource",
      "name": "ClickHouse",
      "version": "2.2.0"
    },
    {
      "type": "panel",
      "id": "logs",
      "name": "Logs",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "IP Geo lookup for Akamai Observability with Hydrolix",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 18454,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "grafana-clickhouse-datasource",
        "uid": "${Hydrolix_Cluster}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "9.5.0-cloud.2.f143d34",
      "targets": [
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${Hydrolix_Cluster}"
          },
          "format": 1,
          "meta": {
            "builderOptions": {
              "fields": [],
              "limit": 100,
              "mode": "list"
            }
          },
          "queryType": "sql",
          "rawSql": "SELECT \n    ip,\n    akamai_geo('asn', ip) AS asn,\n    akamai_geo('org', ip) AS org,\n    akamai_geo('country', ip) AS country,\n    akamai_geo('subdivision1', ip) AS subdivision1,\n    akamai_geo('state', ip) AS state,\n    akamai_geo('subdivision2', ip) AS subdivision2,\n    akamai_geo('city', ip) AS city\n    FROM \n(\n    SELECT '${cliIP}' AS ip\n) ",
          "refId": "A"
        }
      ],
      "title": "Geo Info",
      "type": "table"
    },
    {
      "datasource": {
        "type": "grafana-clickhouse-datasource",
        "uid": "${Hydrolix_Cluster}"
      },
      "gridPos": {
        "h": 16,
        "w": 24,
        "x": 0,
        "y": 4
      },
      "id": 4,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showTime": false,
        "sortOrder": "Descending",
        "wrapLogMessage": false
      },
      "targets": [
        {
          "datasource": {
            "type": "grafana-clickhouse-datasource",
            "uid": "${Hydrolix_Cluster}"
          },
          "format": 1,
          "meta": {
            "builderOptions": {
              "fields": [],
              "limit": 100,
              "mode": "list"
            }
          },
          "queryType": "sql",
          "rawSql": "SELECT statusCode::String, * EXCEPT statusCode\nFROM ${table}\nWHERE $__timeFilter(reqTimeSec)\nAND $__conditionalAll( statusCode IN (${statusCode}), $statusCode)\nAND $__conditionalAll( reqHost IN (${reqHost}), $reqHost)\nAND $__conditionalAll( UA IN (${UA}), $UA)\nAND $__conditionalAll( cacheStatus IN (${cacheStatus}), $cacheStatus)\nAND $__conditionalAll( reqMethod IN (${reqMethod}), $reqMethod)\nAND $__conditionalAll( rspContentType IN (${rspContentType}), $rspContentType)\nAND $__conditionalAll( errorCode IN (${errorCode}), $errorCode)\nAND $__conditionalAll( transferTimeMSec >= ${transferTimeMSec_percentile}, $edge_response_time_percentile)\nAND if ('${reqPath:text}' = '', true, reqPath LIKE '%${reqPath:text}%')\nAND if ('${cliIP:text}' = '', true, cliIP = '${cliIP:text}')\n\nORDER BY reqTimeSec DESC\nLIMIT 500\nSETTINGS hdx_query_max_execution_time=60, hdx_query_admin_comment='akamai - rawlogs - ${__user.login}'",
          "refId": "A"
        }
      ],
      "title": "Raw Logs",
      "type": "logs"
    }
  ],
  "refresh": "",
  "revision": 1,
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": [
            "All"
          ],
          "value": [
            "$__all"
          ]
        },
        "hide": 0,
        "includeAll": true,
        "label": "HTTP Status Code",
        "multi": true,
        "name": "statusCode",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "200",
            "value": "200"
          },
          {
            "selected": false,
            "text": "201",
            "value": "201"
          },
          {
            "selected": false,
            "text": "202",
            "value": "202"
          },
          {
            "selected": false,
            "text": "204",
            "value": "204"
          },
          {
            "selected": false,
            "text": "205",
            "value": "205"
          },
          {
            "selected": false,
            "text": "206",
            "value": "206"
          },
          {
            "selected": false,
            "text": "301",
            "value": "301"
          },
          {
            "selected": false,
            "text": "302",
            "value": "302"
          },
          {
            "selected": false,
            "text": "304",
            "value": "304"
          },
          {
            "selected": false,
            "text": "307",
            "value": "307"
          },
          {
            "selected": false,
            "text": "308",
            "value": "308"
          },
          {
            "selected": false,
            "text": "400",
            "value": "400"
          },
          {
            "selected": false,
            "text": "401",
            "value": "401"
          },
          {
            "selected": false,
            "text": "403",
            "value": "403"
          },
          {
            "selected": false,
            "text": "404",
            "value": "404"
          },
          {
            "selected": false,
            "text": "405",
            "value": "405"
          },
          {
            "selected": false,
            "text": "406",
            "value": "406"
          },
          {
            "selected": false,
            "text": "408",
            "value": "408"
          },
          {
            "selected": false,
            "text": "409",
            "value": "409"
          },
          {
            "selected": false,
            "text": "410",
            "value": "410"
          },
          {
            "selected": false,
            "text": "411",
            "value": "411"
          },
          {
            "selected": false,
            "text": "412",
            "value": "412"
          },
          {
            "selected": false,
            "text": "413",
            "value": "413"
          },
          {
            "selected": false,
            "text": "414",
            "value": "414"
          },
          {
            "selected": false,
            "text": "415",
            "value": "415"
          },
          {
            "selected": false,
            "text": "416",
            "value": "416"
          },
          {
            "selected": false,
            "text": "417",
            "value": "417"
          },
          {
            "selected": false,
            "text": "421",
            "value": "421"
          },
          {
            "selected": false,
            "text": "425",
            "value": "425"
          },
          {
            "selected": false,
            "text": "428",
            "value": "428"
          },
          {
            "selected": false,
            "text": "429",
            "value": "429"
          },
          {
            "selected": false,
            "text": "431",
            "value": "431"
          },
          {
            "selected": false,
            "text": "451",
            "value": "451"
          },
          {
            "selected": false,
            "text": "500",
            "value": "500"
          },
          {
            "selected": false,
            "text": "501",
            "value": "501"
          },
          {
            "selected": false,
            "text": "502",
            "value": "502"
          },
          {
            "selected": false,
            "text": "503",
            "value": "503"
          },
          {
            "selected": false,
            "text": "504",
            "value": "504"
          },
          {
            "selected": false,
            "text": "505",
            "value": "505"
          },
          {
            "selected": false,
            "text": "506",
            "value": "506"
          },
          {
            "selected": false,
            "text": "511",
            "value": "511"
          }
        ],
        "query": "200,201,202,204,205,206,301,302,304,307,308,400,401,403,404,405,406,408,409,410,411,412,413,414,415,416,417,421,425,428,429,431,451,500,501,502,503,504,505,506,511",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "hide": 0,
        "includeAll": true,
        "label": "Cache Status",
        "multi": false,
        "name": "cacheStatus",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "true",
            "value": "1"
          },
          {
            "selected": false,
            "text": "false",
            "value": "0"
          }
        ],
        "query": "true : 1, false : 0",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${Hydrolix_Cluster}"
        },
        "definition": "SELECT reqHost FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY reqHost ORDER BY COUNT() DESC LIMIT 50",
        "hide": 0,
        "includeAll": true,
        "label": "Hostname",
        "multi": true,
        "name": "reqHost",
        "options": [],
        "query": "SELECT reqHost FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY reqHost ORDER BY COUNT() DESC LIMIT 50",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${Hydrolix_Cluster}"
        },
        "definition": "SELECT reqMethod FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY reqMethod ORDER BY COUNT() DESC LIMIT 50",
        "hide": 0,
        "includeAll": true,
        "label": "Method",
        "multi": true,
        "name": "reqMethod",
        "options": [],
        "query": "SELECT reqMethod FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY reqMethod ORDER BY COUNT() DESC LIMIT 50",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${Hydrolix_Cluster}"
        },
        "definition": "SELECT UA FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY UA ORDER BY COUNT() DESC LIMIT 50",
        "hide": 0,
        "includeAll": true,
        "label": "User Agent",
        "multi": true,
        "name": "UA",
        "options": [],
        "query": "SELECT UA FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY UA ORDER BY COUNT() DESC LIMIT 50",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${Hydrolix_Cluster}"
        },
        "definition": "SELECT rspContentType FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY rspContentType ORDER BY COUNT() DESC LIMIT 50",
        "hide": 0,
        "includeAll": true,
        "label": "Content Type",
        "multi": true,
        "name": "rspContentType",
        "options": [],
        "query": "SELECT rspContentType FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY rspContentType ORDER BY COUNT() DESC LIMIT 50",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${Hydrolix_Cluster}"
        },
        "definition": "SELECT errorCode FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY errorCode ORDER BY COUNT() DESC LIMIT 50",
        "hide": 0,
        "includeAll": true,
        "label": "Error Code",
        "multi": true,
        "name": "errorCode",
        "options": [],
        "query": "SELECT errorCode FROM $table WHERE $__timeFilter(reqTimeSec) GROUP BY errorCode ORDER BY COUNT() DESC LIMIT 50",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "hide": 0,
        "includeAll": true,
        "label": "Edge Response Time Percentile",
        "multi": false,
        "name": "edge_response_time_percentile",
        "options": [
          {
            "selected": true,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": false,
            "text": "0.5",
            "value": "0.5"
          },
          {
            "selected": false,
            "text": "0.75",
            "value": "0.75"
          },
          {
            "selected": false,
            "text": "0.90",
            "value": "0.90"
          },
          {
            "selected": false,
            "text": "0.95",
            "value": "0.95"
          },
          {
            "selected": false,
            "text": "0.99",
            "value": "0.99"
          }
        ],
        "query": "0.5 , 0.75 , 0.90 , 0.95, 0.99",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "",
          "value": ""
        },
        "hide": 0,
        "label": "Path",
        "name": "reqPath",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "hide": 0,
        "label": "Client IP",
        "name": "cliIP",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {},
        "datasource": {
          "type": "grafana-clickhouse-datasource",
          "uid": "${Hydrolix_Cluster}"
        },
        "definition": "$__conditionalAll(SELECT quantile(${edge_response_time_percentile})(transferTimeMSec) FROM $table WHERE $__timeFilter(reqTimeSec),$edge_response_time_percentile)",
        "hide": 2,
        "includeAll": false,
        "multi": false,
        "name": "transferTimeMSec_percentile",
        "options": [],
        "query": "$__conditionalAll(SELECT quantile(${edge_response_time_percentile})(transferTimeMSec) FROM $table WHERE $__timeFilter(reqTimeSec),$edge_response_time_percentile)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "description": "Specify the table name",
        "hide": 2,
        "label": "Table Name",
        "name": "table",
        "query": "${VAR_TABLE}",
        "skipUrlSync": false,
        "type": "constant",
        "current": {
          "value": "${VAR_TABLE}",
          "text": "${VAR_TABLE}",
          "selected": false
        },
        "options": [
          {
            "value": "${VAR_TABLE}",
            "text": "${VAR_TABLE}",
            "selected": false
          }
        ]
      }
    ]
  },
  "time": {
    "from": "now-3h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "IP Geo",
  "uid": "Bz4pM4a4z",
  "version": 4,
  "weekStart": ""
}