OpsCanary
observabilityopentelemetryPractitioner

Unlocking Pyroscope 2.0: Advanced Profiling and AI Troubleshooting

5 min read Grafana BlogNov 13, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

In the fast-paced world of software development, understanding where your application spends its resources is crucial. Pyroscope 2.0 addresses this need with enhanced continuous profiling capabilities. By allowing you to see not just CPU usage but also memory allocation, it empowers you to optimize your applications effectively. This visibility helps you troubleshoot performance issues before they impact your users.

At the core of Pyroscope’s new features are exemplars and the Grafana CLI tool, gcx. Exemplars rank individual profiles based on their significance for the queried profile type, such as CPU time or memory usage. You can use gcx to rank your services by profile type over a specified time window, enabling you to focus on the most resource-intensive parts of your application. For instance, you can run commands like gcx profiles metrics '{}' --top to get a quick overview of your services' performance. Additionally, enabling memory profiling in your Python application is as simple as setting mem_enabled = True in your configuration.

In production, these features can significantly enhance your ability to monitor and optimize application performance. However, keep in mind that this functionality is currently in public preview, which may come with its own set of limitations. Ensure you're running compatible versions of Pyroscope and your services, such as Python or Rust, to take full advantage of these capabilities. The latest version, 1.3.0, supports .NET 8, 9, and 10, so be aware of your environment when implementing these tools.

Key takeaways

  • →Enable memory profiling by setting 'mem_enabled' to True in your Pyroscope configuration.
  • →Use gcx to rank services by resource usage with commands like 'gcx profiles metrics' and '--top'.
  • →Leverage exemplars to identify the most significant profiles for your performance queries.
  • →Ensure compatibility with the latest Pyroscope version to utilize new features effectively.

Why it matters

In production, optimizing resource usage can lead to significant cost savings and improved application performance. Pyroscope's new features allow you to proactively identify and resolve bottlenecks, enhancing user experience.

Code examples

Python
pyroscope.configure(
    application_name = "my.python.app",
    server_address   = "http://my-pyroscope-server:4040",
    mem_enabled      = True,
)
Shell
gcx profiles metrics '{}' \
  -d grafanacloud-profiles \
  --profile-type process_cpu:cpu:nanoseconds:cpu:nanoseconds \
  --since 1h \
  --top
Shell
gcx profiles exemplars profile '{service_name="checkoutservice"}' \
  -d grafanacloud-profiles \
  --profile-type process_cpu:cpu:nanoseconds:cpu:nanoseconds \
  --since 1h

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOcean Serverless InferenceSponsor

OpenAI & Anthropic-compatible inference API — no GPU provisioning needed. 55+ models, pay-per-token with no minimums. VPC + zero data retention by default.

Try Serverless Inference →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.