• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
    No results for ""
    EXPAND ALL

    EDIT ON GITHUB

    AWS CloudWatch RUM

    Read time: 1 minute
    Last edited: Jan 10, 2023
    CloudWatch RUM SDK Requirements

    The CloudWatch RUM integration requires the JavaScript SDK version 2.24 or higher, or the React Native SDK version 2.29 or higher.

    Overview

    This topic explains how to set up and use the LaunchDarkly AWS CloudWatch Real User Monitoring (RUM) integration. With AWS CloudWatch RUM, you can perform real user monitoring to collect and view client-side data about your web application performance from actual user sessions in near real-time.

    Read the send custom events CloudWatch documentation for more information on how to enable custom events for your app monitor.

    Setting up the integration

    The code below can be modified to fit your setup.

    Here's how to get started:

    • Install and configure the AWS CloudWatch RUM client
    • Use the recordEvent API to send the evaluated flags to CloudWatch RUM using custom events

    Here is an example:

    inspectors: [
    {
    type: 'flag-used',
    name: 'cloudwatch-rum',
    method: (key, detail) => {
    const flagEvent = {
    flagKey: key,
    value: detail.value
    }
    if (detail.variationIndex) {
    flagEvent["variationIndex"] = detail.variationIndex
    }
    if (detail.reason) {
    flagEvent["reason"] = detail.reason
    }
    awsRum.recordEvent('com.launchdarkly.flag.evaluation', flagEvent)
    }
    }
    ]