Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer tracing captures browser activity for later inspection. Set categories to control included and excluded events, choose path to write the trace to disk or omit it to receive bytes from tracing.stop(), and enable screenshots only when you need them. The options reference consulted here is for Puppeteer 25.12.0; the separate Tracing class reference is for 25.9.0, so check the documentation matching your installed version before relying on version-specific behavior.

What Puppeteer tracing options control

The Puppeteer TracingOptions API reference documents four options:

Option What it controls Documented behavior
categories Which trace-event categories to include or exclude. An array of strings. Prefix a category with - to exclude it; the reference gives -toplevel as an example. It does not provide an exhaustive category list.
path Where to save a trace file. If provided, Puppeteer writes the trace to that path. If omitted, the trace is not written to disk and can be returned by tracing.stop() as a Uint8Array.
screenshots Whether to include screenshots in the trace. Optional boolean; the documented default is false. This is separate from page.screenshot(), which captures an image through a different API.
bufferSize Trace-buffer capacity. Optional size in kilobytes. The 25.12.0 reference reports that Chromium’s default is 200 MB (200,000 KB) when unspecified or set to zero. Treat this as the documented default, not a guarantee for every browser build or workload.

Capture a trace and save it to a file

Start tracing before the interaction or navigation you want to diagnose, then stop it after that work. This runnable Node.js example uses Puppeteer’s documented file-output pattern:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();

    await page.tracing.start({
      path: 'trace.json',
      screenshots: false,
    });

    await page.goto('https://example.com', { waitUntil: 'load' });
    await page.tracing.stop();
  } finally {
    await browser.close();
  }
})();

Run it from a directory where the process can create trace.json. When tracing stops, the trace is written to that path. The Puppeteer Tracing class documentation says traces can be opened in Chrome DevTools or a timeline viewer, and its example starts a trace, navigates, and stops it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Retain bytes instead of writing a file

Omit path when you want the trace data in memory—for example, to pass it to another part of your program or save it under a name chosen after capture. The options reference specifies that stop() can return a Uint8Array in this mode:

const puppeteer = require('puppeteer');
const fs = require('node:fs/promises');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.tracing.start({ categories: ['devtools.timeline'] });
    await page.goto('https://example.com', { waitUntil: 'load' });

    const traceBytes = await page.tracing.stop();
    if (traceBytes) {
      await fs.writeFile('trace.json', traceBytes);
    }
  } finally {
    await browser.close();
  }
})();

The category shown is an example, not a recommendation for every diagnostic. Choose categories relevant to the question and verify their names against the browser tooling and Puppeteer version you use.

Choose categories, screenshots, and buffer size deliberately

Categories: narrow the capture to the question

categories accepts strings for event categories to include, and a leading hyphen excludes a category. The documented example -toplevel illustrates exclusion syntax. Since the Puppeteer options reference does not enumerate every valid category, do not treat any sample list as complete. Start with the trace detail your investigation needs; broader capture can make traces harder to interpret.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Screenshots: optional trace detail

screenshots defaults to false. Turn it on only when visual context in the trace will help correlate page appearance with activity. It does not replace page.screenshot() and does not mean Puppeteer will save a standalone image using that method.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Buffer size: the documented Chromium default

bufferSize is measured in kilobytes. The Puppeteer 25.12.0 options reference says an omitted value or zero uses Chromium’s documented default of 200 MB (200,000 KB). That figure comes from the API documentation; actual behavior can depend on the Chromium build and workload. Set a value only if you have a reason to control buffer capacity, and validate results with the browser version you run.

How to inspect a trace

  1. Capture the specific navigation or interaction you need to investigate and stop tracing cleanly.
  2. Open the saved trace in Chrome DevTools or a timeline viewer. Puppeteer’s Tracing class documentation names both as ways to inspect a trace.
  3. In DevTools, use the Performance panel to examine the timeline and correlate events with the captured page activity.
  4. For comparisons, keep the workload and DevTools capture settings consistent. Change one diagnostic variable at a time so that differences are easier to interpret.

Chrome DevTools’ Performance panel can record, save, and load traces. Its capture settings include disabling JavaScript samples to reduce overhead and enabling advanced paint instrumentation, which the DevTools documentation says significantly hinders performance. Collect only the detail needed for the question; advanced paint instrumentation is not a free increase in detail.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Important limits and version differences

  • Only one Puppeteer trace can be active at a time per browser, according to the Tracing class reference. Stop the current trace before starting another on that browser.
  • The TracingOptions page consulted is version 25.12.0, while the Tracing class page is version 25.9.0. These references are not version-aligned. Check the docs for the exact package version installed in your project when behavior matters.
  • The Chrome DevTools Protocol has a lower-level Tracing domain with its own start/end methods, transfer modes, and configuration. Those protocol fields should not be assumed to be Puppeteer TracingOptions; use Puppeteer’s API reference for the higher-level options it supports.

Troubleshooting trace capture

No trace file appears

Check that path was supplied and that the process can write to the target directory. If you intentionally omitted path, look for the returned value from await page.tracing.stop() instead; the documented behavior in that case is in-memory bytes rather than automatic disk output.

stop() does not provide bytes you can use

Confirm that tracing was started on the page and that the options omitted path if you expected returned bytes. If you set a path, use the file written by Puppeteer. Check the installed version’s API docs because the cited TracingOptions and Tracing class pages describe different versions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Starting a second trace fails or conflicts

Only one trace can be active per browser. Await page.tracing.stop() for the active trace before starting another.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

The trace is too large or the capture seems costly

Reduce the event categories to the relevant diagnostic scope and leave screenshots disabled unless you need them. In DevTools, avoid enabling advanced paint instrumentation except when it answers your question; Chrome documents that it significantly hinders performance. No fixed trace-size or runtime outcome is guaranteed by the options reference.

The trace opens but does not answer the question

Capture only the relevant interaction, verify that your chosen categories are suitable, and use a viewer that supports the trace format. If a comparison is the goal, keep DevTools settings consistent across captures, particularly settings that alter captured detail or overhead.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a clean website screenshot rather than a browser performance trace, ScreenshotNeo is a separate API for screenshot and PDF capture—not a replacement for Puppeteer trace files. It can accept consent banners before capture and remove more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can each be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. Its MCP server provides screenshot tools for AI agents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Frequently Asked Questions

Does Puppeteer tracing capture a screenshot by default?

No. The documented default for the tracing option screenshots is false.

Can I run more than one trace at once in a browser?

No. Puppeteer’s Tracing class documentation says only one trace can be active per browser.

Are Puppeteer tracing options the same as Chrome DevTools Protocol tracing fields?

No. The protocol has a lower-level Tracing domain; consult Puppeteer’s own options reference for the settings exposed by its higher-level API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.