Introduction

Cloudflare is a Content Delivery Network (CDN) and cloud security platform that provides website optimization, security, and performance services. It acts as a mediator between a website’s server and its visitors, improving the speed and reliability of the website while also protecting it from online threats. Cloudflare can also as a reverse proxy for web traffic. It provides DDoS mitigation services that protect customers from Distributed Denial of Service (DDoS) attacks.

Discovery

The resources accessible through Cloudflare include the following:

  • Cloudflare Account - An organization in Cloudflare is a logical grouping that allows for the management and segregation of resources within Cloudflare.
  • Cloudflare Zone - Zone is the basic resource for working with Cloudflare and is equivalent to a domain name that the user purchases.

Cloudflare organizes its resources hierarchically to provide a topological view and simplify maintenance. The hierarchy of Cloudflare resources is as follows:

  • Cloudflare Account
    • Cloudflare Zone

Configure the Integration

  1. From All Clients, select a client.

  2. Go to Setup > Account.

  3. Select the Integrations and Apps tab.

  4. The Installed Integrations page, where all the installed applications are displayed.
    Note: If there are no installed applications, it will navigate to the ADD APP page.

  5. Click + ADD on the Installed Integrations page. The Available Integrations and Apps page displays all the available applications along with the newly created application with the version.
    Note: You can even search for the application using the search option available. Also you can use the All Categories option to search.

  6. Click ADD under Cloudflare:

  7. In the Account Information page, enter your account information:

    Image

    PropertyDescription
    Name(required) User-defined, descriptive integration name.
    Organization Id(required) Enter organization ID.
    Token(required) Enter the token number.
    Confirm Token(required) Re-enter the token number.
  8. Click Next.

  9. In the RESOURCE TYPE section, select:

    • ALL: All the existing and future resources will be discovered.
    • SELECT: You can select one or multiple resources to be discovered.
  10. In the DISCOVERY SCHEDULE section, select Recurrence Pattern to add one of the following patterns:

    • Minutes
    • Hourly
    • Daily
    • Weekly
    • Monthly
      Image
  11. Click Finish.
    The application is now installed and displayed on the Installed Integration page. Use the search field to find the installed application.

  12. After configuring the integration, the Cloudflare metrics can be viewed from the Infrastructure page.

Monitoring

For monitoring Opsramp supports the following metrics list of Cloudflare:

Supported Metrics

Native TypeMetric NameMetric Display NameUnitsDescription
Cloudflare Accountcloudflare_Account_NumberOfZonesCloudflare Account Number Of ZonesCountNumber of zones in Cloudflare account.
cloudflare_Account_AvailableZonesCloudflare Account Available ZonesCountThe number of current zones available in a Cloudflare account.
cloudflare_Account_CurrentZoneCountCloudflare Account Current Zone CountCountNumber of Cloudflare account current zones used.
Cloudflare Zonecloudflare_Zone_DNSCloudflare Zone DNSNullRefers to the Domain Name System (DNS) management capabilities provided by Cloudflare for a specific zone.
cloudflare_Zone_ThreatsCloudflare Zone ThreatsCountRefers to the security features and capabilities provided by Cloudflare within a specific zone.
cloudflare_Zone_CachedBytesCloudflare Zone Bytes CachedCountNumber of Cloudflare zone bytes cached.
cloudflare_Zone_BytesTransferredCloudflare Zone Bytes TransferredCountNumber of Cloudflare zone bytes transferred.
cloudflare_Zone_ResponseBodySizeCloudflare Zone Response Body SizeNullResponse body size of Cloudflare zone.

Zone Discovery API

When a request is made to the zone discovery API for zone discovery, there are instances where the response time exceeds 30 seconds. In such scenarios, we halt the discovery process due to a potential issue with the Cloudflare API.

Graph Data Representation

For cloudflare_Zone_Threats, cloudflare_Zone_CachedBytes, cloudflare_Zone_BytesTransferred, and cloudflare_Zone_ResponseBodySize of zone native type metrics, the data that is timestamped one hour ago is displayed with the current timestamp at which data is collected. When a request is sent to the API within completion of an hour, the data may vary for the same timestamp until the current hour is complete. Once the hour is completed, the data becomes stable. After the hour is complete and the data is stable, data with the current timestamp is displayed. For information on rate limits for these metrics, see https://developers.cloudflare.com/analytics/graphql-api/limits/.