Documentation ¶
Index ¶
- func GetShuffleShardingSubring(ring ring.ReadRing, userID string, limits StoreGatewayLimits) ring.ReadRing
- func NewGRPCHandler(svc querierv1connect.QuerierServiceHandler) connectgrpc.GRPCHandler
- func NewGRPCRoundTripper(transport connectgrpc.GRPCRoundTripper) querierv1connect.QuerierServiceHandler
- func NewMergeIterator[R any, Req Request, Res Response](ctx context.Context, r ResponseFromReplica[BidiClientMerge[Req, Res]]) *mergeIterator[R, Req, Res]
- type BidiClientMerge
- type ClientFactory
- type Closer
- type Config
- type IngesterQuerier
- type IngesterQueryClient
- type MergeIterator
- type MergeResult
- type ProfileValue
- type ProfileWithLabels
- type Querier
- func (q *Querier) Diff(ctx context.Context, req *connect.Request[querierv1.DiffRequest]) (*connect.Response[querierv1.DiffResponse], error)
- func (q *Querier) LabelNames(ctx context.Context, req *connect.Request[typesv1.LabelNamesRequest]) (*connect.Response[typesv1.LabelNamesResponse], error)
- func (q *Querier) LabelValues(ctx context.Context, req *connect.Request[typesv1.LabelValuesRequest]) (*connect.Response[typesv1.LabelValuesResponse], error)
- func (q *Querier) ProfileTypes(ctx context.Context, req *connect.Request[querierv1.ProfileTypesRequest]) (*connect.Response[querierv1.ProfileTypesResponse], error)
- func (q *Querier) SelectMergeProfile(ctx context.Context, req *connect.Request[querierv1.SelectMergeProfileRequest]) (*connect.Response[googlev1.Profile], error)
- func (q *Querier) SelectMergeStacktraces(ctx context.Context, ...) (*connect.Response[querierv1.SelectMergeStacktracesResponse], error)
- func (q *Querier) SelectSeries(ctx context.Context, req *connect.Request[querierv1.SelectSeriesRequest]) (*connect.Response[querierv1.SelectSeriesResponse], error)
- func (q *Querier) Series(ctx context.Context, req *connect.Request[querierv1.SeriesRequest]) (*connect.Response[querierv1.SeriesResponse], error)
- type QueryHandlers
- type QueryReplicaFn
- type Request
- type Response
- type ResponseFromReplica
- type StoreGatewayLimits
- type StoreGatewayQuerier
- type StoreGatewayQueryClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetShuffleShardingSubring ¶
func GetShuffleShardingSubring(ring ring.ReadRing, userID string, limits StoreGatewayLimits) ring.ReadRing
GetShuffleShardingSubring returns the subring to be used for a given user. This function should be used both by store-gateway and querier in order to guarantee the same logic is used.
func NewGRPCHandler ¶
func NewGRPCHandler(svc querierv1connect.QuerierServiceHandler) connectgrpc.GRPCHandler
func NewGRPCRoundTripper ¶
func NewGRPCRoundTripper(transport connectgrpc.GRPCRoundTripper) querierv1connect.QuerierServiceHandler
func NewMergeIterator ¶
func NewMergeIterator[ R any, Req Request, Res Response, ](ctx context.Context, r ResponseFromReplica[BidiClientMerge[Req, Res]], ) *mergeIterator[R, Req, Res]
NewMergeIterator return a new iterator that stream profiles and allows to filter them using `Keep` to keep only a subset of the profiles for an aggregation result. Merging or querying profiles sample values is expensive, we only merge the sample of the profiles that are kept. On creating the iterator, we send a request to ingesters to fetch the first batch.
Types ¶
type BidiClientMerge ¶
type ClientFactory ¶
type Config ¶
type Config struct { PoolConfig clientpool.PoolConfig `yaml:"pool_config,omitempty"` QueryStoreAfter time.Duration `yaml:"query_store_after" category:"advanced"` }
func (*Config) RegisterFlags ¶
RegisterFlags registers distributor-related flags.
type IngesterQuerier ¶
type IngesterQuerier struct {
// contains filtered or unexported fields
}
IngesterQuerier helps with querying the ingesters.
func NewIngesterQuerier ¶
func NewIngesterQuerier(pool *ring_client.Pool, ring ring.ReadRing) *IngesterQuerier
type IngesterQueryClient ¶
type IngesterQueryClient interface { LabelValues(context.Context, *connect.Request[typesv1.LabelValuesRequest]) (*connect.Response[typesv1.LabelValuesResponse], error) LabelNames(context.Context, *connect.Request[typesv1.LabelNamesRequest]) (*connect.Response[typesv1.LabelNamesResponse], error) ProfileTypes(context.Context, *connect.Request[ingestv1.ProfileTypesRequest]) (*connect.Response[ingestv1.ProfileTypesResponse], error) Series(ctx context.Context, req *connect.Request[ingestv1.SeriesRequest]) (*connect.Response[ingestv1.SeriesResponse], error) MergeProfilesStacktraces(context.Context) clientpool.BidiClientMergeProfilesStacktraces MergeProfilesLabels(ctx context.Context) clientpool.BidiClientMergeProfilesLabels MergeProfilesPprof(ctx context.Context) clientpool.BidiClientMergeProfilesPprof }
type MergeIterator ¶
type MergeIterator interface { iter.Iterator[*ProfileWithLabels] Keep() }
type MergeResult ¶
type ProfileValue ¶
func (ProfileValue) Labels ¶
func (p ProfileValue) Labels() phlaremodel.Labels
func (ProfileValue) Timestamp ¶
func (p ProfileValue) Timestamp() model.Time
type ProfileWithLabels ¶
type ProfileWithLabels struct { Timestamp int64 phlaremodel.Labels IngesterAddr string }
type Querier ¶
func New ¶
func New(cfg Config, ingestersRing ring.ReadRing, factory ring_client.PoolFactory, storeGatewayQuerier *StoreGatewayQuerier, reg prometheus.Registerer, logger log.Logger, clientsOptions ...connect.ClientOption) (*Querier, error)
func (*Querier) Diff ¶
func (q *Querier) Diff(ctx context.Context, req *connect.Request[querierv1.DiffRequest]) (*connect.Response[querierv1.DiffResponse], error)
func (*Querier) LabelNames ¶
func (q *Querier) LabelNames(ctx context.Context, req *connect.Request[typesv1.LabelNamesRequest]) (*connect.Response[typesv1.LabelNamesResponse], error)
func (*Querier) LabelValues ¶
func (q *Querier) LabelValues(ctx context.Context, req *connect.Request[typesv1.LabelValuesRequest]) (*connect.Response[typesv1.LabelValuesResponse], error)
func (*Querier) ProfileTypes ¶
func (q *Querier) ProfileTypes(ctx context.Context, req *connect.Request[querierv1.ProfileTypesRequest]) (*connect.Response[querierv1.ProfileTypesResponse], error)
func (*Querier) SelectMergeProfile ¶
func (*Querier) SelectMergeStacktraces ¶
func (q *Querier) SelectMergeStacktraces(ctx context.Context, req *connect.Request[querierv1.SelectMergeStacktracesRequest]) (*connect.Response[querierv1.SelectMergeStacktracesResponse], error)
func (*Querier) SelectSeries ¶
func (q *Querier) SelectSeries(ctx context.Context, req *connect.Request[querierv1.SelectSeriesRequest]) (*connect.Response[querierv1.SelectSeriesResponse], error)
func (*Querier) Series ¶
func (q *Querier) Series(ctx context.Context, req *connect.Request[querierv1.SeriesRequest]) (*connect.Response[querierv1.SeriesResponse], error)
type QueryHandlers ¶
type QueryHandlers struct {
// contains filtered or unexported fields
}
func NewHTTPHandlers ¶
func NewHTTPHandlers(client querierv1connect.QuerierServiceClient) *QueryHandlers
func (*QueryHandlers) LabelValues ¶
func (q *QueryHandlers) LabelValues(w http.ResponseWriter, req *http.Request)
LabelValues only returns the label values for the given label name. This is mostly for fulfilling the pyroscope API and won't be used in the future. For example, /label-values?label=__name__ will return all the profile types.
func (*QueryHandlers) Render ¶
func (q *QueryHandlers) Render(w http.ResponseWriter, req *http.Request)
func (*QueryHandlers) RenderDiff ¶
func (q *QueryHandlers) RenderDiff(w http.ResponseWriter, req *http.Request)
type QueryReplicaFn ¶
type Request ¶
type Request interface { *ingestv1.MergeProfilesStacktracesRequest | *ingestv1.MergeProfilesLabelsRequest | *ingestv1.MergeProfilesPprofRequest }
type Response ¶
type Response interface { *ingestv1.MergeProfilesStacktracesResponse | *ingestv1.MergeProfilesLabelsResponse | *ingestv1.MergeProfilesPprofResponse }
type ResponseFromReplica ¶
type ResponseFromReplica[T any] struct { // contains filtered or unexported fields }
type StoreGatewayLimits ¶
type StoreGatewayQuerier ¶
func NewStoreGatewayQuerier ¶
func NewStoreGatewayQuerier( gatewayCfg storegateway.Config, factory ring_client.PoolFactory, limits StoreGatewayLimits, logger log.Logger, reg prometheus.Registerer, clientsOptions ...connect.ClientOption, ) (*StoreGatewayQuerier, error)
type StoreGatewayQueryClient ¶
type StoreGatewayQueryClient interface { MergeProfilesStacktraces(context.Context) clientpool.BidiClientMergeProfilesStacktraces MergeProfilesLabels(ctx context.Context) clientpool.BidiClientMergeProfilesLabels MergeProfilesPprof(ctx context.Context) clientpool.BidiClientMergeProfilesPprof Series(context.Context, *connect.Request[ingestv1.SeriesRequest]) (*connect.Response[ingestv1.SeriesResponse], error) }