---
title: Lighthouse
description: Google Lighthouse Audit Stats
breadcrumbs: Docs > Integrations > Lighthouse
---

# Lighthouse
Supported OS Integration version2.2.0
## Overview{% #overview %}

Get metrics from [Google Chrome Lighthouse](https://developers.google.com/web/tools/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{% #setup %}

The Lighthouse check is not included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, so you need to install it.

### Installation{% #installation %}

For Agent v7.21+ / v6.21+, follow the instructions below to install the Lighthouse check on your host. See [Use Community Integrations](https://docs.datadoghq.com/agent/guide/use-community-integrations/) to install with the Docker Agent or earlier versions of the Agent.

1. Run the following command to install the Agent integration:

   ```shell
   datadog-agent integration install -t datadog-lighthouse==<INTEGRATION_VERSION>
   ```

1. Configure your integration similar to core [integrations](https://docs.datadoghq.com/getting_started/integrations/).

### Configuration{% #configuration %}

1. Edit the `lighthouse.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory) to start collecting your Lighthouse metrics. See the [sample lighthouse.d/conf.yaml](https://github.com/DataDog/integrations-extras/blob/master/lighthouse/datadog_checks/lighthouse/data/conf.yaml.example) for all available configuration options.

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent)

### Requirements{% #requirements %}

1. Node.js LTS (8.9+).

   - Check if Node.js and npm installed:

   ```shell
   node -v
   npm -v
   ```

   - If not, [install Node.js and npm](https://nodejs.org/en/download).

1. [Lighthouse](https://github.com/GoogleChrome/lighthouse):

   - Check if installed.

   ```shell
   # example
   root@hostname:~# npm list -g --depth=0 | grep 'lighthouse'
   |_ lighthouse@5.6.0
   ```

   - Install if not (no output from above command):

   ```shell
   npm install -g lighthouse
   ```

1. Either Google Chrome/Chromium or Puppeteer.

   - [Chromium](https://www.chromium.org/)

     - Debian/Ubuntu

     ```shell
     sudo apt-get update
     sudo apt-get install -y chromium-browser
     ```

     - RHEL/CentOS

     ```shell
     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](https://github.com/GoogleChrome/puppeteer)

     - Check if installed.

     ```shell
     # example
     root@hostname:~# npm list -g --depth=0 | grep 'puppeteer'
     |_ puppeteer@1.12.2
     ```

     - Install if not (no output from above command):

     ```shell
     npm install -g puppeteer --unsafe-perm=true
     ```

1. Verify if `dd-agent` user is able to run the lighthouse cli.

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

### Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information) and look for `lighthouse` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #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*                                                                                                     |
| **lighthouse.largest\_contentful\_paint**(gauge)  | Largest Contentful Paint marks the time at which the largest text or image is painted.*Shown as millisecond*                                                     |
| **lighthouse.first\_contentful\_paint**(gauge)    | First Contentful Paint marks the time at which the first text or image is painted.*Shown as millisecond*                                                         |
| **lighthouse.cumulative\_layout\_shift**(gauge)   | Cumulative Layout Shift measures the movement of visible elements within the viewport.*Shown as unit*                                                            |
| **lighthouse.max\_potential\_fid**(gauge)         | The maximum potential First Input Delay that your users could experience is the duration of the longest task.*Shown as millisecond*                              |
| **lighthouse.time\_to\_interactive**(gauge)       | Time to interactive is the amount of time it takes for the page to become fully interactive.*Shown as millisecond*                                               |
| **lighthouse.mainthread\_work\_breakdown**(gauge) | Consider reducing the time spent parsing compiling and executing JS. You may find delivering smaller JS payloads helps with this.*Shown as millisecond*          |
| **lighthouse.unused\_javascript**(gauge)          | Reduce unused JavaScript and defer loading scripts until they are required to decrease bytes consumed by network activity.*Shown as millisecond*                 |
| **lighthouse.unused\_css\_rules**(gauge)          | Reduce unused rules from stylesheets and defer CSS not used for above-the-fold content to decrease bytes consumed by network activity.*Shown as millisecond*     |
| **lighthouse.modern\_image\_formats**(gauge)      | Image formats like WebP and AVIF often provide better compression than PNG or JPEG which means faster downloads and less data consumption.*Shown as millisecond* |
| **lighthouse.uses\_optimized\_images**(gauge)     | Optimized images load faster and consume less cellular data.*Shown as millisecond*                                                                               |
| **lighthouse.render\_blocking\_resources**(gauge) | Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles.*Shown as millisecond*  |
| **lighthouse.bootup\_time**(gauge)                | Consider reducing the time spent parsing compiling and executing JS. You may find delivering smaller JS payloads helps with this.*Shown as millisecond*          |
| **lighthouse.server\_response\_time**(gauge)      | Keep the server response time for the main document short because all other requests depend on it.*Shown as millisecond*                                         |
| **lighthouse.speed\_index**(gauge)                | The number of milliseconds it takes for the contents of a page to be visibly populated.*Shown as millisecond*                                                    |
| **lighthouse.dom\_size**(gauge)                   | The current size of the DOM. A large DOM will increase memory usage cause longer style calculations and produce costly layout reflows.                           |
| **lighthouse.total\_blocking\_time**(gauge)       | Sum of all time periods between FCP and Time to Interactive when task length exceeded 50ms expressed in milliseconds.*Shown as millisecond*                      |

### Events{% #events %}

The Lighthouse integration does not include any events.

### Service Checks{% #service-checks %}

The Lighthouse integration does not include any service checks.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
