From 29b10e4f592ec1812971360efd1c10449f8df20f Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Sat, 13 Apr 2024 22:56:53 +0200 Subject: [PATCH 1/5] [wip] adds shard resolution timing to statistics Signed-off-by: Owen Diehl --- pkg/logql/metrics.go | 1 + pkg/logqlmodel/stats/context.go | 15 +-------------- pkg/logqlmodel/stats/stats.proto | 5 +++++ pkg/storage/stores/index/index.go | 8 ++++++++ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pkg/logql/metrics.go b/pkg/logql/metrics.go index e9921a07c2944..d3e4877186d84 100644 --- a/pkg/logql/metrics.go +++ b/pkg/logql/metrics.go @@ -203,6 +203,7 @@ func RecordRangeAndInstantQueryMetrics( "index_total_chunks", stats.Index.TotalChunks, "index_post_bloom_filter_chunks", stats.Index.PostFilterChunks, "index_bloom_filter_ratio", fmt.Sprintf("%.2f", bloomRatio), + "index_shard_resolver_duration", stats.Index.ShardsDuration, }...) logValues = append(logValues, tagsToKeyValues(queryTags)...) diff --git a/pkg/logqlmodel/stats/context.go b/pkg/logqlmodel/stats/context.go index f895f7fc6c9b0..18794fb137fe8 100644 --- a/pkg/logqlmodel/stats/context.go +++ b/pkg/logqlmodel/stats/context.go @@ -116,11 +116,6 @@ func (c *Context) Caches() Caches { } } -// Index returns the index statistics accumulated so far. -func (c *Context) Index() Index { - return c.index -} - // Reset clears the statistics. func (c *Context) Reset() { c.mtx.Lock() @@ -170,15 +165,6 @@ func JoinIngesters(ctx context.Context, inc Ingester) { stats.ingester.Merge(inc) } -// JoinIndex joins the index statistics in a concurrency-safe manner. -func JoinIndex(ctx context.Context, index Index) { - stats := FromContext(ctx) - stats.mtx.Lock() - defer stats.mtx.Unlock() - - stats.index.Merge(index) -} - // ComputeSummary compute the summary of the statistics. func (r *Result) ComputeSummary(execTime time.Duration, queueTime time.Duration, totalEntriesReturned int) { r.Summary.TotalBytesProcessed = r.Querier.Store.Chunk.DecompressedBytes + r.Querier.Store.Chunk.HeadChunkBytes + @@ -247,6 +233,7 @@ func (i *Ingester) Merge(m Ingester) { func (i *Index) Merge(m Index) { i.TotalChunks += m.TotalChunks i.PostFilterChunks += m.PostFilterChunks + i.ShardsDuration += m.ShardsDuration } func (c *Caches) Merge(m Caches) { diff --git a/pkg/logqlmodel/stats/stats.proto b/pkg/logqlmodel/stats/stats.proto index b53747b7941fd..5fcb24d89249e 100644 --- a/pkg/logqlmodel/stats/stats.proto +++ b/pkg/logqlmodel/stats/stats.proto @@ -108,6 +108,11 @@ message Index { int64 totalChunks = 1 [(gogoproto.jsontag) = "totalChunks"]; // Post-filtered chunks int64 postFilterChunks = 2 [(gogoproto.jsontag) = "postFilterChunks"]; + // Nanosecond duration spent fetching shards + int64 shardsDuration = 3 [ + (gogoproto.jsonTag) = "shardsDuration", + (gogoproto.customtype) = "time.Duration" + ]; } message Querier { diff --git a/pkg/storage/stores/index/index.go b/pkg/storage/stores/index/index.go index 26b2a44880047..04d35c40c8fa8 100644 --- a/pkg/storage/stores/index/index.go +++ b/pkg/storage/stores/index/index.go @@ -2,6 +2,7 @@ package index import ( "context" + "time" "github.com/grafana/dskit/instrument" "github.com/prometheus/client_golang/prometheus" @@ -160,7 +161,14 @@ func (m MonitoredReaderWriter) GetShards( var shards *logproto.ShardsResponse if err := loki_instrument.TimeRequest(ctx, "shards", instrument.NewHistogramCollector(m.metrics.indexQueryLatency), instrument.ErrorCode, func(ctx context.Context) error { var err error + start := time.Now() shards, err = m.rw.GetShards(ctx, userID, from, through, targetBytesPerShard, predicate) + + if err == nil { + // record duration here from caller + shards.Statistics.Index.Duration = time.Since(start) + } + return err }); err != nil { return nil, err From 6bb9dd4376f01b7605fcec33fa7b87a71f959cff Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Tue, 16 Apr 2024 09:21:00 -0700 Subject: [PATCH 2/5] stats proto Signed-off-by: Owen Diehl --- pkg/logqlmodel/stats/stats.pb.go | 213 ++++++++++++++++++------------- pkg/logqlmodel/stats/stats.proto | 5 +- 2 files changed, 129 insertions(+), 89 deletions(-) diff --git a/pkg/logqlmodel/stats/stats.pb.go b/pkg/logqlmodel/stats/stats.pb.go index 9a728c1612671..7c7fdd802db65 100644 --- a/pkg/logqlmodel/stats/stats.pb.go +++ b/pkg/logqlmodel/stats/stats.pb.go @@ -13,12 +13,14 @@ import ( math_bits "math/bits" reflect "reflect" strings "strings" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -358,6 +360,8 @@ type Index struct { TotalChunks int64 `protobuf:"varint,1,opt,name=totalChunks,proto3" json:"totalChunks"` // Post-filtered chunks PostFilterChunks int64 `protobuf:"varint,2,opt,name=postFilterChunks,proto3" json:"postFilterChunks"` + // Nanosecond duration spent fetching shards + ShardsDuration time.Duration `protobuf:"varint,3,opt,name=shardsDuration,proto3,customtype=time.Duration" json:"shardsDuration"` } func (m *Index) Reset() { *m = Index{} } @@ -864,92 +868,95 @@ func init() { func init() { proto.RegisterFile("pkg/logqlmodel/stats/stats.proto", fileDescriptor_6cdfe5d2aea33ebb) } var fileDescriptor_6cdfe5d2aea33ebb = []byte{ - // 1358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0xcd, 0x6f, 0xdc, 0x44, - 0x14, 0xdf, 0xcd, 0xd6, 0x9b, 0x74, 0xf2, 0xd5, 0x4e, 0x52, 0xba, 0xa5, 0x95, 0x1d, 0x16, 0x2a, - 0x8a, 0x90, 0xb2, 0x2a, 0x45, 0x42, 0x20, 0x2a, 0x21, 0xa7, 0x44, 0xaa, 0x94, 0x8a, 0xf2, 0x16, - 0x04, 0x82, 0x93, 0x63, 0xbf, 0xec, 0x5a, 0xf5, 0xda, 0x8e, 0x3d, 0x0e, 0x8d, 0x84, 0x04, 0x7f, - 0x02, 0x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- 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x19, 0x80, 0x75, 0xde, 0x18, 0x10, 0x00, 0x00, + // 1395 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0xcf, 0x6f, 0xdc, 0xc4, + 0x17, 0xdf, 0xcd, 0xd6, 0x9b, 0x74, 0xf2, 0xab, 0x9d, 0xa4, 0xdf, 0x6e, 0xbf, 0xad, 0xec, 0xb0, + 0x50, 0xb5, 0x08, 0x29, 0xab, 0x52, 0x24, 0x04, 0xa2, 0x12, 0x72, 0x4a, 0xa4, 0x4a, 0xa9, 0x5a, + 0xde, 0x82, 0x40, 0x70, 0x72, 0xec, 0x97, 0x5d, 0xab, 0x5e, 0xdb, 0xb1, 0xc7, 0xa1, 0x39, 0xc1, + 0x9f, 0xc0, 0x9d, 0x3b, 0xe2, 0xc2, 0x89, 0x13, 0x67, 0x2e, 0xbd, 0x20, 0xf5, 0x58, 0x71, 0xb0, + 0xe8, 0xf6, 0x82, 0x7c, 0xea, 0x1f, 0xc0, 0x01, 0xcd, 0x8f, 0xf5, 0xaf, 0xf5, 0xa6, 0xb9, 0xac, + 0xe7, 0x7d, 0xde, 0xe7, 0xf3, 0x66, 0xfc, 0x3c, 0xf3, 0xde, 0x68, 0xc9, 0x4e, 0xf8, 0x64, 0x34, + 0xf0, 0x82, 0xd1, 0xb1, 0x37, 0x09, 0x1c, 0xf4, 0x06, 0x31, 0xb3, 0x58, 0x2c, 0x7f, 0x77, 0xc3, + 0x28, 0x60, 0x01, 0xd5, 0x84, 0xf1, 0xff, 0xed, 0x51, 0x30, 0x0a, 0x04, 0x32, 0xe0, 0x23, 0xe9, + 0xec, 0xff, 0xbc, 0x44, 0xba, 0x80, 0x71, 0xe2, 0x31, 0xfa, 0x11, 0x59, 0x8e, 0x93, 0xc9, 0xc4, + 0x8a, 0x4e, 0x7b, 0xed, 0x9d, 0xf6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f, 0x19, 0x06, 0xf9, 0x88, 0x27, + 0xd0, 0x29, 0x97, 0xf8, 0xe5, 0xa2, 0x49, 0x96, 0x71, 0xa8, 0x58, 0xfc, 0xbc, 0x89, 0x72, 0x7c, + 0x80, 0xfe, 0x88, 0x8d, 0x87, 0x18, 0x9d, 0xe4, 0xb7, 0x4a, 0x71, 0xde, 0xe6, 0x9c, 0x30, 0x0f, + 0x99, 0xf8, 0xfc, 0xa5, 0xde, 0x7a, 0xf1, 0x52, 0x6f, 0xbd, 0x7e, 0xa9, 0xb7, 0x7f, 0x98, 0xea, + 0xed, 0x5f, 0xa6, 0x7a, 0xfb, 0xd9, 0x54, 0x6f, 0x3f, 0x9f, 0xea, 0xed, 0xbf, 0xa7, 0x7a, 0xfb, + 0x9f, 0xa9, 0xde, 0x7a, 0x3d, 0xd5, 0xdb, 0x3f, 0xbe, 0xd2, 0x5b, 0xcf, 0x5f, 0xe9, 0xad, 0x17, + 0xaf, 0xf4, 0xd6, 0x37, 0x83, 0x91, 0xcb, 0xc6, 0xc9, 0xe1, 0xae, 0x1d, 0x4c, 0x06, 0xa3, 0xc8, + 0x3a, 0xb2, 0x7c, 0x6b, 0xe0, 0x05, 0x4f, 0xdc, 0xc1, 0xc9, 0xdd, 0x41, 0xd3, 0x7f, 0x09, 0x87, + 0x5d, 0xf1, 0x4f, 0xc1, 0xdd, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xb4, 0xfa, 0x42, 0x6a, + 0x10, 0x00, 0x00, } func (this *Result) Equal(that interface{}) bool { @@ -1115,6 +1122,9 @@ func (this *Index) Equal(that interface{}) bool { if this.PostFilterChunks != that1.PostFilterChunks { return false } + if !this.ShardsDuration.Equal(that1.ShardsDuration) { + return false + } return true } func (this *Querier) Equal(that interface{}) bool { @@ -1371,10 +1381,11 @@ func (this *Index) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 6) + s := make([]string, 0, 7) s = append(s, "&stats.Index{") s = append(s, "TotalChunks: "+fmt.Sprintf("%#v", this.TotalChunks)+",\n") s = append(s, "PostFilterChunks: "+fmt.Sprintf("%#v", this.PostFilterChunks)+",\n") + s = append(s, "ShardsDuration: "+fmt.Sprintf("%#v", this.ShardsDuration)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -1743,6 +1754,11 @@ func (m *Index) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ShardsDuration != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ShardsDuration)) + i-- + dAtA[i] = 0x18 + } if m.PostFilterChunks != 0 { i = encodeVarintStats(dAtA, i, uint64(m.PostFilterChunks)) i-- @@ -2158,6 +2174,9 @@ func (m *Index) Size() (n int) { if m.PostFilterChunks != 0 { n += 1 + sovStats(uint64(m.PostFilterChunks)) } + if m.ShardsDuration != 0 { + n += 1 + sovStats(uint64(m.ShardsDuration)) + } return n } @@ -2361,6 +2380,7 @@ func (this *Index) String() string { s := strings.Join([]string{`&Index{`, `TotalChunks:` + fmt.Sprintf("%v", this.TotalChunks) + `,`, `PostFilterChunks:` + fmt.Sprintf("%v", this.PostFilterChunks) + `,`, + `ShardsDuration:` + fmt.Sprintf("%v", this.ShardsDuration) + `,`, `}`, }, "") return s @@ -3316,6 +3336,25 @@ func (m *Index) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardsDuration", wireType) + } + m.ShardsDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ShardsDuration |= time.Duration(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipStats(dAtA[iNdEx:]) diff --git a/pkg/logqlmodel/stats/stats.proto b/pkg/logqlmodel/stats/stats.proto index 5fcb24d89249e..7e530effb6451 100644 --- a/pkg/logqlmodel/stats/stats.proto +++ b/pkg/logqlmodel/stats/stats.proto @@ -110,8 +110,9 @@ message Index { int64 postFilterChunks = 2 [(gogoproto.jsontag) = "postFilterChunks"]; // Nanosecond duration spent fetching shards int64 shardsDuration = 3 [ - (gogoproto.jsonTag) = "shardsDuration", - (gogoproto.customtype) = "time.Duration" + (gogoproto.jsontag) = "shardsDuration", + (gogoproto.customtype) = "time.Duration", + (gogoproto.nullable) = false ]; } From e95febd6e6515f1e3e943ac3694ea2252520aba5 Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Tue, 16 Apr 2024 09:39:04 -0700 Subject: [PATCH 3/5] record shards duration Signed-off-by: Owen Diehl --- pkg/storage/stores/index/index.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/storage/stores/index/index.go b/pkg/storage/stores/index/index.go index 04d35c40c8fa8..7c5e55b8e6e43 100644 --- a/pkg/storage/stores/index/index.go +++ b/pkg/storage/stores/index/index.go @@ -165,8 +165,12 @@ func (m MonitoredReaderWriter) GetShards( shards, err = m.rw.GetShards(ctx, userID, from, through, targetBytesPerShard, predicate) if err == nil { - // record duration here from caller - shards.Statistics.Index.Duration = time.Since(start) + // record duration here from caller to avoid needing to do this in two separate places: + // 1) when we resolve shards from the index alone + // 2) when we resolve shards from the index + blooms + // NB(owen-d): since this is measured by the callee, it does not include time in queue, + // over the wire, etc. + shards.Statistics.Index.ShardsDuration = time.Since(start) } return err From 9fb6ce0f1d24f3d6661cc98662a8a02193ef0828 Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Tue, 16 Apr 2024 09:56:50 -0700 Subject: [PATCH 4/5] dont use time.Duration which doesnt have Equal() method in proto Signed-off-by: Owen Diehl --- pkg/logql/metrics.go | 2 +- pkg/logqlmodel/stats/stats.pb.go | 192 +++++++++++++++--------------- pkg/logqlmodel/stats/stats.proto | 6 +- pkg/storage/stores/index/index.go | 2 +- 4 files changed, 101 insertions(+), 101 deletions(-) diff --git a/pkg/logql/metrics.go b/pkg/logql/metrics.go index d3e4877186d84..ed8405fc4e6e7 100644 --- a/pkg/logql/metrics.go +++ b/pkg/logql/metrics.go @@ -203,7 +203,7 @@ func RecordRangeAndInstantQueryMetrics( "index_total_chunks", stats.Index.TotalChunks, "index_post_bloom_filter_chunks", stats.Index.PostFilterChunks, "index_bloom_filter_ratio", fmt.Sprintf("%.2f", bloomRatio), - "index_shard_resolver_duration", stats.Index.ShardsDuration, + "index_shard_resolver_duration", time.Duration(stats.Index.ShardsDuration), }...) logValues = append(logValues, tagsToKeyValues(queryTags)...) diff --git a/pkg/logqlmodel/stats/stats.pb.go b/pkg/logqlmodel/stats/stats.pb.go index 7c7fdd802db65..432cd55a7703d 100644 --- a/pkg/logqlmodel/stats/stats.pb.go +++ b/pkg/logqlmodel/stats/stats.pb.go @@ -13,14 +13,12 @@ import ( math_bits "math/bits" reflect "reflect" strings "strings" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf -var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -361,7 +359,7 @@ type Index struct { // Post-filtered chunks PostFilterChunks int64 `protobuf:"varint,2,opt,name=postFilterChunks,proto3" json:"postFilterChunks"` // Nanosecond duration spent fetching shards - ShardsDuration time.Duration `protobuf:"varint,3,opt,name=shardsDuration,proto3,customtype=time.Duration" json:"shardsDuration"` + ShardsDuration int64 `protobuf:"varint,3,opt,name=shardsDuration,proto3" json:"shardsDuration"` } func (m *Index) Reset() { *m = Index{} } @@ -410,6 +408,13 @@ func (m *Index) GetPostFilterChunks() int64 { return 0 } +func (m *Index) GetShardsDuration() int64 { + if m != nil { + return m.ShardsDuration + } + return 0 +} + type Querier struct { Store Store `protobuf:"bytes,1,opt,name=store,proto3" json:"store"` } @@ -868,95 +873,94 @@ func init() { func init() { proto.RegisterFile("pkg/logqlmodel/stats/stats.proto", fileDescriptor_6cdfe5d2aea33ebb) } var fileDescriptor_6cdfe5d2aea33ebb = []byte{ - // 1395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0xcf, 0x6f, 0xdc, 0xc4, - 0x17, 0xdf, 0xcd, 0xd6, 0x9b, 0x74, 0xf2, 0xab, 0x9d, 0xa4, 0xdf, 0x6e, 0xbf, 0xad, 0xec, 0xb0, - 0x50, 0xb5, 0x08, 0x29, 0xab, 0x52, 0x24, 0x04, 0xa2, 0x12, 0x72, 0x4a, 0xa4, 0x4a, 0xa9, 0x5a, - 0xde, 0x82, 0x40, 0x70, 0x72, 0xec, 0x97, 0x5d, 0xab, 0x5e, 0xdb, 0xb1, 0xc7, 0xa1, 0x39, 0xc1, - 0x9f, 0xc0, 0x9d, 0x3b, 0xe2, 0xc2, 0x89, 0x13, 0x67, 0x2e, 0xbd, 0x20, 0xf5, 0x58, 0x71, 0xb0, - 0xe8, 0xf6, 0x82, 0x7c, 0xea, 0x1f, 0xc0, 0x01, 0xcd, 0x8f, 0xf5, 0xaf, 0xf5, 0xa6, 0xb9, 0xac, - 0xe7, 0x7d, 0xde, 0xe7, 0xf3, 0x66, 0xfc, 0x3c, 0xf3, 0xde, 0x68, 0xc9, 0x4e, 0xf8, 0x64, 0x34, - 0xf0, 0x82, 0xd1, 0xb1, 0x37, 0x09, 0x1c, 0xf4, 0x06, 0x31, 0xb3, 0x58, 0x2c, 0x7f, 0x77, 0xc3, - 0x28, 0x60, 0x01, 0xd5, 0x84, 0xf1, 0xff, 0xed, 0x51, 0x30, 0x0a, 0x04, 0x32, 0xe0, 0x23, 0xe9, - 0xec, 0xff, 0xbc, 0x44, 0xba, 0x80, 0x71, 0xe2, 0x31, 0xfa, 0x11, 0x59, 0x8e, 0x93, 0xc9, 0xc4, - 0x8a, 0x4e, 0x7b, 0xed, 0x9d, 0xf6, 0xed, 0xd5, 0xf7, 0x37, 0x76, 0x65, 0x98, 0xa1, 0x44, 0xcd, - 0xcd, 0x67, 0xa9, 0x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71, 0xa8, 0x58, 0xfc, 0xbc, 0x89, 0x72, 0x7c, - 0x80, 0xfe, 0x88, 0x8d, 0x87, 0x18, 0x9d, 0xe4, 0xb7, 0x4a, 0x71, 0xde, 0xe6, 0x9c, 0x30, 0x0f, - 0x99, 0xf8, 0xfc, 0xa5, 0xde, 0x7a, 0xf1, 0x52, 0x6f, 0xbd, 0x7e, 0xa9, 0xb7, 0x7f, 0x98, 0xea, - 0xed, 0x5f, 0xa6, 0x7a, 0xfb, 0xd9, 0x54, 0x6f, 0x3f, 0x9f, 0xea, 0xed, 0xbf, 0xa7, 0x7a, 0xfb, - 0x9f, 0xa9, 0xde, 0x7a, 0x3d, 0xd5, 0xdb, 0x3f, 0xbe, 0xd2, 0x5b, 0xcf, 0x5f, 0xe9, 0xad, 0x17, - 0xaf, 0xf4, 0xd6, 0x37, 0x83, 0x91, 0xcb, 0xc6, 0xc9, 0xe1, 0xae, 0x1d, 0x4c, 0x06, 0xa3, 0xc8, - 0x3a, 0xb2, 0x7c, 0x6b, 0xe0, 0x05, 0x4f, 0xdc, 0xc1, 0xc9, 0xdd, 0x41, 0xd3, 0x7f, 0x09, 0x87, - 0x5d, 0xf1, 0x4f, 0xc1, 0xdd, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xb4, 0xfa, 0x42, 0x6a, - 0x10, 0x00, 0x00, + // 1378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xde, 0xcd, 0xd6, 0x9b, 0x74, 0xf2, 0xab, 0x9d, 0xa4, 0x74, 0x4b, 0x2b, 0x3b, 0x2c, 0x54, + 0x14, 0x21, 0x65, 0x55, 0x8a, 0x84, 0x40, 0x54, 0x42, 0x4e, 0x89, 0x54, 0x29, 0x15, 0xe5, 0x2d, + 0x08, 0x04, 0x27, 0xc7, 0x9e, 0xec, 0x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a, 0xeb, 0xbb, 0xc1, 0xc8, 0xe5, 0xe3, 0xe4, 0x70, 0xd7, 0x0e, 0x26, 0x83, 0x51, 0x64, 0x1d, + 0x59, 0xbe, 0x35, 0xf0, 0x82, 0x27, 0xee, 0xe0, 0xe4, 0xde, 0xa0, 0xe9, 0x6f, 0x83, 0xc3, 0x2e, + 0xfe, 0x29, 0x70, 0xef, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x64, 0x90, 0x88, 0xaf, 0x55, 0x10, + 0x00, 0x00, } func (this *Result) Equal(that interface{}) bool { @@ -1122,7 +1126,7 @@ func (this *Index) Equal(that interface{}) bool { if this.PostFilterChunks != that1.PostFilterChunks { return false } - if !this.ShardsDuration.Equal(that1.ShardsDuration) { + if this.ShardsDuration != that1.ShardsDuration { return false } return true @@ -3350,7 +3354,7 @@ func (m *Index) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ShardsDuration |= time.Duration(b&0x7F) << shift + m.ShardsDuration |= int64(b&0x7F) << shift if b < 0x80 { break } diff --git a/pkg/logqlmodel/stats/stats.proto b/pkg/logqlmodel/stats/stats.proto index 7e530effb6451..0b48078e9e932 100644 --- a/pkg/logqlmodel/stats/stats.proto +++ b/pkg/logqlmodel/stats/stats.proto @@ -109,11 +109,7 @@ message Index { // Post-filtered chunks int64 postFilterChunks = 2 [(gogoproto.jsontag) = "postFilterChunks"]; // Nanosecond duration spent fetching shards - int64 shardsDuration = 3 [ - (gogoproto.jsontag) = "shardsDuration", - (gogoproto.customtype) = "time.Duration", - (gogoproto.nullable) = false - ]; + int64 shardsDuration = 3 [(gogoproto.jsontag) = "shardsDuration"]; } message Querier { diff --git a/pkg/storage/stores/index/index.go b/pkg/storage/stores/index/index.go index 7c5e55b8e6e43..99e5b35978837 100644 --- a/pkg/storage/stores/index/index.go +++ b/pkg/storage/stores/index/index.go @@ -170,7 +170,7 @@ func (m MonitoredReaderWriter) GetShards( // 2) when we resolve shards from the index + blooms // NB(owen-d): since this is measured by the callee, it does not include time in queue, // over the wire, etc. - shards.Statistics.Index.ShardsDuration = time.Since(start) + shards.Statistics.Index.ShardsDuration = int64(time.Since(start)) } return err From c496daf56c1be4ba24068b0cc59dc36f7835c27d Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Tue, 16 Apr 2024 10:22:01 -0700 Subject: [PATCH 5/5] populate golden tests with new field Signed-off-by: Owen Diehl --- pkg/querier/queryrange/codec_test.go | 3 ++- pkg/querier/queryrange/prometheus_test.go | 3 ++- pkg/util/marshal/legacy/marshal_test.go | 3 ++- pkg/util/marshal/marshal_test.go | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/querier/queryrange/codec_test.go b/pkg/querier/queryrange/codec_test.go index b334ab5b06918..273750f71364d 100644 --- a/pkg/querier/queryrange/codec_test.go +++ b/pkg/querier/queryrange/codec_test.go @@ -1691,7 +1691,8 @@ var ( }, "index": { "postFilterChunks": 0, - "totalChunks": 0 + "totalChunks": 0, + "shardsDuration": 0 }, "cache": { "chunk": { diff --git a/pkg/querier/queryrange/prometheus_test.go b/pkg/querier/queryrange/prometheus_test.go index 9d47be945b561..2888fbfdd6ace 100644 --- a/pkg/querier/queryrange/prometheus_test.go +++ b/pkg/querier/queryrange/prometheus_test.go @@ -15,7 +15,8 @@ import ( var emptyStats = `"stats": { "index": { "postFilterChunks": 0, - "totalChunks": 0 + "totalChunks": 0, + "shardsDuration": 0 }, "ingester" : { "store": { diff --git a/pkg/util/marshal/legacy/marshal_test.go b/pkg/util/marshal/legacy/marshal_test.go index b535a390479f9..90fdef6281edc 100644 --- a/pkg/util/marshal/legacy/marshal_test.go +++ b/pkg/util/marshal/legacy/marshal_test.go @@ -58,7 +58,8 @@ var queryTests = []struct { "stats" : { "index": { "postFilterChunks": 0, - "totalChunks": 0 + "totalChunks": 0, + "shardsDuration": 0 }, "ingester" : { "store": { diff --git a/pkg/util/marshal/marshal_test.go b/pkg/util/marshal/marshal_test.go index 1ccbe2158dfc5..c749677f77026 100644 --- a/pkg/util/marshal/marshal_test.go +++ b/pkg/util/marshal/marshal_test.go @@ -27,7 +27,8 @@ import ( const emptyStats = `{ "index": { "postFilterChunks": 0, - "totalChunks": 0 + "totalChunks": 0, + "shardsDuration": 0 }, "ingester" : { "store": {