docs/sources/reference-pyroscope-v2-architecture/components/distributor.md
The distributor is a stateless component that serves as the entry point for the ingestion path. It receives profiling data from agents and routes it to segment-writers for storage.
Unlike v1 where profiles are routed to ingesters based on hash ring token distribution, the v2 distributor routes profiles to segment-writers based on the profile's service_name label. This co-location strategy ensures that profiles from the same application are stored together, which is crucial for:
The distributor uses a three-step process to determine where to place a profile:
tenant_id.service_name label.This algorithm balances data locality with even distribution across the cluster.
For detailed information about the distribution algorithm, refer to Data distribution.
The distributor cleans and validates data before sending it to segment-writers:
If a request contains invalid data, the distributor returns a 400 HTTP status code with details in the response body.
Randomly load balance write requests across distributor instances. If you're running Pyroscope in a Kubernetes cluster, you can define a Kubernetes Service as ingress for the distributors.
The distributor discovers segment-writers through memberlist-based ring discovery, which maintains the list of available segment-writer instances.
The distributor is completely stateless and disk-less: