Gets assets metrics using Puppeteer.
Want to know which scripts are loaded in your page? This module allows you to extract and audit the metrics.
npm install puppeteer-assets
Using CLI
puppeteer-assets www.google.com
Using on Node.js
const assetsMetrics = require('puppeteer-assets');
const metrics = await assetsMetrics('https://www.google.com');
Exports assets metrics via HTTP for Prometheus consumption.
Use docker image:
docker run --name=prometheus-assets -d -p 3000:3000 andersonba/prometheus-assets
Now, in your Prometheus configuration (/etc/prometheus/prometheus.yml), add a new target.
You can monitor multiple URLs passing params
each scrape config. See example
If you prefer use a configuration file, create a config.yml file. Then, run the container defining the volume:
docker run --name=prometheus-assets -v /tmp/config.yml:/app/prometheus/ -d -p 3000:3000 andersonba/prometheus-assets
Execute the command
url
- Required. Page URL.options.internalPattern
- String/Regex. Identify scripts as Internal based on RegExp (Default: null)options.mimeTypes
- Array of String/RegExp. File types to be matched (Default: 'javascript')