Skip to main content

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The CloudWatch RUM integration requires the JavaScript SDK version 2.24 or higher, or the React Web 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.

Set up the integration

The code below can be modified to fit your setup. Here’s how to get started:
    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)
        },
      },
    ]