Lighthouse
Security Monitoring is now available Security Monitoring is now available

Lighthouse

Agent Check Agent Check

Supported OS: Linux

Overview

Get metrics from Google Chrome Lighthouse in real time to:

  • Visualize and monitor Lighthouse stats.
  • Track and audit scores for your websites accessibility, best practices, performance, PWA, and SEO audit scores.

Setup

The Lighthouse check is not included in the Datadog Agent package, so you will need to install it yourself.

Installation

If you are using Agent v6.8+ follow the instructions below to install the Google Chrome Lighthouse check on your host. See our dedicated Agent guide for installing community integrations to install checks with the Agent prior to version 6.8 or the Docker Agent:

  1. Install the developer toolkit.
  2. Clone the integrations-extras repository:

    git clone https://github.com/DataDog/integrations-extras.git.
  3. Update your ddev config with the integrations-extras/ path:

    ddev config set extras ./integrations-extras
  4. To build the lighthouse package, run:

    ddev -e release build lighthouse
  5. Download and launch the Datadog Agent.

  6. Run the following command to install the integrations wheel with the Agent:

    datadog-agent integration install -w <PATH_OF_LIGHTHOUSE_ARTIFACT>/<LIGHTHOUSE_ARTIFACT_NAME>.whl
  7. Configure your integration like any other packaged integration.

Configuration

  1. Edit the lighthouse.d/conf.yaml file in the conf.d/ folder at the root of your Agent’s configuration directory to start collecting your Lighthouse metrics. See the sample lighthouse.d/conf.yaml for all available configuration options.

  2. Restart the Agent

Requirements

  1. Node.js LTS (8.9+).

  2. Lighthouse:

    • Check if installed.

      # example
      root@hostname:~# npm list -g --depth=0 | grep 'lighthouse'
      └── lighthouse@5.6.0
    • Install if not (no output from above command):

      npm install -g lighthouse
  3. Either Google Chrome/Chromium or Puppeteer.

    • Chromium

      • Debian/Ubuntu

        sudo apt-get update
        sudo apt-get install -y chromium-browser
      • RHEL/CentOS

        sudo yum install -y epel-release
        sudo yum install -y chromium

    Note: This integration runs Chrome/Chromium in headless mode; Chrome/Chromium may require kernel 4.4+ on RHEL/CentOS for the headless mode to work properly.

    • Puppeteer

      • Check if installed.

        # example
        root@hostname:~# npm list -g --depth=0 | grep 'puppeteer'
        └── puppeteer@1.12.2
      • Install if not (no output from above command):

        npm install -g puppeteer --unsafe-perm=true
  4. Verify if dd-agent user is able to run the lighthouse cli.

    sudo -u dd-agent lighthouse <WEB_URL> --output json --quiet --chrome-flags='--headless'

Validation

Run the Agent’s status subcommand and look for lighthouse under the Checks section.

Data Collected

Metrics

lighthouse.accessibility
(gauge)
The google chrome lighthouse score for accessibility
Shown as percent
lighthouse.best_practices
(gauge)
The google chrome lighthouse score for best_practices
Shown as percent
lighthouse.performance
(gauge)
The google chrome lighthouse score for performance
Shown as percent
lighthouse.pwa
(gauge)
The google chrome lighthouse score for pwa
Shown as percent
lighthouse.seo
(gauge)
The google chrome lighthouse score for seo
Shown as percent

Events

The Lighthouse integration does not include any events.

Service Checks

The Lighthouse integration does not include any service checks.

Troubleshooting

Need help? Contact Datadog support.