Grafana dashboard: Grafana Dashboard for Cloudflare Analytics and Overview
Description: Grafana Dashboard for Cloudflare - Pulls out all the Cloudflare Information, and Analytics from the GraphQL API.


{
  "__inputs": [
    {
      "name": "DS_INFLUXDB",
      "label": "InfluxDB",
      "description": "#!/bin/bash ##      .SYNOPSIS ##      Grafana Dashboard for Cloudflare - Using RestAPI to InfluxDB Script ##  ##      .DESCRIPTION ##      This Script will query Cloudflare GraphQL and send the data directly to InfluxDB, which can be used to present it to Grafana.  ##      The Script and the Grafana Dashboard it is provided as it is, and bear in mind you can not open support Tickets regarding this project. It is a Community Project ## ##      .Notes ##      NAME:  cloudflare-analytics.sh ##      LASTEDIT: 19/03/2021 ##      VERSION: 2.0 ##      KEYWORDS: Cloudflare, InfluxDB, Grafana     ##      .Link ##      https://jorgedelacruz.es/ ##      https://jorgedelacruz.uk/  ## # Configurations ## # Endpoint URL for InfluxDB InfluxDBURL=\"YOURINFLUXSERVERIP\" #Your InfluxDB Server, http://FQDN or https://FQDN if using SSL InfluxDBPort=\"8086\" #Default Port InfluxDB=\"telegraf\" #Default Database InfluxDBUser=\"USER\" #User for Database InfluxDBPassword=\"PASSWORD\" #Password for Database  # Endpoint URL for login action cloudflareapikey=\"YOURAPIKEY\" cloudflarezone=\"YOURZONEID\" cloudflareemail=\"YOUREMAIL\"  # Time variables back_seconds=60*60*24*7  # 24 hours end_epoch=$(date +'%s') let start_epoch=$end_epoch-$back_seconds start_date=$(date --date=\"@$start_epoch\" +'%Y-%m-%d') end_date=$(date --date=\"@$end_epoch\" +'%Y-%m-%d')  # Payload to query to the new GraphQL (You can always add more variables, or remove the ones you do not need) PAYLOAD='{ \"query\":   \"query {   viewer {     zones(filter: {zoneTag: $zoneTag}) {       httpRequests1dGroups(limit:7, filter: $filter,)   {         dimensions {           date         }         sum {           browserMap {             pageViews             uaBrowserFamily           }           bytes           cachedBytes           cachedRequests           contentTypeMap {             bytes             requests             edgeResponseContentTypeName           }           countryMap {             bytes             requests             threats             clientCountryName           }           encryptedBytes           encryptedRequests           ipClassMap {             requests             ipType           }           pageViews           requests           responseStatusMap {             requests             edgeResponseStatus           }           threats           threatPathingMap {             requests             threatPathingName           }         }         uniq {           uniques         }       }     }   } }\",' PAYLOAD=\"$PAYLOAD    \\\"variables\\\": {     \\\"zoneTag\\\": \\\"$cloudflarezone\\\",     \\\"filter\\\": {       \\\"date_geq\\\": \\\"$start_date\\\",       \\\"date_leq\\\": \\\"$end_date\\\"     }   } }\"  ## # Cloudflare Analytics. This part will check on your Cloudflare Analytics, extracting the data from the last 24 hours ## cloudflareUrl=$(curl -s -X POST -H \"Content-Type: application/json\" -H \"X-Auth-Email: $cloudflareemail\" -H  \"X-Auth-Key: $cloudflareapikey\" --data \"$(echo $PAYLOAD)\" https://api.cloudflare.com/client/v4/graphql/ 2>&1 -k --silent)      declare -i arraydays=0     for requests in $(echo \"$cloudflareUrl\" | jq -r '.data.viewer.zones[0].httpRequests1dGroups[].sum.requests'); do         ## Requests         cfRequestsAll=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.requests\")         if [[ $cfRequestsAll = \"null\" ]]; then             break         else         cfRequestsCached=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.cachedRequests\")         cfRequestsUncached=$(echo \"$cfRequestsAll - $cfRequestsCached\" | bc)                  ## Bandwidth         cfBandwidthAll=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.bytes\")         cfBandwidthCached=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.cachedBytes\")         cfBandwidthUncached=$(echo \"$cfBandwidthAll - $cfBandwidthCached\" | bc)          ## Threats         cfThreatsAll=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.threats\")          ## Pageviews         cfPageviewsAll=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.pageViews\")          ## Unique visits         cfUniquesAll=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].uniq.uniques\")          ## Timestamp         date=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].dimensions.date\")         cfTimeStamp=`date -d \"${date}\" '+%s'`           #echo \"cloudflare_analytics,cfZone=$cloudflarezone cfRequestsAll=$cfRequestsAll,cfRequestsCached=$cfRequestsCached,cfRequestsUncached=$cfRequestsUncached,cfBandwidthAll=$cfBandwidthAll,cfBandwidthCached=$cfBandwidthCached,cfBandwidthUncached=$cfBandwidthUncached,cfThreatsAll=$cfThreatsAll,cfPageviewsAll=$cfPageviewsAll,cfUniquesAll=$cfUniquesAll $cfTimeStamp\"          echo \"Writing Zone data to InfluxDB cloudflare_analytics\"         curl -i -XPOST \"$InfluxDBURL:$InfluxDBPort/write?precision=s&db=$InfluxDB\" -u \"$InfluxDBUser:$InfluxDBPassword\" --data-binary \"cloudflare_analytics,cfZone=$cloudflarezone cfRequestsAll=$cfRequestsAll,cfRequestsCached=$cfRequestsCached,cfRequestsUncached=$cfRequestsUncached,cfBandwidthAll=$cfBandwidthAll,cfBandwidthCached=$cfBandwidthCached,cfBandwidthUncached=$cfBandwidthUncached,cfThreatsAll=$cfThreatsAll,cfPageviewsAll=$cfPageviewsAll,cfUniquesAll=$cfUniquesAll $cfTimeStamp\"          ## Requests per Country         declare -i arraycountry=0         for requests in $(echo \"$cloudflareUrl\" | jq -r '.data.viewer.zones[0].httpRequests1dGroups[].sum.countryMap[]'); do             cfRequestsCC=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.countryMap[$arraycountry].clientCountryName\")             if [[ $cfRequestsCC = \"null\" ]]; then                 break             else             cfRequests=$(echo \"$cloudflareUrl\" | jq --raw-output \".data.viewer.zones[0].httpRequests1dGroups[$arraydays].sum.countryMap[$arraycountry].requests // \"0\"\")              echo \"Writing stats for day $date\"             #echo \"cloudflare_analytics_country,country=$cfRequestsCC visits=$cfRequests $cfTimeStamp\"              echo \"Writing Zone data per Country to InfluxDB cloudflare_analytics_country\"             curl -i -XPOST \"$InfluxDBURL:$InfluxDBPort/write?precision=s&db=$InfluxDB\" -u \"$InfluxDBUser:$InfluxDBPassword\" --data-binary \"cloudflare_analytics_country,country=$cfRequestsCC visits=$cfRequests $cfTimeStamp\"              arraycountry=$arraycountry+1             fi         done                            arraydays=$arraydays+1         fi     done  ",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.4.1"
    },
    {
      "type": "panel",
      "id": "grafana-worldmap-panel",
      "name": "Worldmap Panel",
      "version": "0.3.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Grafana Dashboard for Cloudflare - Pulls out all the Cloudflare Information, and Analytics from the GraphQL API.",
  "editable": true,
  "gnetId": 18138,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "panels": [
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfRequestsAll"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Total Number of Requests",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "decimals": 2,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 4,
        "y": 0
      },
      "id": 5,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfBandwidthAll"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Total Bandwidth",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 8,
        "y": 0
      },
      "id": 6,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfRequestsCached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Cached Requests",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "decimals": 2,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 12,
        "y": 0
      },
      "id": 7,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfBandwidthCached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Cached Bandwidth",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 5
              },
              {
                "color": "semi-dark-red",
                "value": 10
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 16,
        "y": 0
      },
      "id": 13,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfThreatsAll"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Total Threats",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 20,
        "y": 0
      },
      "id": 14,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfUniquesAll"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Total Unique Visitors",
      "type": "stat"
    },
    {
      "circleMaxSize": "20",
      "circleMinSize": "1",
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_INFLUXDB}",
      "decimals": 0,
      "esMetric": "Count",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "gridPos": {
        "h": 20,
        "w": 12,
        "x": 0,
        "y": 4
      },
      "hideEmpty": true,
      "hideZero": true,
      "id": 2,
      "initialZoom": "2",
      "interval": "1h",
      "locationData": "countries",
      "mapCenter": "Europe",
      "mapCenterLatitude": 46,
      "mapCenterLongitude": 14,
      "maxDataPoints": 1,
      "mouseWheelZoom": true,
      "pluginVersion": "7.4.1",
      "showLegend": true,
      "stickyLabels": false,
      "tableQueryOptions": {
        "geohashField": "geohash",
        "latitudeField": "latitude",
        "longitudeField": "longitude",
        "metricField": "metric",
        "queryType": "geohash"
      },
      "targets": [
        {
          "alias": "$tag_country",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "country"
              ],
              "type": "tag"
            },
            {
              "params": [
                "none"
              ],
              "type": "fill"
            }
          ],
          "limit": "",
          "measurement": "cloudflare_analytics_country",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "visits"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": "0,100",
      "timeFrom": null,
      "timeShift": null,
      "title": "Countries Traffic Map",
      "type": "grafana-worldmap-panel",
      "unitPlural": "requests",
      "unitSingle": "",
      "unitSingular": "request",
      "valueName": "total"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 12,
        "y": 4
      },
      "id": 15,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfRequestsAll"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": "24h",
      "timeShift": null,
      "title": "Total Requests",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 16,
        "y": 4
      },
      "id": 16,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfRequestsCached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": "24h",
      "timeShift": null,
      "title": "Cached Requests",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 20,
        "y": 4
      },
      "id": 17,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfRequestsUncached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": "24h",
      "timeShift": null,
      "title": "Uncached Requests",
      "type": "stat"
    },
    {
      "aliasColors": {},
      "bars": true,
      "cacheTimeout": null,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "links": []
        },
        "overrides": []
      },
      "fill": 8,
      "fillGradient": 0,
      "gridPos": {
        "h": 5,
        "w": 12,
        "x": 12,
        "y": 7
      },
      "hiddenSeries": false,
      "id": 8,
      "interval": null,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 0,
      "links": [],
      "maxDataPoints": null,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": false
      },
      "percentage": false,
      "pluginVersion": "7.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:232",
          "alias": "Cached Requests",
          "color": "#1f77b4"
        },
        {
          "$$hashKey": "object:233",
          "alias": "Uncached Requests",
          "color": "#aec7e8"
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "alias": "Cached Requests",
          "groupBy": [
            {
              "params": [
                "1d"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT last(\"visits\") FROM \"cloudflare_analytics_country\" WHERE $timeFilter GROUP BY time($__interval), \"country\" fill(none)",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfRequestsCached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Cached Requests"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "Uncached Requests",
          "groupBy": [
            {
              "params": [
                "1d"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT last(\"visits\") FROM \"cloudflare_analytics_country\" WHERE $timeFilter GROUP BY time($__interval), \"country\" fill(none)",
          "rawQuery": false,
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfRequestsUncached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Uncached Requests"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": "7d",
      "timeRegions": [],
      "timeShift": null,
      "title": "Requests Through Cloudflare",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:246",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:247",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "decimals": 2,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 12,
        "y": 12
      },
      "id": 18,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfBandwidthAll"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": "24h",
      "timeShift": null,
      "title": "Total Bandwidth",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "decimals": 2,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 16,
        "y": 12
      },
      "id": 19,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfBandwidthCached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": "24h",
      "timeShift": null,
      "title": "Cached Bandwidth",
      "type": "stat"
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "decimals": 2,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgb(56, 56, 56)",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 4,
        "x": 20,
        "y": 12
      },
      "id": 20,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfBandwidthUncached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": "24h",
      "timeShift": null,
      "title": "Cached Bandwidth",
      "type": "stat"
    },
    {
      "aliasColors": {},
      "bars": true,
      "cacheTimeout": null,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "links": []
        },
        "overrides": []
      },
      "fill": 8,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 12,
        "y": 15
      },
      "hiddenSeries": false,
      "id": 9,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 0,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.4.1",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:398",
          "alias": "Cached Bandwidth",
          "color": "#1f77b4"
        },
        {
          "$$hashKey": "object:399",
          "alias": "Uncached Bandwidth",
          "color": "#aec7e8"
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "alias": "Cached Bandwidth",
          "groupBy": [
            {
              "params": [
                "1d"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT last(\"visits\") FROM \"cloudflare_analytics_country\" WHERE $timeFilter GROUP BY time($__interval), \"country\" fill(none)",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfBandwidthCached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Cached Requests"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "Uncached Bandwidth",
          "groupBy": [
            {
              "params": [
                "1d"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "cloudflare_analytics",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT last(\"visits\") FROM \"cloudflare_analytics_country\" WHERE $timeFilter GROUP BY time($__interval), \"country\" fill(none)",
          "rawQuery": false,
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cfBandwidthUncached"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Uncached Requests"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": "7d",
      "timeRegions": [],
      "timeShift": null,
      "title": "Bandwidth",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:412",
          "format": "decbytes",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:413",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_INFLUXDB}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 5,
        "x": 19,
        "y": 21
      },
      "id": 22,
      "options": {
        "content": "<a href=\"https://www.jorgedelacruz.es\"><img src=\"https://www.jorgedelacruz.es/wp-content/uploads/2019/04/jorgedelacruz-banner_2efede4ef704c939e63a3763231f5961.png\"></a>\n\n\n\n",
        "mode": "html"
      },
      "pluginVersion": "7.4.1",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "text"
    }
  ],
  "refresh": false,
  "schemaVersion": 27,
  "style": "dark",
  "tags": [
    "cloudflare"
  ],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-7d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Grafana Dashboard for Cloudflare Analytics and Overview",
  "uid": "iFcf4yqZk",
  "version": 11
}