Open source

About the Grafana Phlare architecture

In March 2023, Grafana Labs acquired Pyroscope, the company behind the eponymous open source continuous profiling project. As a result, the Pyroscope and Grafana Phlare projects will be merged under the new name Grafana Pyroscope. To learn more, read our recent blog post about the news.

Grafana Phlare has a microservices-based architecture. The system has multiple horizontally scalable microservices that can run separately and in parallel. Grafana Phlare microservices are called components.

Grafana Phlare’s design compiles the code for all components into a single binary. The -target parameter controls which component(s) that single binary will behave as. For those looking for a simple way to get started, Grafana Phlare can also be run in monolithic mode, with all components running simultaneously in one process. For more information, refer to Deployment modes.

Grafana Phlare components

Most components are stateless and do not require any data persisted between process restarts. Some components are stateful and rely on non-volatile storage to prevent data loss between process restarts. For details about each component, see its page in Components.

The write path

Architecture of Grafana Phlare's write path

Ingesters receive incoming profiles from the distributors. Each push request belongs to a tenant, and the ingester appends the received profiles to the specific per-tenant PhlareDB that is stored on the local disk.

The per-tenant PhlareDB is lazily created in each ingester as soon as the first profiles are received for that tenant.

The in-memory profiles are periodically flushed to disk and new block is created.

For more information, refer to Ingester.

Series sharding and replication

By default, each profile series is replicated to three ingesters, and each ingester writes its own block to the long-term storage.

The read path

Architecture of Grafana Phlare's read path

Queries coming into Grafana Phlare arrive at query-frontend component which is responsible for accelerating queries and dispatching them to the query-scheduler.

The query-scheduler maintains a queue of queries and ensures that each tenant’s queries are fairly executed.

The querier act as workers, pulling queries from the queue in the query-scheduler. The queriers connect to the ingesters to fetch all the data needed to execute a query. For more information about how the query is executed, refer to querier.

Long-term storage

The Grafana Phlare storage format is described in detail in on the block format page. The Grafana Phlare storage format stores each tenant’s profiles into their own on-disk block. Each on-disk block directory contains an index file, a file containing metadata, and the Parquet tables.

Grafana Phlare requires any of the following object stores for the block files:

For more information, refer to configure object storage and configure disk storage.