View profiling data from Parca or Polar Signals Cloud directly in VS Code. See CPU, memory, and other profiling annotations inline with your source code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
View profiling data from Parca or Polar Signals Cloud directly in VS Code with inline code annotations.
Features
Dual-mode support: Connect to self-hosted Parca (OSS) or Polar Signals Cloud
Inline annotations: See CPU time, memory allocations, and other metrics directly in your code
Preset queries: Quick access to common profiling scenarios (On-CPU, Off-CPU, Memory, etc.)
Deep linking: Open VS Code from Parca/Polar Signals Cloud.
Session caching: Annotations persist as you navigate between files
Installation & Development
Prerequisites
VS Code 1.85.0 or later
Node.js and pnpm
Setup
Install dependencies:
cd vscode-extension
pnpm install
Compile the extension:
pnpm run compile
Test the extension:
Open this directory in VS Code
Press F5 to launch Extension Development Host
In the new window, open a source file from your project
On first use, a setup wizard will guide you through configuration
Configuration
First-Time Setup
On first use, the extension will prompt you to choose a mode:
Polar Signals Cloud: Uses OAuth to sign in with your Polar Signals account
Self-hosted Parca: Connects to a local or remote Parca instance (no authentication)
Settings
The extension supports the following settings (prefix: polarSignals.*):
Setting
Description
Default
polarSignals.mode
Connection mode (cloud or oss)
(set during setup)
polarSignals.cloudUrl
Polar Signals Cloud API URL
https://api.polarsignals.com
polarSignals.selfHostedUrl
Self-hosted Parca URL
http://localhost:7070
polarSignals.defaultTimeRange
Default time range for queries
1h
polarSignals.profileType
Default profile type
parca_agent:samples:count:cpu:nanoseconds:delta
polarSignals.presets
Custom query presets
[]
Authentication (Cloud Mode)
For Polar Signals Cloud, the extension uses OAuth authentication. During setup, you'll be redirected to sign in with your Polar Signals account. Tokens are securely stored using VS Code's Secret Storage API.
Usage
Quick Start with Presets
Open a source file in VS Code
Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
Run: Polar Signals: Select Preset
Choose a preset (e.g., "On-CPU (15min)")
Profiling annotations appear inline in your code
Fetch Profile with Custom Query
Open a source file in VS Code
Open Command Palette
Run: Polar Signals: Fetch Profile for Current File
Configure the query (profile type, time range, labels)
The extension fetches and displays profiling data
Deep Linking
In Parca or Polar Signals Cloud, right click on any node in the flame graph or in the Source View (only in Polar Signals Cloud) and click on the "Open in VS Code" option.
VS Code opens with profiling data for that file and line
Make sure VS Code has the correct workspace open and is in focus so the extension can actually open the file in the correct context.
Import from URL
Copy a URL from Parca or Polar Signals Cloud
Run: Polar Signals: Import from URL
Paste the URL
The extension imports the query configuration
Commands
Command
Description
Polar Signals: Fetch Profile for Current File
Fetch profiling data with full configuration
Polar Signals: Select Preset
Quick fetch using a preset configuration
Polar Signals: Quick Actions
Show status bar menu with common actions
Polar Signals: Import from URL
Import query from a Parca or Polar Signals Cloud URL
Polar Signals: Clear Profiling Annotations
Remove all profiling annotations
Polar Signals: Configure Defaults
Open extension settings
Polar Signals: Setup Mode
Re-run the setup wizard to change mode
Polar Signals: Sign Out from Polar Signals Cloud
Sign out and remove stored credentials
Built-in Presets
On-CPU: CPU profile samples (15min, 1h, 24h)
Off-CPU: Time spent waiting/blocked (15min, 1h)
Memory Allocations: Memory allocations during time period
Memory In-Use: Currently allocated memory
Goroutines: Goroutine creation stack traces
Mutex Contention: Time spent waiting on mutex locks
Block Contention: Time spent blocked on synchronization
Architecture
Components
Extension (extension.ts): Main entry point, registers commands
API Client (api/profiler-client.ts): Queries Parca/Polar Signals Cloud API
Settings (config/settings.ts): Manages dual-mode configuration and secrets