Cloudflare plugin

For more information about what this plugin does and the data streams it retrieves, see:

Cloudflare

Monitor the state and performance of your Cloudflare websites.

To add a data source click on the + next to Data Sources on the left-hand menu in SquaredUp. Search for the data source and click on it to open the Configure data source page.

Loom video thumbnail

Before you start

You will need a Cloudflare API Token to use this data source. This token allows SquaredUp to read data from your Cloudflare account for all websites you grant permission to.

Follow the steps below to generate a token, or for additional info please refer to the Cloudflare documentation.

Generating a token

  1. Go to https://dash.cloudflare.com/profile/api-tokens and log in if required.
  2. Select Create Token.
  3. Select Use Template next to the Read all resources template - this is the recommended template, but others could be used.
  4. Under Create Token, you can use the Edit pencil to provide a useful name for the token, e.g. SquaredUp Data Source.
  5. Additionally on this screen you can configure permissions. For example, if you wish to narrow down access to certain websites/zones, you can do this under Zone Resources.
  6. Select Continue to summary.
  7. Select Create token.
  8. Your token is now displayed, select Copy and store the token securely. You will need this when configuring the data source in SquaredUp.
    Cloudflare API token

Configuring the data source

  1. Display Name:
    Enter a name for your data source. This helps you to identify this data source in the list of your data sources.

  2. API Token:
    This is your Cloudflare API Token you created when generating a token.
  3. Restrict access to this data source:
    You can enable this option if you only want certain users or groups to have access to the data source, or the permission to link it to new workspaces. See data source access control for more information.

  4. Install Sample Dashboards:
    Select whether you would like to install sample dashboards with the data source. By default, this is set to on.

  5. Click Test and add to validate the data source configuration. SquaredUp will now attempt to connect to SquaredUp using the provided authentication method. If this process fails, see Testing and troubleshooting for assistance with the corresponding errors.

    Cloudflare data source config

Testing and troubleshooting

When the data source is added (or edited), SquaredUp validates the provided API Token using the Verify Token endpoint provided by Cloudflare. Learn more.

The following errors or warnings may be displayed while using the data source. If you encounter an error, refer to the guidance below or contact [email protected] for assistance.

Error
Description
Invalid or expired API token
This error is displayed when SquaredUp cannot verify the provided token. Check the token has been entered correctly and has not expired. Additionally, confirm the token has a minimum of read permissions for at least one data source.
Failed to fetch Cloudflare accounts, check API key and data source configuration
This error is displayed if SquaredUp encounters an error while indexing accounts from your Cloudflare organization. This likely indicates a permission error so confirm the token has a minimum of read permissions for at least one data source.
Failed to fetch Cloudflare zones, check API key and data source configuration
This error is displayed if SquaredUp encounters an error while indexing websites from your Cloudflare organization. This likely indicates a permission error so confirm the token has a minimum of read permissions for at least one data source.
Failed to fetch DNS records for zone - zone dropped
This warning is displayed if SquaredUp encounters an issue while indexing the DNS records for a particular Website (zone). This likely indicates a permission error so confirm the token has a minimum of read permissions for at least one data source. Indexing will continue but this zone will be skipped.
Exception fetching DNS records for zone - zone dropped
This error is displayed if SquaredUp encounters an error while indexing the DNS records for a particular Website (zone). This likely indicates a permission error so confirm the token has a minimum of read permissions for at least one data source. Indexing will continue but this zone will be skipped.
Failed to execute GraphQL query
This error is typically displayed when authoring tiles on a dashboard and indicates either:
  • A built in metric has failed, this may be related to permissions but is likely an internal error - please contact [email protected].
  • A custom query (using the GraphQL datastream) has failed, please check the try is valid and try again.

Next steps

Now you have successfully added the data source, you can browse the sample dashboards, view all available data streams or explore any indexed objects.

Sample dashboards

When configuring the Cloudflare data source you will have the option to Install sample dashboards. This option is recommended as the dashboards are a great starting point. The following dashboards are included with the Cloudflare data source:

  • Status: Displays the health of all Websites as a large status summary. You can click on any website to drilldown and view further details.
  • Website: Displays a summary report for the selected Website(s), displaying key metrics like Total Visitors, Total Requests, Data Served, Data Cached and more.
  • Performance: Displays performance metrics for the selected Website(s). For example, Requests by HTTP Version, Requests by Content Type and Total Bytes by Content Type.
  • Security: Displays security metrics for the selected Website(s). For example, Total Threats, Requests by SSL Mode and the Firewall Activity Log.
  • Traffic: Displays traffic metrics for the selected Website(s). For example, Total Requests, Requests by Country and Page Views by Browser.

Cloudflare sample dashboard - website

Data streams

There are many data streams available when using the Cloudflare data source. Most data streams allow you to select which Website(s) you are interested in.

Data stream
Description
Requests
  • Returns counts of requests, over time. Also returns a count of cached requests.
    • by Content Type
    • by HTTP Version
    • by Source
    • by Country
    • by Response Status
    • by SSL Mode
Bandwidth
Returns data served from origin, and data served from cache over time.
Threats
  • Returns counts of threats, over time.
    • by Type
    • by Country
Unique Visitors
Returns count of unique visitors, over time.
Page views (by browser)
Returns counts of page views, broken down by browser, over time.
Firewall Activity Log (Free, Pro, Business)
Returns log entries for Websites on the Cloudflare Free, Pro or Business plans. Supports 1/12/24 hour timeframes.
Firewall Activity log (Enterprise)
Returns log entries for Websites on the Cloudflare Enterprise plans. Supports 1/12/24 hour and 30 day timeframes.
GraphQL Query
Allows you to run custom GraphQL queries against the Cloudflare API. Learn more.
Health
Calculates a health state for the given Website(s) based on the Cloudflare Development Mode and Security Level.
  • Error: When the Security Level is set to Under Attack.
  • Warning: When Development Mode is enabled.

Objects indexed

SquaredUp indexes three types of object from your Cloudflare organization. These objects are used to build dashboards and are visible when searching across SquaredUp. Drilling down into an object will provide useful metrics and properties.

  • Account
    • Name, ID and Link.
  • Zone (Website)
    • Name, ID, Plan, Owner, Status, Name Servers, Account ID and Link.
  • DNS Record
    • Name, ID, Record Type, Record Content, Proxy Status and Zone ID.

Within our Map, that are relationships between all three types of objects:
Account ——contains——> Zone ——hosts——> DNS Record

Was this article helpful?


Have more questions or facing an issue?