---
title: "Profile production all the time at low · Agent Wranglers"
url: https://agentwranglers.se/playbook/operations/metrics-and-traces/continuous-profiling
id: OPS-83
level: Optional
updated: 2026-10-27
build: a2a6bdfed830
tokens: 818
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Profile production all the time at low cost

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Metrics and traces](https://agentwranglers.se/playbook/operations/metrics-and-traces.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: OPS-83
- Level: Optional
- Chapter: [Metrics and traces](https://agentwranglers.se/playbook/operations/metrics-and-traces.md)
- Rule: 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.
- 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.
- Review by: 2027-06-30
- How: 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](https://agentwranglers.se/playbook/scaling/measure-before-you-scale/profile-first.md) explains.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
// 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
// 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")},
})
```

## Sources

- [OpenTelemetry profiles](https://opentelemetry.io/docs/specs/otel/profiles/)
- [Grafana Pyroscope documentation](https://grafana.com/docs/pyroscope/latest/)

## Related rules

- SCL-2 [Profile the slow path before you change it](https://agentwranglers.se/playbook/scaling/measure-before-you-scale/profile-first.md) in Scaling

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/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.

- Previous: [Give telemetry a budget and sample the bulk](https://agentwranglers.se/playbook/operations/metrics-and-traces/telemetry-budget.md)
- [Metrics and traces](https://agentwranglers.se/playbook/operations/metrics-and-traces.md)
