Parca Continuous Profiling

repository·main·Indexed 26 days ago

https://github.com/parca-dev/parca

A continuous profiling platform that uses eBPF to collect low-overhead CPU and memory usage data across infrastructures. Parca allows developers to analyze performance down to the line number and compare profiles across dimensions like versions or regions. It supports C, C++, Rust, and Go, producing and ingesting pprof formatted profiles. The ecosystem includes a Go-based backend, a React-based UI, and various shared libraries such as @parca/client, @parca/components, and @parca/parser.

Tokens
30.4K
Snippets
45
Records
184
Agent score
88%

What's inside Parca

  1. Overview of the Parca API Client

    main
    The Parca API Client (@parca/client) is the official client library used to interact with the Parca API. It provides a structured way to perform operations against the Parca backend, facilitating data retrieval and management for developers building tools or integrations on top of Parca.
  2. Overview of Parca Continuous Profiling

    main

    Parca is a continuous profiling tool designed to analyze CPU and memory usage over time, down to the specific line number. It uses an eBPF-based profiler to automatically discover targets from Kubernetes or systemd across infrastructure with very low overhead.

    Key features include:

    • eBPF Profiler: Supports C, C++, Rust, Go, and more without requiring manual instrumentation.
    • Open Standards: Produces and ingests pprof formatted profiles for wide language interoperability.
    • Optimized Storage & Querying: Efficiently stores profiling data and allows for label-based searching, aggregation, and comparison across dimensions like deploys, versions, or regions.
  3. Understand Parca service packages

    main

    Parca provides an API for the continuous profiling Parca server. The functionality is divided into several specialized service packages:

    • debuginfo: Manages the storage of debug information.
    • profilestore: Handles writing pprof profiles to the service.
    • query: Enables querying profiles from the service.
    • scrape: Provides information about scrape targets.
    • telemetry: Receives telemetry data from the Agent (e.g., unhandled panics).
  4. Set up Parca development environment

    main

    To develop on Parca, you must have Go, Node, and Pnpm installed. Follow these steps to clone and build the project:

    1. Clone the repository.
    2. Navigate to the project directory.
    3. Run make build to build the UI and compile the Go binaries.
    git clone https://github.com/parca-dev/parca.git
    cd parca
    make build
  5. Set up Parca UI development environment

    main

    To develop the Parca UI locally, follow these steps:

    1. Configure the API endpoint: Create a .env.local file in packages/app/web/ and set the VITE_API_ENDPOINT variable.
    2. Start the Parca backend: Run the backend with CORS enabled to allow the UI to communicate with it.
    3. Compile shared packages: Run the watch command to transpile TypeScript code and compile Tailwind CSS for the @parca shared packages.
    4. Start the React dev server: Launch the development server for the @parca/web package.

    The UI will be available at http://localhost:3000.