Agent Wranglers

OPS-83Optional

Profile production all the time at low cost

Run a sampling profiler on production all the time, with overhead under 2% CPU. Keep the profiles for at least 14 days, labelled with the service and the version.

Review by

2027-06-30

How to do it

A load test shows where time goes under test traffic. A profile from production shows where it goes for visitors, and lets you compare the hour before and after a deploy. Sampling profilers read the stack about 100 times a second, so they cost little. Examples are Grafana Pyroscope, Parca and the profilers built into cloud platforms. eBPF-based agents profile every process on a host without code changes. OpenTelemetry is adding profiles as a signal, still at alpha in October 2026. Read the result as a flame graph, as Profile the slow path before you change it explains.

Examples

JavaScript example

// Node with the Pyroscope client
import Pyroscope from '@pyroscope/nodejs';

Pyroscope.init({ serverAddress: 'https://profiles.example.com', appName: 'shop', tags: { version: process.env.APP_VERSION } });
Pyroscope.start();

Go example

// Go: profile CPU and memory and send them to Pyroscope
pyroscope.Start(pyroscope.Config{
    ApplicationName: "shop",
    ServerAddress:   "https://profiles.example.com",
    Tags:            map[string]string{"version": os.Getenv("APP_VERSION")},
})

How to check

The profiler's own CPU use stays under 2% on every host. Profiles for each production service exist for each of the last 14 days, and the version label matches the deploy log.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/operations/metrics-and-traces/continuous-profiling">Agent Wranglers operations and observability playbook</a>. In code you write, add a comment next to it with the same link.