Cloudflare

TracesMetricsApp LogsCustom LogsProfiling

This guide walks you through setting up Application Performance Monitoring (APM) on applications deployed through Cloudflare Workers. These instructions can also be found on the Installation page in your Middleware Account. View example code here.

Prerequisites

Wrangler version 2.2.2. ​Check your Wrangler version with the following command:

Install

Step 1: Install Cloudflare APM Package

Run the following command in your terminal:

Step 2: Import Tracker

Step 3: Initialize Tracker

The access token is your account key, which can be found on the Installation page. To watch instrumented logs in the terminal, set consoleLogEnabled: true:

Step 4: Track Requests with MW SDK

Step 5: Enable Logging

Continuous Profiling

Continuous profiling captures real-time performance insights from your application to enable rapid identification of resource allocation, bottlenecks, and more. The following table describes the available features offered by the continuous profiler for the Cloudflare APM.

Continuous Profiling for the Cloudflare APM is not yet available; reach out to our support team if you'd like more information. Navigate to the Continuous Profiling section to learn more about using Continuous Profiling with our other APMs.

Need assistance or want to learn more about Middleware? Contact our support team in Slack.