Documentation ¶
Index ¶
- Constants
- Variables
- func IsEnabled(ctx context.Context) bool
- func ShouldTrackHTTPGRPCResponse(r *httpgrpc.HTTPResponse) bool
- type QueryMetrics
- type Stats
- func (s *Stats) AddEncodeTime(t time.Duration)
- func (s *Stats) AddEstimatedSeriesCount(c uint64)
- func (s *Stats) AddFetchedChunkBytes(bytes uint64)
- func (s *Stats) AddFetchedChunks(chunks uint64)
- func (s *Stats) AddFetchedIndexBytes(indexBytes uint64)
- func (s *Stats) AddFetchedSeries(series uint64)
- func (s *Stats) AddQueueTime(t time.Duration)
- func (s *Stats) AddSamplesProcessed(c uint64)
- func (s *Stats) AddShardedQueries(num uint32)
- func (s *Stats) AddSplitQueries(num uint32)
- func (s *Stats) AddWallTime(t time.Duration)
- func (s *Stats) Copy() *Stats
- func (*Stats) Descriptor() ([]byte, []int)
- func (this *Stats) Equal(that interface{}) bool
- func (m *Stats) GetEncodeTime() time.Duration
- func (m *Stats) GetEstimatedSeriesCount() uint64
- func (m *Stats) GetFetchedChunkBytes() uint64
- func (m *Stats) GetFetchedChunksCount() uint64
- func (m *Stats) GetFetchedIndexBytes() uint64
- func (m *Stats) GetFetchedSeriesCount() uint64
- func (m *Stats) GetQueueTime() time.Duration
- func (m *Stats) GetSamplesProcessed() uint64
- func (m *Stats) GetShardedQueries() uint32
- func (m *Stats) GetSplitQueries() uint32
- func (m *Stats) GetWallTime() time.Duration
- func (this *Stats) GoString() string
- func (s *Stats) LoadEncodeTime() time.Duration
- func (s *Stats) LoadEstimatedSeriesCount() uint64
- func (s *Stats) LoadFetchedChunkBytes() uint64
- func (s *Stats) LoadFetchedChunks() uint64
- func (s *Stats) LoadFetchedIndexBytes() uint64
- func (s *Stats) LoadFetchedSeries() uint64
- func (s *Stats) LoadQueueTime() time.Duration
- func (s *Stats) LoadSamplesProcessed() uint64
- func (s *Stats) LoadShardedQueries() uint32
- func (s *Stats) LoadSplitQueries() uint32
- func (s *Stats) LoadWallTime() time.Duration
- func (m *Stats) Marshal() (dAtA []byte, err error)
- func (m *Stats) MarshalTo(dAtA []byte) (int, error)
- func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (s *Stats) Merge(other *Stats)
- func (*Stats) ProtoMessage()
- func (m *Stats) Reset()
- func (m *Stats) Size() (n int)
- func (this *Stats) String() string
- func (m *Stats) Unmarshal(dAtA []byte) error
- func (m *Stats) XXX_DiscardUnknown()
- func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Stats) XXX_Merge(src proto.Message)
- func (m *Stats) XXX_Size() int
- func (m *Stats) XXX_Unmarshal(b []byte) error
- type WallTimeMiddleware
Constants ¶
View Source
const ( RejectReasonMaxSeries = "max-fetched-series-per-query" RejectReasonMaxChunkBytes = "max-fetched-chunk-bytes-per-query" RejectReasonMaxChunks = "max-fetched-chunks-per-query" RejectReasonMaxEstimatedChunks = "max-estimated-fetched-chunks-per-query" RejectReasonMaxEstimatedQueryMemoryConsumption = "max-estimated-memory-consumption-per-query" )
Variables ¶
View Source
var ( ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") )
Functions ¶
func ShouldTrackHTTPGRPCResponse ¶
func ShouldTrackHTTPGRPCResponse(r *httpgrpc.HTTPResponse) bool
Types ¶
type QueryMetrics ¶
type QueryMetrics struct { // The number of chunks received from ingesters that were exact duplicates of chunks received from other ingesters // responding to the same query. IngesterChunksDeduplicated prometheus.Counter // The total number of chunks received from ingesters that were used to evaluate queries, including any chunks // discarded due to deduplication. IngesterChunksTotal prometheus.Counter // The total number of queries that were rejected for some reason. QueriesRejectedTotal *prometheus.CounterVec // The total number of queries executed against a particular source QueriesExecutedTotal *prometheus.CounterVec }
QueryMetrics collects metrics on the number of chunks used while serving queries.
func NewQueryMetrics ¶
func NewQueryMetrics(reg prometheus.Registerer) *QueryMetrics
type Stats ¶
type Stats struct { // The sum of all wall time spent in the querier to execute the query. WallTime time.Duration `protobuf:"bytes,1,opt,name=wall_time,json=wallTime,proto3,stdduration" json:"wall_time"` // The number of series fetched for the query FetchedSeriesCount uint64 `protobuf:"varint,2,opt,name=fetched_series_count,json=fetchedSeriesCount,proto3" json:"fetched_series_count,omitempty"` // The number of bytes of the chunks fetched for the query, after any deduplication FetchedChunkBytes uint64 `protobuf:"varint,3,opt,name=fetched_chunk_bytes,json=fetchedChunkBytes,proto3" json:"fetched_chunk_bytes,omitempty"` // The number of chunks fetched for the query, after any deduplication FetchedChunksCount uint64 `protobuf:"varint,4,opt,name=fetched_chunks_count,json=fetchedChunksCount,proto3" json:"fetched_chunks_count,omitempty"` // The number of sharded queries executed. 0 if sharding is disabled or the query can't be sharded. ShardedQueries uint32 `protobuf:"varint,5,opt,name=sharded_queries,json=shardedQueries,proto3" json:"sharded_queries,omitempty"` // The number of split partial queries executed. 0 if splitting is disabled or the query can't be split. SplitQueries uint32 `protobuf:"varint,6,opt,name=split_queries,json=splitQueries,proto3" json:"split_queries,omitempty"` // The number of index bytes fetched on the store-gateway for the query FetchedIndexBytes uint64 `protobuf:"varint,7,opt,name=fetched_index_bytes,json=fetchedIndexBytes,proto3" json:"fetched_index_bytes,omitempty"` // The estimated number of series to be fetched for the query EstimatedSeriesCount uint64 `protobuf:"varint,8,opt,name=estimated_series_count,json=estimatedSeriesCount,proto3" json:"estimated_series_count,omitempty"` // The sum of durations that the query spent in the queue, before it was handled by querier. QueueTime time.Duration `protobuf:"bytes,9,opt,name=queue_time,json=queueTime,proto3,stdduration" json:"queue_time"` // The time spent at the frontend encoding the query's final results. Does not include time spent serializing results at the querier. EncodeTime time.Duration `protobuf:"bytes,10,opt,name=encode_time,json=encodeTime,proto3,stdduration" json:"encode_time"` // TotalSamples represents the total number of samples scanned while evaluating a query. SamplesProcessed uint64 `protobuf:"varint,11,opt,name=samples_processed,json=samplesProcessed,proto3" json:"samples_processed,omitempty"` }
func ContextWithEmptyStats ¶
ContextWithEmptyStats returns a context with empty stats.
func FromContext ¶
FromContext gets the Stats out of the Context. Returns nil if stats have not been initialised in the context.
func (*Stats) AddEncodeTime ¶
func (*Stats) AddEstimatedSeriesCount ¶
func (*Stats) AddFetchedChunkBytes ¶
func (*Stats) AddFetchedChunks ¶
func (*Stats) AddFetchedIndexBytes ¶
func (*Stats) AddFetchedSeries ¶
func (*Stats) AddQueueTime ¶
func (*Stats) AddSamplesProcessed ¶
func (*Stats) AddShardedQueries ¶
func (*Stats) AddSplitQueries ¶
func (*Stats) AddWallTime ¶
AddWallTime adds some time to the counter.
func (*Stats) Copy ¶
Copy returns a copy of the stats. Use this rather than regular struct assignment to make sure atomic modifications are observed.
func (*Stats) Descriptor ¶
func (*Stats) GetEncodeTime ¶
func (*Stats) GetEstimatedSeriesCount ¶
func (*Stats) GetFetchedChunkBytes ¶
func (*Stats) GetFetchedChunksCount ¶
func (*Stats) GetFetchedIndexBytes ¶
func (*Stats) GetFetchedSeriesCount ¶
func (*Stats) GetQueueTime ¶
func (*Stats) GetSamplesProcessed ¶
func (*Stats) GetShardedQueries ¶
func (*Stats) GetSplitQueries ¶
func (*Stats) GetWallTime ¶
func (*Stats) LoadEncodeTime ¶
func (*Stats) LoadEstimatedSeriesCount ¶
func (*Stats) LoadFetchedChunkBytes ¶
func (*Stats) LoadFetchedChunks ¶
func (*Stats) LoadFetchedIndexBytes ¶
func (*Stats) LoadFetchedSeries ¶
func (*Stats) LoadQueueTime ¶
func (*Stats) LoadSamplesProcessed ¶
func (*Stats) LoadShardedQueries ¶
func (*Stats) LoadSplitQueries ¶
func (*Stats) LoadWallTime ¶
LoadWallTime returns current wall time.
func (*Stats) ProtoMessage ¶
func (*Stats) ProtoMessage()
func (*Stats) XXX_DiscardUnknown ¶
func (m *Stats) XXX_DiscardUnknown()
func (*Stats) XXX_Marshal ¶
func (*Stats) XXX_Unmarshal ¶
type WallTimeMiddleware ¶
type WallTimeMiddleware struct{}
WallTimeMiddleware tracks the wall time.
func NewWallTimeMiddleware ¶
func NewWallTimeMiddleware() WallTimeMiddleware
NewWallTimeMiddleware makes a new WallTimeMiddleware.
Click to show internal directories.
Click to hide internal directories.