Skip to content

Commit edc19be

Browse files
committed
dont use time.Duration which doesnt have Equal() method in proto
Signed-off-by: Owen Diehl <[email protected]>
1 parent 2292b40 commit edc19be

File tree

4 files changed

+101
-101
lines changed

4 files changed

+101
-101
lines changed

pkg/logql/metrics.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func RecordRangeAndInstantQueryMetrics(
203203
"index_total_chunks", stats.Index.TotalChunks,
204204
"index_post_bloom_filter_chunks", stats.Index.PostFilterChunks,
205205
"index_bloom_filter_ratio", fmt.Sprintf("%.2f", bloomRatio),
206-
"index_shard_resolver_duration", stats.Index.ShardsDuration,
206+
"index_shard_resolver_duration", time.Duration(stats.Index.ShardsDuration),
207207
}...)
208208

209209
logValues = append(logValues, tagsToKeyValues(queryTags)...)

pkg/logqlmodel/stats/stats.pb.go

+98-94
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/logqlmodel/stats/stats.proto

+1-5
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,7 @@ message Index {
109109
// Post-filtered chunks
110110
int64 postFilterChunks = 2 [(gogoproto.jsontag) = "postFilterChunks"];
111111
// Nanosecond duration spent fetching shards
112-
int64 shardsDuration = 3 [
113-
(gogoproto.jsontag) = "shardsDuration",
114-
(gogoproto.customtype) = "time.Duration",
115-
(gogoproto.nullable) = false
116-
];
112+
int64 shardsDuration = 3 [(gogoproto.jsontag) = "shardsDuration"];
117113
}
118114

119115
message Querier {

pkg/storage/stores/index/index.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (m MonitoredReaderWriter) GetShards(
170170
// 2) when we resolve shards from the index + blooms
171171
// NB(owen-d): since this is measured by the callee, it does not include time in queue,
172172
// over the wire, etc.
173-
shards.Statistics.Index.ShardsDuration = time.Since(start)
173+
shards.Statistics.Index.ShardsDuration = int64(time.Since(start))
174174
}
175175

176176
return err

0 commit comments

Comments
 (0)