Need cloud computing? Get started now

Integrating mPulse’s Beacon API with EdgeWorkers to Visualize All Client Requests

Hitoshi Kaneko

Written by

Hitoshi Kaneko

January 24, 2024

Hitoshi Kaneko

Written by

Hitoshi Kaneko

Hitoshi Kaneko is a Senior Technical Solutions Architect within the Compute and Delivery Division at Akamai. His primary focus is helping customers develop computing strategies and improve website performance.

When combined with the http-request module from EdgeWorkers, mPulse makes it easy for -you to send requests from edge servers through the Akamai platform.

Akamai mPulse is a real user performance and real-time analytics tool that can team up with Akamai EdgeWorkers to visualize all client requests. When combined with the http-request module from EdgeWorkers, mPulse makes it easy for you to send requests from edge servers through the Akamai platform.

Independent — and integrated — performance 

To fully understand how mPulse and EdgeWorkers work together, you must first understand what these state-of-the-art Akamai tools are and how they work independently. Read on to learn more about mPulse and EdgeWorkers, as well as how to integrate the mPulse Beacon API with EdgeWorkers to better monitor your application performance and visualize all request traffic from your mPulse dashboard in near real time.

What is Akamai mPulse?

Akamai mPulse is a real user monitoring tool designed to help organizations understand both user performance and conversion actions and correlate performance with browser-based business metrics. It offers:

  • Real-time in-depth visibility on user experience

  • Actionable site-wide metrics for optimizing digital business

  • Insights on how web performance changes impact revenue

  • Predictive analysis to identify how performance improvement could impact business metrics and to help you understand how to identify and address website performance problems

What is Akamai EdgeWorkers?

Akamai EdgeWorkers lets users create functions at the edge on Akamai’s distributed serverless network. With this product, you can:

  • Improve service and application speed

  • Create more personalized digital experiences for your users

  • Scale with greater reliability, security, and flexibility

  • Save more by paying only for what you use without needing to provision resources for peak and scale

How do mPulse and EdgeWorkers work together?

Browsers can send mPulse beacons by executing mPulse Boomerang JavaScript file. The mPulse Beacon API is useful for sending beacons for nonbrowser clients (e.g., API requests) that don’t send beacons. However, you must modify your origin server’s code before sending the beacon. 

This integration is very beneficial in scenarios when you want to visualize nonbrowser client data but changing the origin server’s code is impossible. However, unlike the generic use case for mPulse, the integration is not intended for all users and paths. It must be selectively applied for particular purposes (Table). 

Table showing pros, cons, target client, and target path of mPulse and the mPulse EdgeWorkers integration Table: mPulse and mPulse EdgeWorkers integration comparison

Figure 1 is an example of an mPulse dashboard.

mPulse dashboard showing round-trip time between client and edge server and turnaround time measured by EdgeWorkers, as well as user location object cities, device object browsers, and response object HTTP status codes in EdgeWorkers Fig. 1: mPulse dashboard

4 steps to integrate the mPulse Beacon API with EdgeWorkers

Follow these four steps to properly configure the mPulse Beacon API with EdgeWorkers.

  1. Configure a custom mPulse timer, metric, or dimension to visualize data through EdgeWorkers. The following data can be placed into mPulse custom buckets:

  • Custom timer

    • e.g., AK_CLIENT_RTT; custom definition timers in the EdgeWorkers code

  • Custom metric

    • e.g., business KPI (finish payment)

  • Custom dimension

    • e.g., User Location Object, such as country, or Device Object, such as mobile browser, in EdgeWorkers

mPulse custom configurations like custom timers (Figure 2) and custom dimensions (Figure 3) must be created because the mPulse Beacon API uses these parameters in EdgeWorkers. Value Source and URL Pattern require no specific configuration.

Tab for mPulse custom timer fields (name, description, value source, URL pattern, include criteria, indicator color ranges) Fig. 2: mPulse custom timer
Tab for mPulse custom dimensions fields (name, description, type, value source, URL pattern, include criteria, alias map) Fig. 3: mPulse custom dimension

2. Export the mPulse app from the Apps tab after updating (Figure 4).

Apps tab from mPulse dashboard displaying mPulse app export instructions Fig. 4: mPulse Apps tab

Figure 5 shows the index numbers for the XML file’s custom configurations are used for EdgeWorkers code.

Red arrow pointing at index number “4” in EdgeWorkers code for CustomTimer Fig. 5: mPulse XML file
3. Download the EdgeWorkers code from the EdgeWorkers GitHub repository, and 
    configure your mPulse API key and domain from the mPulse app and your 
    previously customized settings.

The code in Figure 6 parses the mPulse app’s configuration and extracts the  required parameters used with custom timers and dimensions when sending  mPulse beacons.

Code to parse mPulse app configuration and extract custom timer and dimensions parameters when sending mPulse beacons Fig. 6: EdgeWorkers code

(You can learn more about setting up EdgeWorkers by reading our documentation.)

4. Customize your mPulse dashboard to visualize custom configurations once  EdgeWorkers is deployed (Figure 7).

Red arrow pointing to Custom Timers category in Summary tab of mPulse dashboard Fig. 7 mPulse dashboard displaying custom configurations

Check out this documentation to learn more about creating custom dashboards.

Improve application performance monitoring and visualize all request traffic 

Together, Akamai EdgeWorkers’ http-request module and the Akamai mPulse Beacon API can help your organization improve your application performance monitoring and visualize all request traffic from your mPulse dashboard in near real time.

Learn more

Now that you understand the importance of integrating mPulse with EdgeWorkers, learn more about using these premiere Akamai tools individually and together from the mPulse and EdgeWorkers documentation pages.

Get started

Don’t have mPulse? Start your free trial today.



Hitoshi Kaneko

Written by

Hitoshi Kaneko

January 24, 2024

Hitoshi Kaneko

Written by

Hitoshi Kaneko

Hitoshi Kaneko is a Senior Technical Solutions Architect within the Compute and Delivery Division at Akamai. His primary focus is helping customers develop computing strategies and improve website performance.