From 0e97b99d6a1bd6acb8e5d60d25e4020a224991a3 Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 2 Oct 2024 16:29:08 -0600 Subject: [PATCH] feat: aggregated metric volume queries --- pkg/loghttp/query.go | 61 ++- pkg/loghttp/query_test.go | 95 +++- pkg/logproto/logproto.pb.go | 411 ++++++++++-------- pkg/logproto/logproto.proto | 1 + pkg/loki/modules.go | 6 + pkg/querier/queryrange/codec.go | 30 +- .../queryrange/queryrangebase/roundtrip.go | 1 + pkg/querier/queryrange/roundtrip.go | 219 +++++++++- pkg/querier/queryrange/roundtrip_test.go | 247 +++++++++++ pkg/querier/queryrange/volume.go | 75 ++++ pkg/querier/queryrange/volume_test.go | 124 ++++++ 11 files changed, 1014 insertions(+), 256 deletions(-) diff --git a/pkg/loghttp/query.go b/pkg/loghttp/query.go index af67b9df2d0a3..340ea15824622 100644 --- a/pkg/loghttp/query.go +++ b/pkg/loghttp/query.go @@ -565,12 +565,13 @@ func NewVolumeInstantQueryWithDefaults(matchers string) *logproto.VolumeRequest } type VolumeInstantQuery struct { - Start time.Time - End time.Time - Query string - Limit uint32 - TargetLabels []string - AggregateBy string + Start time.Time + End time.Time + Query string + Limit uint32 + TargetLabels []string + AggregateBy string + AggregatedMetrics bool } func ParseVolumeInstantQuery(r *http.Request) (*VolumeInstantQuery, error) { @@ -589,11 +590,14 @@ func ParseVolumeInstantQuery(r *http.Request) (*VolumeInstantQuery, error) { return nil, err } + aggregatedMetrics := volumeAggregatedMetrics(r) + svInstantQuery := VolumeInstantQuery{ - Query: result.Query, - Limit: result.Limit, - TargetLabels: targetLabels(r), - AggregateBy: aggregateBy, + Query: result.Query, + Limit: result.Limit, + TargetLabels: targetLabels(r), + AggregateBy: aggregateBy, + AggregatedMetrics: aggregatedMetrics, } svInstantQuery.Start, svInstantQuery.End, err = bounds(r) @@ -609,13 +613,14 @@ func ParseVolumeInstantQuery(r *http.Request) (*VolumeInstantQuery, error) { } type VolumeRangeQuery struct { - Start time.Time - End time.Time - Step time.Duration - Query string - Limit uint32 - TargetLabels []string - AggregateBy string + Start time.Time + End time.Time + Step time.Duration + Query string + Limit uint32 + TargetLabels []string + AggregateBy string + AggregatedMetrics bool } func ParseVolumeRangeQuery(r *http.Request) (*VolumeRangeQuery, error) { @@ -634,14 +639,17 @@ func ParseVolumeRangeQuery(r *http.Request) (*VolumeRangeQuery, error) { return nil, err } + aggregatedMetrics := volumeAggregatedMetrics(r) + return &VolumeRangeQuery{ - Start: result.Start, - End: result.End, - Step: result.Step, - Query: result.Query, - Limit: result.Limit, - TargetLabels: targetLabels(r), - AggregateBy: aggregateBy, + Start: result.Start, + End: result.End, + Step: result.Step, + Query: result.Query, + Limit: result.Limit, + TargetLabels: targetLabels(r), + AggregateBy: aggregateBy, + AggregatedMetrics: aggregatedMetrics, }, nil } @@ -726,3 +734,8 @@ func volumeAggregateBy(r *http.Request) (string, error) { return "", errors.New("invalid aggregation option") } + +func volumeAggregatedMetrics(r *http.Request) bool { + l := r.Form.Get("aggregatedMetrics") + return l == "true" +} diff --git a/pkg/loghttp/query_test.go b/pkg/loghttp/query_test.go index 889a8900eac76..55693a49cac71 100644 --- a/pkg/loghttp/query_test.go +++ b/pkg/loghttp/query_test.go @@ -293,13 +293,13 @@ func Test_QueryResponseUnmarshal(t *testing.T) { } func Test_ParseVolumeInstantQuery(t *testing.T) { + url := `?query={foo="bar"}` + + `&start=2017-06-10T21:42:24.760738998Z` + + `&end=2017-07-10T21:42:24.760738998Z` + + `&limit=1000` + + `&targetLabels=foo,bar` req := &http.Request{ - URL: mustParseURL(`?query={foo="bar"}` + - `&start=2017-06-10T21:42:24.760738998Z` + - `&end=2017-07-10T21:42:24.760738998Z` + - `&limit=1000` + - `&targetLabels=foo,bar`, - ), + URL: mustParseURL(url), } err := req.ParseForm() @@ -319,7 +319,7 @@ func Test_ParseVolumeInstantQuery(t *testing.T) { require.Equal(t, expected, actual) t.Run("aggregate by", func(t *testing.T) { - url := `?query={foo="bar"}` + + url = `?query={foo="bar"}` + `&start=2017-06-10T21:42:24.760738998Z` + `&end=2017-07-10T21:42:24.760738998Z` + `&limit=1000` + @@ -348,17 +348,47 @@ func Test_ParseVolumeInstantQuery(t *testing.T) { require.EqualError(t, err, "invalid aggregation option") }) }) + + t.Run("aggregated metrics", func(t *testing.T) { + req := &http.Request{URL: mustParseURL(url)} + + err := req.ParseForm() + require.NoError(t, err) + + actual, err = ParseVolumeInstantQuery(req) + require.NoError(t, err) + + require.False(t, actual.AggregatedMetrics) + + req = &http.Request{URL: mustParseURL(url + `&aggregatedMetrics=true`)} + err = req.ParseForm() + require.NoError(t, err) + + actual, err = ParseVolumeInstantQuery(req) + require.NoError(t, err) + + require.True(t, actual.AggregatedMetrics) + + req = &http.Request{URL: mustParseURL(url + `&aggregatedMetrics=false`)} + err = req.ParseForm() + require.NoError(t, err) + + actual, err = ParseVolumeInstantQuery(req) + require.NoError(t, err) + + require.False(t, actual.AggregatedMetrics) + }) } func Test_ParseVolumeRangeQuery(t *testing.T) { + url := `?query={foo="bar"}` + + `&start=2017-06-10T21:42:24.760738998Z` + + `&end=2017-07-10T21:42:24.760738998Z` + + `&limit=1000` + + `&step=3600` + + `&targetLabels=foo,bar` req := &http.Request{ - URL: mustParseURL(`?query={foo="bar"}` + - `&start=2017-06-10T21:42:24.760738998Z` + - `&end=2017-07-10T21:42:24.760738998Z` + - `&limit=1000` + - `&step=3600` + - `&targetLabels=foo,bar`, - ), + URL: mustParseURL(url), } err := req.ParseForm() @@ -379,13 +409,6 @@ func Test_ParseVolumeRangeQuery(t *testing.T) { require.Equal(t, expected, actual) t.Run("aggregate by", func(t *testing.T) { - url := `?query={foo="bar"}` + - `&start=2017-06-10T21:42:24.760738998Z` + - `&end=2017-07-10T21:42:24.760738998Z` + - `&limit=1000` + - `&step=3600` + - `&targetLabels=foo,bar` - t.Run("labels", func(t *testing.T) { req := &http.Request{URL: mustParseURL(url + `&aggregateBy=labels`)} @@ -407,5 +430,35 @@ func Test_ParseVolumeRangeQuery(t *testing.T) { _, err = ParseVolumeRangeQuery(req) require.EqualError(t, err, "invalid aggregation option") }) + + t.Run("aggregated metrics", func(t *testing.T) { + req := &http.Request{URL: mustParseURL(url)} + + err := req.ParseForm() + require.NoError(t, err) + + actual, err = ParseVolumeRangeQuery(req) + require.NoError(t, err) + + require.False(t, actual.AggregatedMetrics) + + req = &http.Request{URL: mustParseURL(url + `&aggregatedMetrics=true`)} + err = req.ParseForm() + require.NoError(t, err) + + actual, err = ParseVolumeRangeQuery(req) + require.NoError(t, err) + + require.True(t, actual.AggregatedMetrics) + + req = &http.Request{URL: mustParseURL(url + `&aggregatedMetrics=false`)} + err = req.ParseForm() + require.NoError(t, err) + + actual, err = ParseVolumeRangeQuery(req) + require.NoError(t, err) + + require.False(t, actual.AggregatedMetrics) + }) }) } diff --git a/pkg/logproto/logproto.pb.go b/pkg/logproto/logproto.pb.go index e5c36bb22b8d7..45f6cde16e79c 100644 --- a/pkg/logproto/logproto.pb.go +++ b/pkg/logproto/logproto.pb.go @@ -2509,14 +2509,15 @@ func (m *IndexStatsResponse) GetEntries() uint64 { } type VolumeRequest struct { - From github_com_prometheus_common_model.Time `protobuf:"varint,1,opt,name=from,proto3,customtype=github.com/prometheus/common/model.Time" json:"from"` - Through github_com_prometheus_common_model.Time `protobuf:"varint,2,opt,name=through,proto3,customtype=github.com/prometheus/common/model.Time" json:"through"` - Matchers string `protobuf:"bytes,3,opt,name=matchers,proto3" json:"matchers,omitempty"` - Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` - Step int64 `protobuf:"varint,5,opt,name=step,proto3" json:"step,omitempty"` - TargetLabels []string `protobuf:"bytes,6,rep,name=targetLabels,proto3" json:"targetLabels,omitempty"` - AggregateBy string `protobuf:"bytes,7,opt,name=aggregateBy,proto3" json:"aggregateBy,omitempty"` - CachingOptions resultscache.CachingOptions `protobuf:"bytes,8,opt,name=cachingOptions,proto3" json:"cachingOptions"` + From github_com_prometheus_common_model.Time `protobuf:"varint,1,opt,name=from,proto3,customtype=github.com/prometheus/common/model.Time" json:"from"` + Through github_com_prometheus_common_model.Time `protobuf:"varint,2,opt,name=through,proto3,customtype=github.com/prometheus/common/model.Time" json:"through"` + Matchers string `protobuf:"bytes,3,opt,name=matchers,proto3" json:"matchers,omitempty"` + Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + Step int64 `protobuf:"varint,5,opt,name=step,proto3" json:"step,omitempty"` + TargetLabels []string `protobuf:"bytes,6,rep,name=targetLabels,proto3" json:"targetLabels,omitempty"` + AggregateBy string `protobuf:"bytes,7,opt,name=aggregateBy,proto3" json:"aggregateBy,omitempty"` + CachingOptions resultscache.CachingOptions `protobuf:"bytes,8,opt,name=cachingOptions,proto3" json:"cachingOptions"` + AggregatedMetrics bool `protobuf:"varint,9,opt,name=aggregatedMetrics,proto3" json:"aggregatedMetrics,omitempty"` } func (m *VolumeRequest) Reset() { *m = VolumeRequest{} } @@ -2593,6 +2594,13 @@ func (m *VolumeRequest) GetCachingOptions() resultscache.CachingOptions { return resultscache.CachingOptions{} } +func (m *VolumeRequest) GetAggregatedMetrics() bool { + if m != nil { + return m.AggregatedMetrics + } + return false +} + type VolumeResponse struct { Volumes []Volume `protobuf:"bytes,1,rep,name=volumes,proto3" json:"volumes"` Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` @@ -3130,179 +3138,180 @@ func init() { func init() { proto.RegisterFile("pkg/logproto/logproto.proto", fileDescriptor_c28a5f14f1f4c79a) } var fileDescriptor_c28a5f14f1f4c79a = []byte{ - // 2739 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x3a, 0x4d, 0x6c, 0x1b, 0xc7, - 0xd5, 0x5c, 0x72, 0x49, 0x91, 0x8f, 0x94, 0x2c, 0x8f, 0x68, 0x9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xbe, 0xe4, 0x46, 0x7d, 0xc1, 0xb0, 0x4d, 0x0c, 0x08, 0x3a, - 0x0d, 0x87, 0x93, 0xd9, 0xb5, 0x60, 0xbb, 0xef, 0x86, 0x5d, 0x21, 0x03, 0x9b, 0xec, 0x5f, 0x40, - 0x08, 0xec, 0xd0, 0x65, 0xb4, 0x51, 0x58, 0xb3, 0x4e, 0x16, 0x88, 0x18, 0x73, 0x6e, 0x19, 0xf5, - 0x5d, 0x9f, 0x35, 0x6c, 0x21, 0x4e, 0x35, 0xe3, 0x70, 0x6e, 0x11, 0x34, 0x6a, 0x14, 0xd7, 0xac, - 0x93, 0x8b, 0x44, 0xcd, 0xf0, 0x3f, 0x0a, 0x50, 0x7b, 0x75, 0x4c, 0xc3, 0x89, 0x12, 0x00, 0x6a, - 0x42, 0x39, 0xa2, 0x03, 0xda, 0x61, 0x41, 0x28, 0x35, 0xd2, 0xce, 0x37, 0x2c, 0x12, 0xc3, 0x50, - 0x1d, 0x8a, 0x03, 0x6f, 0xe8, 0x31, 0x71, 0xad, 0x45, 0x22, 0x27, 0xe8, 0x02, 0x14, 0x23, 0xe6, - 0x86, 0x4c, 0xdc, 0xa5, 0x7a, 0x6e, 0x75, 0x5d, 0x9a, 0xf2, 0xba, 0x36, 0xe5, 0xf5, 0x9b, 0xda, - 0x94, 0xdb, 0xe5, 0xf7, 0xa7, 0x4e, 0xee, 0xdd, 0x3f, 0x3b, 0x16, 0x91, 0x5b, 0xd0, 0x33, 0x50, - 0xa0, 0x7e, 0x57, 0xdc, 0xf7, 0xf3, 0xee, 0xe4, 0x1b, 0xd0, 0x59, 0xa8, 0x74, 0xbd, 0x90, 0x76, - 0x98, 0x17, 0xf8, 0x82, 0xab, 0xa5, 0x73, 0x2b, 0x89, 0x46, 0x36, 0xf5, 0x12, 0x49, 0xb0, 0xd0, - 0x69, 0x28, 0x45, 0x5c, 0x74, 0x51, 0x63, 0x81, 0xdb, 0x42, 0xbb, 0xbe, 0x37, 0x75, 0x96, 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42, 0xd7, 0xef, 0xd1, 0x5b, - 0x71, 0x81, 0x56, 0x23, 0x06, 0xe4, 0x80, 0xbc, 0x64, 0x03, 0x0e, 0x9b, 0x37, 0x92, 0xea, 0x5e, - 0x87, 0x85, 0x57, 0xc7, 0xa6, 0xb8, 0xea, 0x19, 0x71, 0xc9, 0x3e, 0x80, 0x46, 0xe2, 0x36, 0x03, - 0x09, 0x1c, 0x9d, 0x80, 0x0a, 0x73, 0x6f, 0x0f, 0xe8, 0xb5, 0xc4, 0x05, 0x26, 0x00, 0xbe, 0xca, - 0x6b, 0xcb, 0x5b, 0x46, 0x82, 0x95, 0x00, 0xd0, 0x13, 0xb0, 0x9c, 0xdc, 0xf9, 0x46, 0x48, 0x77, - 0xbc, 0x77, 0x84, 0x86, 0x6b, 0x64, 0x1f, 0x1c, 0x9d, 0x84, 0x43, 0x09, 0x6c, 0x5b, 0x24, 0x32, - 0xb6, 0x40, 0xcd, 0x82, 0xb9, 0x6c, 0x04, 0xbb, 0x2f, 0xde, 0x1d, 0xbb, 0x03, 0xf1, 0xf8, 0x6a, - 0xc4, 0x80, 0xe0, 0xdf, 0x5b, 0x70, 0x58, 0xaa, 0x9a, 0xb9, 0xec, 0x2b, 0x69, 0xf5, 0xbf, 0xb0, - 0x00, 0x99, 0x1c, 0x28, 0xd3, 0xfa, 0x5f, 0xb3, 0xcf, 0xc4, 0x33, 0xa5, 0xaa, 0x28, 0x99, 0x25, - 0x28, 0x69, 0x15, 0x61, 0x28, 0x75, 0x64, 0x3f, 0x4d, 0x34, 0xc6, 0x65, 0x4d, 0x2e, 0x21, 0x44, - 0x7d, 0x23, 0x07, 0x8a, 0xb7, 0x27, 0x8c, 0x46, 0xaa, 0xa2, 0x16, 0xad, 0x04, 0x01, 0x20, 0xf2, - 0x8b, 0x9f, 0x45, 0x7d, 0x26, 0xac, 0xc6, 0x4e, 0xce, 0x52, 0x20, 0xa2, 0x07, 0xf8, 0x9f, 0x79, - 0x58, 0xbc, 0x15, 0x0c, 0xc6, 0x49, 0xd0, 0xfc, 0x2a, 0x05, 0x8c, 0x54, 0x99, 0x5f, 0xd4, 0x65, - 0x3e, 0x02, 0x3b, 0x62, 0x74, 0x24, 0x2c, 0xab, 0x40, 0xc4, 0x18, 0x61, 0xa8, 0x31, 0x37, 0xec, - 0x51, 0x26, 0x8b, 0xa7, 0x46, 0x49, 0x64, 0xb5, 0x29, 0x18, 0x5a, 0x83, 0xaa, 0xdb, 0xeb, 0x85, - 0xb4, 0xe7, 0x32, 0xda, 0x9e, 0x34, 0x16, 0xc4, 0x61, 0x26, 0x08, 0x5d, 0x85, 0xa5, 0x8e, 0xdb, - 0xe9, 0x7b, 0x7e, 0xef, 0xfa, 0x88, 0x79, 0x81, 0x1f, 0x35, 0xca, 0x22, 0x74, 0x9c, 0x58, 0x37, - 0x7f, 0x68, 0x5a, 0xdf, 0x48, 0xe1, 0x28, 0x3f, 0x96, 0xd9, 0x89, 0xdf, 0x80, 0x25, 0x2d, 0x78, - 0x65, 0x1e, 0x67, 0x60, 0xe1, 0x6d, 0x01, 0x99, 0xd1, 0xc2, 0x93, 0xa8, 0x8a, 0x94, 0x46, 0x4b, - 0xff, 0x54, 0xa1, 0xf9, 0xc7, 0x57, 0xa1, 0x24, 0xd1, 0xd1, 0x09, 0xb3, 0x9c, 0x92, 0x19, 0x25, - 0x9f, 0xab, 0xda, 0x08, 0x43, 0x49, 0x12, 0x52, 0x46, 0x24, 0xec, 0x4c, 0x42, 0x88, 0xfa, 0xc6, - 0x7f, 0xb7, 0xe0, 0xc8, 0x26, 0x65, 0xb4, 0xc3, 0x68, 0xf7, 0x92, 0x47, 0x07, 0xdd, 0x2f, 0xb4, - 0xd2, 0x8f, 0xfb, 0x75, 0x05, 0xa3, 0x5f, 0xc7, 0x7d, 0xd8, 0xc0, 0xf3, 0xe9, 0x96, 0xd1, 0xf0, - 0x49, 0x00, 0xdc, 0xdb, 0xec, 0xf0, 0x8b, 0xcb, 0x65, 0xf9, 0xdb, 0x90, 0x01, 0x89, 0xad, 0xa5, - 0x94, 0x58, 0x0b, 0xfe, 0x9e, 0x05, 0x47, 0xb3, 0x5c, 0x2b, 0x25, 0xb5, 0xa0, 0x24, 0x36, 0xcf, - 0x68, 0x15, 0xa7, 0x76, 0x10, 0x85, 0x86, 0xce, 0xa7, 0xce, 0x17, 0xbf, 0x29, 0xb5, 0x1b, 0x7b, - 0x53, 0xa7, 0x9e, 0x40, 0x8d, 0x6e, 0x84, 0x81, 0x8b, 0xff, 0xc8, 0x6b, 0x76, 0x93, 0xa6, 0xd0, - 0x37, 0xb7, 0x55, 0xe5, 0xc7, 0xe5, 0x04, 0xfd, 0x1f, 0xd8, 0x6c, 0x32, 0x52, 0xee, 0xbb, 0x7d, - 0xe4, 0xb3, 0xa9, 0x73, 0x38, 0xb5, 0xed, 0xe6, 0x64, 0x44, 0x89, 0x40, 0xe1, 0x26, 0xde, 0x71, - 0xc3, 0xae, 0xe7, 0xbb, 0x03, 0x8f, 0x49, 0x31, 0xda, 0xc4, 0x04, 0x71, 0xbf, 0x31, 0x72, 0xc3, - 0x48, 0xe7, 0x60, 0x15, 0xe9, 0x37, 0x14, 0x88, 0xe8, 0x81, 0xe8, 0xad, 0xdc, 0xa1, 0xac, 0xd3, - 0x97, 0xfe, 0x5b, 0xf5, 0x56, 0x04, 0x24, 0xd5, 0x5b, 0x11, 0x10, 0xfc, 0x33, 0xc3, 0x8a, 0xe4, - 0x63, 0xfb, 0xd2, 0x59, 0x11, 0xfe, 0x56, 0xa2, 0x72, 0x7d, 0x45, 0xa5, 0xf2, 0x17, 0x60, 0xa9, - 0x9b, 0x5a, 0x39, 0x58, 0xf5, 0xb2, 0x6f, 0x9c, 0x41, 0xc7, 0xe3, 0x44, 0x8f, 0x02, 0x72, 0x80, - 0x1e, 0x33, 0xca, 0xc9, 0xef, 0x57, 0x4e, 0x22, 0xf5, 0xc2, 0xfd, 0xa5, 0xfe, 0xc4, 0x63, 0x50, - 0x89, 0x7f, 0x23, 0x44, 0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 0x92, 0x4a, 0xc7, 0x3b, 0x9c, - 0x43, 0x6f, 0x88, 0xea, 0x20, 0xed, 0x69, 0x91, 0x73, 0x80, 0x47, 0x8d, 0xef, 0xb5, 0x76, 0x30, - 0x42, 0x4c, 0xf9, 0xf5, 0x14, 0x65, 0x15, 0xe0, 0x9d, 0x03, 0x1e, 0x6c, 0x4c, 0xd9, 0xb9, 0xcf, - 0x7f, 0x3d, 0x70, 0xee, 0xdc, 0x9b, 0xfa, 0xef, 0x0e, 0x9b, 0x2e, 0x73, 0xd1, 0x75, 0x58, 0x12, - 0xb2, 0x8c, 0xff, 0x0f, 0x91, 0xb2, 0xf9, 0x7d, 0x7f, 0xbe, 0x48, 0xd9, 0xfc, 0xfe, 0x3f, 0x61, - 0xe0, 0x5c, 0xfb, 0xcd, 0x0f, 0x3e, 0x6e, 0xe6, 0x3e, 0xfc, 0xb8, 0x99, 0xfb, 0xf4, 0xe3, 0xa6, - 0xf5, 0xdd, 0xdd, 0xa6, 0xf5, 0xcb, 0xdd, 0xa6, 0xf5, 0xfe, 0x6e, 0xd3, 0xfa, 0x60, 0xb7, 0x69, - 0xfd, 0x65, 0xb7, 0x69, 0xfd, 0x75, 0xb7, 0x99, 0xfb, 0x74, 0xb7, 0x69, 0xbd, 0xfb, 0x49, 0x33, - 0xf7, 0xc1, 0x27, 0xcd, 0xdc, 0x87, 0x9f, 0x34, 0x73, 0xdf, 0x7e, 0xfc, 0xfe, 0x95, 0xb0, 0x74, - 0x8b, 0x25, 0xf1, 0xf5, 0xd4, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xfc, 0x48, 0x69, 0xc6, - 0x23, 0x00, 0x00, + // 2754 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x1a, 0x4d, 0x8c, 0x5b, 0x47, + 0xd9, 0xcf, 0x7e, 0xf6, 0xda, 0x9f, 0x77, 0x37, 0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, 0x9b, + 0xed, 0xde, 0xc8, 0xbf, 0xdd, 0x6c, 0xbb, 0xed, 0x1e, 0x6d, 0x86, 0x34, 0x1a, 0xf5, 0x59, 0x24, + 0x01, 0x36, 0x1e, 0x52, 0xc5, 0x06, 0xff, 0xde, 0x82, 0xc3, 0x5b, 0xee, 0x2d, 0xda, 0xbf, 0x11, + 0xdc, 0x74, 0xfb, 0x23, 0x1a, 0x11, 0x1a, 0x0d, 0x03, 0x3f, 0xa2, 0x68, 0x03, 0x4a, 0x7d, 0x3e, + 0x11, 0xd5, 0xad, 0xb5, 0xc2, 0x89, 0xea, 0xd9, 0x93, 0xeb, 0xb1, 0x90, 0x53, 0x17, 0x48, 0x6c, + 0xf4, 0xa2, 0xcf, 0xc2, 0x31, 0x51, 0x4b, 0x57, 0x6f, 0x42, 0xd5, 0x40, 0xa3, 0x25, 0x28, 0xdc, + 0xa6, 0xe3, 0xba, 0xb5, 0x66, 0x9d, 0xa8, 0x10, 0x3e, 0x44, 0x67, 0xa0, 0xf8, 0x36, 0x67, 0x53, + 0xcf, 0xaf, 0x59, 0x27, 0xaa, 0x67, 0x8f, 0x25, 0x9b, 0xbc, 0xe6, 0x7b, 0x77, 0x46, 0x54, 0xac, + 0x56, 0x1b, 0x49, 0xca, 0xf3, 0xf9, 0x73, 0x16, 0x3e, 0x09, 0xcb, 0xfb, 0xe6, 0xd1, 0x11, 0x28, + 0x09, 0x0a, 0x79, 0xe2, 0x0a, 0x51, 0x10, 0xae, 0x01, 0xda, 0x66, 0x21, 0x75, 0x07, 0xc4, 0x65, + 0xfc, 0xbc, 0x77, 0x46, 0x34, 0x62, 0xf8, 0x15, 0x58, 0x49, 0x61, 0x95, 0xd8, 0xcf, 0x40, 0x35, + 0x4a, 0xd0, 0x4a, 0xf6, 0x5a, 0x72, 0xac, 0x64, 0x0d, 0x31, 0x09, 0xf1, 0xcf, 0x2d, 0x80, 0x64, + 0x0e, 0x35, 0x00, 0xe4, 0xec, 0x4b, 0x6e, 0xd4, 0x13, 0x02, 0xdb, 0xc4, 0xc0, 0xa0, 0x53, 0xb0, + 0x9c, 0x40, 0x57, 0x83, 0xed, 0x9e, 0x1b, 0x76, 0x84, 0x0e, 0x6c, 0xb2, 0x7f, 0x02, 0x21, 0xb0, + 0x43, 0x97, 0xd1, 0x7a, 0x61, 0xcd, 0x3a, 0x51, 0x20, 0x62, 0xcc, 0xa5, 0x65, 0xd4, 0x77, 0x7d, + 0x56, 0xb7, 0x85, 0x3a, 0x15, 0xc4, 0xf1, 0xdc, 0x23, 0x68, 0x54, 0x2f, 0xae, 0x59, 0x27, 0x16, + 0x88, 0x82, 0xf0, 0xbf, 0x0b, 0x30, 0xff, 0xea, 0x88, 0x86, 0x63, 0xa5, 0x00, 0xd4, 0x80, 0x72, + 0x44, 0xfb, 0xb4, 0xcd, 0x82, 0x50, 0x5a, 0xa4, 0x95, 0xaf, 0x5b, 0x24, 0xc6, 0xa1, 0x1a, 0x14, + 0xfb, 0xde, 0xc0, 0x63, 0xe2, 0x58, 0x0b, 0x44, 0x02, 0xe8, 0x3c, 0x14, 0x23, 0xe6, 0x86, 0x4c, + 0x9c, 0xa5, 0x7a, 0x76, 0x75, 0x5d, 0xba, 0xf2, 0xba, 0x76, 0xe5, 0xf5, 0x1b, 0xda, 0x95, 0x5b, + 0xe5, 0xf7, 0x27, 0x4e, 0xee, 0xdd, 0xbf, 0x39, 0x16, 0x91, 0x4b, 0xd0, 0x33, 0x50, 0xa0, 0x7e, + 0x47, 0x9c, 0xf7, 0xf3, 0xae, 0xe4, 0x0b, 0xd0, 0x19, 0xa8, 0x74, 0xbc, 0x90, 0xb6, 0x99, 0x17, + 0xf8, 0x42, 0xaa, 0xc5, 0xb3, 0x2b, 0x89, 0x45, 0x36, 0xf5, 0x14, 0x49, 0xa8, 0xd0, 0x29, 0x28, + 0x45, 0x5c, 0x75, 0x51, 0x7d, 0x8e, 0xfb, 0x42, 0xab, 0xb6, 0x37, 0x71, 0x96, 0x24, 0xe6, 0x54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 0x3d, 0x28, 0xc1, 0x0e, 0xa0, + 0x24, 0x2d, 0x81, 0xbe, 0x02, 0x95, 0xb8, 0x94, 0x11, 0xd2, 0x16, 0x5a, 0xa5, 0xbd, 0x89, 0x93, + 0x67, 0x11, 0x49, 0x26, 0x90, 0x63, 0x26, 0x7d, 0xab, 0x55, 0xd9, 0x9b, 0x38, 0x12, 0xa1, 0x52, + 0x3c, 0x3a, 0x0e, 0x76, 0x8f, 0xe7, 0x4d, 0xae, 0x02, 0xbb, 0x55, 0xde, 0x9b, 0x38, 0x02, 0x26, + 0xe2, 0x13, 0x5f, 0x82, 0xf9, 0x2d, 0xda, 0x75, 0xdb, 0x63, 0xb5, 0x69, 0x4d, 0xb3, 0xe3, 0x1b, + 0x5a, 0x9a, 0xc7, 0xa3, 0x30, 0x1f, 0xef, 0xf8, 0xd6, 0x20, 0x52, 0xb7, 0xa1, 0x1a, 0xe3, 0x5e, + 0x89, 0xf0, 0xcf, 0x2c, 0x50, 0x3e, 0x80, 0xb0, 0x51, 0xed, 0xf0, 0x58, 0x08, 0x7b, 0x13, 0x47, + 0x61, 0x74, 0x31, 0x83, 0x9e, 0x83, 0xb9, 0x48, 0xec, 0xc8, 0x99, 0x65, 0x5d, 0x4b, 0x4c, 0xb4, + 0x0e, 0x71, 0x17, 0xd9, 0x9b, 0x38, 0x9a, 0x90, 0xe8, 0x01, 0x5a, 0x4f, 0x15, 0x04, 0x52, 0xb0, + 0xc5, 0xbd, 0x89, 0x63, 0x60, 0xcd, 0x02, 0x01, 0x7f, 0x66, 0x41, 0xf5, 0x86, 0xeb, 0xc5, 0x2e, + 0x54, 0xd7, 0x26, 0x4a, 0x62, 0xb5, 0x44, 0x70, 0x4f, 0xec, 0xd0, 0xbe, 0x3b, 0xbe, 0x18, 0x84, + 0x82, 0xef, 0x02, 0x89, 0xe1, 0x24, 0x87, 0xdb, 0x53, 0x73, 0x78, 0x71, 0xf6, 0xd0, 0xfe, 0xff, + 0x0d, 0xa4, 0x57, 0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b0, 0x61, 0x84, 0xf9, 0x07, 0x21, 0x62, 0xfe, + 0x01, 0x8a, 0x58, 0xc8, 0x44, 0x40, 0x1f, 0xe6, 0x76, 0x84, 0x78, 0x32, 0x63, 0xa7, 0xfa, 0x4f, + 0x89, 0xec, 0xad, 0x6f, 0xa9, 0xcd, 0x9f, 0xb9, 0x47, 0xc1, 0x25, 0xfa, 0x88, 0xcd, 0x68, 0xec, + 0x33, 0xf7, 0x1d, 0x63, 0x3d, 0xd1, 0x9b, 0x20, 0x57, 0xd5, 0x74, 0xc5, 0xa9, 0x35, 0xdd, 0xf3, + 0x6a, 0x9b, 0xff, 0xa5, 0xae, 0xc3, 0xcf, 0x27, 0x01, 0x56, 0x18, 0x45, 0x05, 0xd8, 0xc7, 0xee, + 0x75, 0xfd, 0xd5, 0xa5, 0xff, 0xa3, 0x05, 0x4b, 0x97, 0x28, 0x4b, 0xd7, 0x58, 0x0f, 0x91, 0x49, + 0xf1, 0x4b, 0xb0, 0x6c, 0x9c, 0x5f, 0x49, 0xff, 0x54, 0xa6, 0xb0, 0x3a, 0x9c, 0xc8, 0x7f, 0xd9, + 0xef, 0xd0, 0x77, 0xd4, 0x7b, 0x35, 0x5d, 0x53, 0x5d, 0x87, 0xaa, 0x31, 0x89, 0x2e, 0x64, 0xaa, + 0xa9, 0x95, 0x4c, 0x9b, 0x96, 0x57, 0x04, 0xad, 0x9a, 0x92, 0x49, 0xbe, 0x4a, 0x55, 0xad, 0x1c, + 0x57, 0x1e, 0xdb, 0x80, 0x84, 0xb9, 0x04, 0x5b, 0x33, 0xf7, 0x09, 0xec, 0xcb, 0x71, 0x59, 0x15, + 0xc3, 0xe8, 0x51, 0xb0, 0xc3, 0xe0, 0xae, 0x2e, 0x93, 0x17, 0x92, 0x2d, 0x49, 0x70, 0x97, 0x88, + 0x29, 0xfc, 0x1c, 0x14, 0x48, 0x70, 0x17, 0x35, 0x00, 0x42, 0xd7, 0xef, 0xd2, 0x9b, 0xf1, 0x03, + 0x6d, 0x9e, 0x18, 0x98, 0x03, 0xea, 0x92, 0x0d, 0x58, 0x36, 0x4f, 0x24, 0xcd, 0xbd, 0x0e, 0x73, + 0xaf, 0x8e, 0x4c, 0x75, 0xd5, 0x32, 0xea, 0x92, 0x7d, 0x00, 0x4d, 0xc4, 0x7d, 0x06, 0x12, 0x3c, + 0x3a, 0x0e, 0x15, 0xe6, 0xde, 0xea, 0xd3, 0xab, 0x49, 0x08, 0x4c, 0x10, 0x7c, 0x96, 0xbf, 0x2d, + 0x6f, 0x1a, 0x05, 0x56, 0x82, 0x40, 0x4f, 0xc0, 0x52, 0x72, 0xe6, 0xeb, 0x21, 0xdd, 0xf1, 0xde, + 0x11, 0x16, 0x9e, 0x27, 0xfb, 0xf0, 0xe8, 0x04, 0x1c, 0x4a, 0x70, 0xdb, 0xa2, 0x90, 0xb1, 0x05, + 0x69, 0x16, 0xcd, 0x75, 0x23, 0xc4, 0x7d, 0xf1, 0xce, 0xc8, 0xed, 0x8b, 0xcb, 0x37, 0x4f, 0x0c, + 0x0c, 0xfe, 0x93, 0x05, 0xcb, 0xd2, 0xd4, 0xcc, 0x65, 0x0f, 0xa5, 0xd7, 0xff, 0xda, 0x02, 0x64, + 0x4a, 0xa0, 0x5c, 0xeb, 0xab, 0x66, 0x9f, 0x89, 0x57, 0x4a, 0x55, 0xf1, 0x64, 0x96, 0xa8, 0xa4, + 0x55, 0x84, 0xa1, 0xd4, 0x96, 0xfd, 0x34, 0xd1, 0x18, 0x97, 0x6f, 0x72, 0x89, 0x21, 0xea, 0x1b, + 0x39, 0x50, 0xbc, 0x35, 0x66, 0x34, 0x52, 0x2f, 0x6a, 0xd1, 0x4a, 0x10, 0x08, 0x22, 0xbf, 0xf8, + 0x5e, 0xd4, 0x67, 0xc2, 0x6b, 0xec, 0x64, 0x2f, 0x85, 0x22, 0x7a, 0x80, 0x7f, 0x55, 0x80, 0x85, + 0x9b, 0x41, 0x7f, 0x94, 0x24, 0xcd, 0x87, 0x29, 0x61, 0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, 0x33, 0xfa, 0x36, 0x54, + 0x2e, 0x51, 0xa6, 0x52, 0xcd, 0xd1, 0x6c, 0xae, 0x9a, 0xa2, 0xa9, 0x74, 0xbe, 0xc3, 0x39, 0xf4, + 0x86, 0x78, 0x4b, 0xa4, 0x23, 0x2d, 0x72, 0x0e, 0x88, 0xa8, 0xf1, 0xb9, 0xd6, 0x0e, 0x26, 0x88, + 0x39, 0xbf, 0x9e, 0xe2, 0xac, 0xca, 0x01, 0xe7, 0x80, 0x0b, 0x1b, 0x73, 0x76, 0xee, 0xf1, 0xcf, + 0x10, 0x9c, 0x3b, 0xfb, 0xa6, 0xfe, 0x73, 0xc4, 0xa6, 0xcb, 0x5c, 0x74, 0x0d, 0x16, 0x85, 0x2e, + 0xe3, 0x7f, 0x4f, 0xa4, 0x7c, 0x7e, 0xdf, 0x5f, 0x35, 0x52, 0x3e, 0xbf, 0xff, 0x2f, 0x1b, 0x38, + 0xd7, 0x7a, 0xf3, 0x83, 0x8f, 0x1b, 0xb9, 0x0f, 0x3f, 0x6e, 0xe4, 0x3e, 0xfd, 0xb8, 0x61, 0x7d, + 0x7f, 0xb7, 0x61, 0xfd, 0x66, 0xb7, 0x61, 0xbd, 0xbf, 0xdb, 0xb0, 0x3e, 0xd8, 0x6d, 0x58, 0x7f, + 0xdf, 0x6d, 0x58, 0xff, 0xd8, 0x6d, 0xe4, 0x3e, 0xdd, 0x6d, 0x58, 0xef, 0x7e, 0xd2, 0xc8, 0x7d, + 0xf0, 0x49, 0x23, 0xf7, 0xe1, 0x27, 0x8d, 0xdc, 0x77, 0x1f, 0xbf, 0xf7, 0xbb, 0x59, 0x86, 0xc5, + 0x92, 0xf8, 0x7a, 0xea, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x8c, 0xe4, 0x22, 0xf4, 0x23, + 0x00, 0x00, } func (x Direction) String() string { @@ -4840,6 +4849,9 @@ func (this *VolumeRequest) Equal(that interface{}) bool { if !this.CachingOptions.Equal(&that1.CachingOptions) { return false } + if this.AggregatedMetrics != that1.AggregatedMetrics { + return false + } return true } func (this *VolumeResponse) Equal(that interface{}) bool { @@ -5696,7 +5708,7 @@ func (this *VolumeRequest) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 12) + s := make([]string, 0, 13) s = append(s, "&logproto.VolumeRequest{") s = append(s, "From: "+fmt.Sprintf("%#v", this.From)+",\n") s = append(s, "Through: "+fmt.Sprintf("%#v", this.Through)+",\n") @@ -5706,6 +5718,7 @@ func (this *VolumeRequest) GoString() string { s = append(s, "TargetLabels: "+fmt.Sprintf("%#v", this.TargetLabels)+",\n") s = append(s, "AggregateBy: "+fmt.Sprintf("%#v", this.AggregateBy)+",\n") s = append(s, "CachingOptions: "+strings.Replace(this.CachingOptions.GoString(), `&`, ``, 1)+",\n") + s = append(s, "AggregatedMetrics: "+fmt.Sprintf("%#v", this.AggregatedMetrics)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -8484,6 +8497,16 @@ func (m *VolumeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.AggregatedMetrics { + i-- + if m.AggregatedMetrics { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } { size, err := m.CachingOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -9837,6 +9860,9 @@ func (m *VolumeRequest) Size() (n int) { } l = m.CachingOptions.Size() n += 1 + l + sovLogproto(uint64(l)) + if m.AggregatedMetrics { + n += 2 + } return n } @@ -10623,6 +10649,7 @@ func (this *VolumeRequest) String() string { `TargetLabels:` + fmt.Sprintf("%v", this.TargetLabels) + `,`, `AggregateBy:` + fmt.Sprintf("%v", this.AggregateBy) + `,`, `CachingOptions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CachingOptions), "CachingOptions", "resultscache.CachingOptions", 1), `&`, ``, 1) + `,`, + `AggregatedMetrics:` + fmt.Sprintf("%v", this.AggregatedMetrics) + `,`, `}`, }, "") return s @@ -16970,6 +16997,26 @@ func (m *VolumeRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregatedMetrics", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogproto + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AggregatedMetrics = bool(v != 0) default: iNdEx = preIndex skippy, err := skipLogproto(dAtA[iNdEx:]) diff --git a/pkg/logproto/logproto.proto b/pkg/logproto/logproto.proto index 18f9d6c01adb6..bd8daa00d3b7d 100644 --- a/pkg/logproto/logproto.proto +++ b/pkg/logproto/logproto.proto @@ -436,6 +436,7 @@ message VolumeRequest { repeated string targetLabels = 6; string aggregateBy = 7; resultscache.CachingOptions cachingOptions = 8 [(gogoproto.nullable) = false]; + bool aggregatedMetrics = 9; } message VolumeResponse { diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index 1a72cb3c5b91e..f94d7abbb9b2f 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -1003,6 +1003,12 @@ func (i ingesterQueryOptions) QueryIngestersWithin() time.Duration { func (t *Loki) initQueryFrontendMiddleware() (_ services.Service, err error) { level.Debug(util_log.Logger).Log("msg", "initializing query frontend tripperware") + if t.Cfg.Pattern.Enabled { + t.Cfg.QueryRange.AggregatedMetrics = t.Cfg.Pattern.MetricAggregation.Enabled + } else { + t.Cfg.QueryRange.AggregatedMetrics = false + } + middleware, stopper, err := queryrange.NewMiddleware( t.Cfg.QueryRange, t.Cfg.Querier.Engine, diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index 5212d9bdebb52..772c24561ceba 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -406,13 +406,14 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer } from, through := util.RoundToMilliseconds(req.Start, req.End) return &logproto.VolumeRequest{ - From: from, - Through: through, - Matchers: req.Query, - Limit: int32(req.Limit), - Step: 0, - TargetLabels: req.TargetLabels, - AggregateBy: req.AggregateBy, + From: from, + Through: through, + Matchers: req.Query, + Limit: int32(req.Limit), + Step: 0, + TargetLabels: req.TargetLabels, + AggregateBy: req.AggregateBy, + AggregatedMetrics: req.AggregatedMetrics, CachingOptions: queryrangebase.CachingOptions{ Disabled: disableCacheReq, }, @@ -424,13 +425,14 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer } from, through := util.RoundToMilliseconds(req.Start, req.End) return &logproto.VolumeRequest{ - From: from, - Through: through, - Matchers: req.Query, - Limit: int32(req.Limit), - Step: req.Step.Milliseconds(), - TargetLabels: req.TargetLabels, - AggregateBy: req.AggregateBy, + From: from, + Through: through, + Matchers: req.Query, + Limit: int32(req.Limit), + Step: req.Step.Milliseconds(), + TargetLabels: req.TargetLabels, + AggregateBy: req.AggregateBy, + AggregatedMetrics: req.AggregatedMetrics, CachingOptions: queryrangebase.CachingOptions{ Disabled: disableCacheReq, }, diff --git a/pkg/querier/queryrange/queryrangebase/roundtrip.go b/pkg/querier/queryrange/queryrangebase/roundtrip.go index d8b666f6888c0..eba294e145201 100644 --- a/pkg/querier/queryrange/queryrangebase/roundtrip.go +++ b/pkg/querier/queryrange/queryrangebase/roundtrip.go @@ -41,6 +41,7 @@ type Config struct { MaxRetries int `yaml:"max_retries"` ShardedQueries bool `yaml:"parallelise_shardable_queries"` ShardAggregations flagext.StringSliceCSV `yaml:"shard_aggregations"` + AggregatedMetrics bool `yaml:"-"` } // RegisterFlags adds the flags required to config this to the given FlagSet. diff --git a/pkg/querier/queryrange/roundtrip.go b/pkg/querier/queryrange/roundtrip.go index 4b9f3dbca9da8..0ead0aaf4c676 100644 --- a/pkg/querier/queryrange/roundtrip.go +++ b/pkg/querier/queryrange/roundtrip.go @@ -5,6 +5,7 @@ import ( "flag" "fmt" "net/http" + "sort" "strings" "time" @@ -16,12 +17,13 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" + "github.com/grafana/loki/v3/pkg/loghttp" "github.com/grafana/loki/v3/pkg/logproto" "github.com/grafana/loki/v3/pkg/logql" logqllog "github.com/grafana/loki/v3/pkg/logql/log" "github.com/grafana/loki/v3/pkg/logql/syntax" "github.com/grafana/loki/v3/pkg/logqlmodel/stats" - "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase" + "github.com/grafana/loki/v3/pkg/querier/plan" base "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase" "github.com/grafana/loki/v3/pkg/storage/chunk/cache" "github.com/grafana/loki/v3/pkg/storage/config" @@ -232,7 +234,20 @@ func NewMiddleware( return nil, nil, err } - seriesVolumeTripperware, err := NewVolumeTripperware(cfg, log, limits, schema, codec, iqo, volumeCache, cacheGenNumLoader, retentionEnabled, metrics, metricsNamespace) + seriesVolumeTripperware, err := NewVolumeTripperware( + cfg, + log, + limits, + schema, + codec, + iqo, + volumeCache, + cacheGenNumLoader, + retentionEnabled, + metrics, + metricsNamespace, + logFilterTripperware, + ) if err != nil { return nil, nil, err } @@ -298,9 +313,9 @@ func NewDetectedLabelsTripperware(cfg Config, logger log.Logger, l Limits, schem }), nil } -func NewDetectedLabelsCardinalityFilter(rt queryrangebase.Handler) queryrangebase.Handler { - return queryrangebase.HandlerFunc( - func(ctx context.Context, req queryrangebase.Request) (queryrangebase.Response, error) { +func NewDetectedLabelsCardinalityFilter(rt base.Handler) base.Handler { + return base.HandlerFunc( + func(ctx context.Context, req base.Request) (base.Response, error) { res, err := rt.Do(ctx, req) if err != nil { return nil, err @@ -539,7 +554,7 @@ func NewLogFilterTripperware(cfg Config, engineOpts logql.EngineOpts, log log.Lo if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) + retryNextHandler = base.MergeMiddlewares(tr, rm).Wrap(next) } queryRangeMiddleware := []base.Middleware{ @@ -611,7 +626,7 @@ func NewLimitedTripperware(cfg Config, engineOpts logql.EngineOpts, log log.Logg if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) + retryNextHandler = base.MergeMiddlewares(tr, rm).Wrap(next) } queryRangeMiddleware := []base.Middleware{ @@ -854,7 +869,7 @@ func NewMetricTripperware(cfg Config, engineOpts logql.EngineOpts, log log.Logge if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) + retryNextHandler = base.MergeMiddlewares(tr, rm).Wrap(next) } queryRangeMiddleware := []base.Middleware{ @@ -983,7 +998,7 @@ func NewInstantMetricTripperware( if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) + retryNextHandler = base.MergeMiddlewares(tr, rm).Wrap(next) } queryRangeMiddleware := []base.Middleware{ @@ -1022,7 +1037,12 @@ func NewInstantMetricTripperware( queryRangeMiddleware = append( queryRangeMiddleware, base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics), - base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace), + base.NewRetryMiddleware( + log, + cfg.MaxRetries, + metrics.RetryMiddlewareMetrics, + metricsNamespace, + ), ) } @@ -1033,7 +1053,79 @@ func NewInstantMetricTripperware( }), nil } -func NewVolumeTripperware(cfg Config, log log.Logger, limits Limits, schema config.SchemaConfig, merger base.Merger, iqo util.IngesterQueryOptions, c cache.Cache, cacheGenNumLoader base.CacheGenNumberLoader, retentionEnabled bool, metrics *Metrics, metricsNamespace string) (base.Middleware, error) { +func NewVolumeTripperware( + cfg Config, + log log.Logger, + limits Limits, + schema config.SchemaConfig, + merger base.Merger, + iqo util.IngesterQueryOptions, + c cache.Cache, + cacheGenNumLoader base.CacheGenNumberLoader, + retentionEnabled bool, + metrics *Metrics, + metricsNamespace string, + logTripperware base.Middleware, +) (base.Middleware, error) { + indexTw, err := indexVolumeQueryTripperware( + c, + cacheGenNumLoader, + cfg, + iqo, + limits, + log, + merger, + metrics, + metricsNamespace, + retentionEnabled, + schema, + ) + if err != nil { + return nil, err + } + + indexTw = volumeFeatureFlagRoundTripper( + volumeRangeTripperware(indexTw), + limits, + ) + + return base.MiddlewareFunc(func(next base.Handler) base.Handler { + logHandler := logTripperware.Wrap(next) + + return base.HandlerFunc(func(ctx context.Context, req base.Request) (base.Response, error) { + r, ok := req.(*logproto.VolumeRequest) + if !ok { + return nil, httpgrpc.Errorf( + http.StatusBadRequest, + "invalid request type, expected *logproto.VolumeRequest", + ) + } + + // idxVolumeHandler gets volume from metadata in the index + idxVolumeHandler := indexTw.Wrap(next) + if !r.AggregatedMetrics || !cfg.AggregatedMetrics { + return idxVolumeHandler.Do(ctx, req) + } + + return aggMetricsVolumeHandler(ctx, r, limits, logHandler, idxVolumeHandler) + }) + }), nil +} + +// indexVolumeQueryTripperware gets volume from metadata in the index +func indexVolumeQueryTripperware( + c cache.Cache, + cacheGenNumLoader base.CacheGenNumberLoader, + cfg Config, + iqo util.IngesterQueryOptions, + limits Limits, + log log.Logger, + merger base.Merger, + metrics *Metrics, + metricsNamespace string, + retentionEnabled bool, + schema config.SchemaConfig, +) (base.Middleware, error) { // Parallelize the volume requests, so it doesn't send a huge request to a single index-gw (i.e. {app=~".+"} for 30d). // Indices are sharded by 24 hours, so we split the volume request in 24h intervals. limits = WithSplitByLimits(limits, indexStatsQuerySplitInterval) @@ -1083,11 +1175,108 @@ func NewVolumeTripperware(cfg Config, log log.Logger, limits Limits, schema conf if err != nil { return nil, err } + return indexTw, nil +} - return volumeFeatureFlagRoundTripper( - volumeRangeTripperware(indexTw), - limits, - ), nil +// aggMetricsVolumeHandler gets aggregated metrics using aggregated metrics and an aggregated metric log query +func aggMetricsVolumeHandler( + ctx context.Context, + r *logproto.VolumeRequest, + limits Limits, + logHandler, idxVolumeHandler base.Handler, +) (base.Response, error) { + matchers, err := syntax.ParseMatchers(r.GetQuery(), true) + if err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) + } + + if err := validateMatchers(ctx, limits, matchers); err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) + } + + aggMetricQry := &aggregatedMetricQuery{ + matchers: matchers, + start: r.GetStart(), + end: r.GetEnd(), + aggregateBy: strings.Join(r.GetTargetLabels(), ","), + } + + qryStr := aggMetricQry.BuildQuery() + expr, err := syntax.ParseExpr(qryStr) + if err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()) + } + + lokiReq := &LokiInstantRequest{ + Query: expr.String(), + Limit: 1000, + Direction: logproto.BACKWARD, + TimeTs: r.GetEnd().UTC(), + Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: expr, + }, + } + + resp, err := logHandler.Do(ctx, lokiReq) + if err != nil { + return nil, err + } + + re, ok := resp.(*LokiPromResponse) + if !ok || re.Response.Status != "success" { + return idxVolumeHandler.Do(ctx, r) + } + + result := re.Response.Data.Result + sortableResult := make([]sortableSampleStream, 0, len(result)) + resultType := loghttp.ResultTypeVector + + // sort the response to match the index volume respsone + for _, stream := range result { + if resultType == loghttp.ResultTypeVector && len(stream.Samples) > 1 { + resultType = loghttp.ResultTypeMatrix + } + + lbls := logproto.FromLabelAdaptersToLabels(stream.Labels) + sortableResult = append(sortableResult, sortableSampleStream{ + name: lbls.String(), + labels: lbls, + samples: stream.Samples, + }) + } + + sort.Slice(sortableResult, func(i, j int) bool { + // Sorting by value only helps instant queries so just grab the first value + if sortableResult[i].samples[0].Value == sortableResult[j].samples[0].Value { + return sortableResult[i].name < sortableResult[j].name + } + return sortableResult[i].samples[0].Value > sortableResult[j].samples[0].Value + }) + + respStreams := make([]base.SampleStream, 0, len(sortableResult)) + for _, r := range sortableResult { + respStreams = append(respStreams, base.SampleStream{ + Labels: logproto.FromLabelsToLabelAdapters(r.labels), + Samples: r.samples, + }) + } + + + + + + return &LokiPromResponse{ + Response: &base.PrometheusResponse{ + Status: loghttp.QueryStatusSuccess, + Data: base.PrometheusData{ + ResultType: resultType, + Result: respStreams, + }, + Headers: re.Response.Headers, + }, + Statistics: re.Statistics, + }, nil } func volumeRangeTripperware(nextTW base.Middleware) base.Middleware { diff --git a/pkg/querier/queryrange/roundtrip_test.go b/pkg/querier/queryrange/roundtrip_test.go index 2f3b5fcd92ee3..31fed4f3c915d 100644 --- a/pkg/querier/queryrange/roundtrip_test.go +++ b/pkg/querier/queryrange/roundtrip_test.go @@ -11,6 +11,7 @@ import ( "testing" "time" + "github.com/go-kit/log" "github.com/grafana/dskit/httpgrpc" "github.com/grafana/dskit/user" "github.com/prometheus/common/model" @@ -20,6 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/grafana/loki/pkg/push" "github.com/grafana/loki/v3/pkg/loghttp" "github.com/grafana/loki/v3/pkg/logproto" "github.com/grafana/loki/v3/pkg/logql" @@ -812,6 +814,251 @@ func TestVolumeTripperware(t *testing.T) { }) } +func TestAggregateMetricVolumeTripperware(t *testing.T) { + logMiddleware := func(promResponse *LokiPromResponse) base.Middleware { + return base.MiddlewareFunc(func(next base.Handler) base.Handler { + return base.HandlerFunc( + func(_ context.Context, _ base.Request) (base.Response, error) { + return promResponse, nil + }) + }) + } + + now := model.Now() + buildRequest := func(aggMetrics bool) *logproto.VolumeRequest { + return &logproto.VolumeRequest{ + From: now.Add(-5 * time.Hour), + Through: now, + Matchers: `{service_name=~".+"}`, + AggregateBy: seriesvolume.DefaultAggregateBy, + AggregatedMetrics: aggMetrics, + } + } + + mockDownstreamIdxVolumeHandler := base.HandlerFunc( + func(ctx context.Context, request base.Request) (base.Response, error) { + return &VolumeResponse{ + Response: &logproto.VolumeResponse{ + Volumes: []logproto.Volume{ + { + Name: `{service_name="bar"}`, + Volume: 1234, + }, + }, + Limit: 10, + }, + }, nil + }) + + setup := func(lokiPromResponse *LokiPromResponse, testConfig Config) base.Middleware { + limits := fakeLimits{ + maxSeries: math.MaxInt32, + maxQueryParallelism: 1, + tsdbMaxQueryParallelism: 1, + maxQueryBytesRead: 1000, + maxQuerierBytesRead: 100, + volumeEnabled: true, + } + + logger := log.NewNopLogger() + volumeCache, err := newResultsCacheFromConfig( + testConfig.VolumeCacheConfig.ResultsCacheConfig, + nil, + logger, + stats.VolumeResultCache, + ) + require.NoError(t, err) + + metrics := NewMetrics(nil, constants.Loki) + + middleware, err := NewVolumeTripperware( + testConfig, + logger, + limits, + config.SchemaConfig{Configs: testSchemas}, + DefaultCodec, + nil, + volumeCache, + nil, + true, + metrics, + constants.Loki, + logMiddleware(lokiPromResponse), + ) + require.NoError(t, err) + + return middleware + } + + t.Run("returns volume from an aggregated metrics query", func(t *testing.T) { + lokiPromResponse := &LokiPromResponse{ + Response: &base.PrometheusResponse{ + Status: "success", + Data: base.PrometheusData{ + ResultType: "vector", + Result: []base.SampleStream{ + { + Labels: []push.LabelAdapter{ + { + Name: "service_name", + Value: "foo", + }, + }, + Samples: []logproto.LegacySample{ + {Value: 82931, TimestampMs: 1728080816871}, + }, + }, + }, + }, + }, + } + testConfig.AggregatedMetrics = true + middleware := setup(lokiPromResponse, testConfig) + + ctx := user.InjectOrgID(context.Background(), "1") + resp, err := middleware.Wrap(mockDownstreamIdxVolumeHandler).Do(ctx, buildRequest(true)) + require.NoError(t, err) + + lokiResponse, ok := resp.(*LokiPromResponse) + require.True(t, ok) + result := lokiResponse.Response.Data.Result + require.Equal(t, 1, len(result)) + + require.Equal(t, "service_name", result[0].Labels[0].Name) + require.Equal(t, "foo", result[0].Labels[0].Value) + require.Equal(t, float64(82931), result[0].Samples[0].Value) + }) + + t.Run("sorts downstream prometheus response by volume", func(t *testing.T) { + lokiPromResponse := &LokiPromResponse{ + Response: &base.PrometheusResponse{ + Status: "success", + Data: base.PrometheusData{ + ResultType: "vector", + Result: []base.SampleStream{ + { + Labels: []push.LabelAdapter{ + { + Name: "service_name", + Value: "big", + }, + }, + Samples: []logproto.LegacySample{ + {Value: 987600, TimestampMs: 1728080816871}, + }, + }, + { + Labels: []push.LabelAdapter{ + { + Name: "service_name", + Value: "small", + }, + }, + Samples: []logproto.LegacySample{ + {Value: 1234, TimestampMs: 1728080816871}, + }, + }, + }, + }, + }, + } + testConfig.AggregatedMetrics = true + middleware := setup(lokiPromResponse, testConfig) + + ctx := user.InjectOrgID(context.Background(), "1") + resp, err := middleware.Wrap(mockDownstreamIdxVolumeHandler).Do(ctx, buildRequest(true)) + require.NoError(t, err) + + lokiResponse, ok := resp.(*LokiPromResponse) + require.True(t, ok) + result := lokiResponse.Response.Data.Result + require.Equal(t, 2, len(result)) + + require.Equal(t, "service_name", result[0].Labels[0].Name) + require.Equal(t, "big", result[0].Labels[0].Value) + require.Equal(t, "small", result[1].Labels[0].Value) + }) + + t.Run("uses index tripperware if aggregated metrics are disabled", func(t *testing.T) { + lokiPromResponse := &LokiPromResponse{ + Response: &base.PrometheusResponse{ + Status: "success", + Data: base.PrometheusData{ + ResultType: "vector", + Result: []base.SampleStream{ + { + Labels: []push.LabelAdapter{ + { + Name: "service_name", + Value: "foo", + }, + }, + Samples: []logproto.LegacySample{ + {Value: 82931, TimestampMs: 1728080816871}, + }, + }, + }, + }, + }, + } + testConfig.AggregatedMetrics = false + middleware := setup(lokiPromResponse, testConfig) + + ctx := user.InjectOrgID(context.Background(), "1") + resp, err := middleware.Wrap(mockDownstreamIdxVolumeHandler).Do(ctx, buildRequest(true)) + require.NoError(t, err) + + lokiResponse, ok := resp.(*LokiPromResponse) + require.True(t, ok) + result := lokiResponse.Response.Data.Result + require.Equal(t, 1, len(result)) + + require.Equal(t, "service_name", result[0].Labels[0].Name) + require.Equal(t, "bar", result[0].Labels[0].Value) + require.Equal(t, float64(1234), result[0].Samples[0].Value) + }) + + t.Run("uses index tripperware if aggregated metrics are not requested", func(t *testing.T) { + lokiPromResponse := &LokiPromResponse{ + Response: &base.PrometheusResponse{ + Status: "success", + Data: base.PrometheusData{ + ResultType: "vector", + Result: []base.SampleStream{ + { + Labels: []push.LabelAdapter{ + { + Name: "service_name", + Value: "foo", + }, + }, + Samples: []logproto.LegacySample{ + {Value: 82931, TimestampMs: 1728080816871}, + }, + }, + }, + }, + }, + } + + testConfig.AggregatedMetrics = true + middleware := setup(lokiPromResponse, testConfig) + + ctx := user.InjectOrgID(context.Background(), "1") + resp, err := middleware.Wrap(mockDownstreamIdxVolumeHandler).Do(ctx, buildRequest(false)) + require.NoError(t, err) + + lokiResponse, ok := resp.(*LokiPromResponse) + require.True(t, ok) + result := lokiResponse.Response.Data.Result + require.Equal(t, 1, len(result)) + + require.Equal(t, "service_name", result[0].Labels[0].Name) + require.Equal(t, "bar", result[0].Labels[0].Value) + require.Equal(t, float64(1234), result[0].Samples[0].Value) + }) +} + func TestNewTripperware_Caches(t *testing.T) { for _, tc := range []struct { name string diff --git a/pkg/querier/queryrange/volume.go b/pkg/querier/queryrange/volume.go index d4c40964d1423..683a502fa485b 100644 --- a/pkg/querier/queryrange/volume.go +++ b/pkg/querier/queryrange/volume.go @@ -2,7 +2,9 @@ package queryrange import ( "context" + "fmt" "sort" + "strings" "time" "github.com/grafana/dskit/concurrency" @@ -10,6 +12,7 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/grafana/loki/v3/pkg/loghttp" + "github.com/grafana/loki/v3/pkg/loghttp/push" "github.com/grafana/loki/v3/pkg/logproto" "github.com/grafana/loki/v3/pkg/logql/syntax" "github.com/grafana/loki/v3/pkg/logqlmodel/stats" @@ -212,3 +215,75 @@ func toPrometheusData(series map[string][]logproto.LegacySample, aggregateBySeri Result: result, } } + +type aggregatedMetricQuery struct { + matchers []*labels.Matcher + aggregateBy string + start time.Time + end time.Time +} + +func (a *aggregatedMetricQuery) buildBaseQueryString( + idxKey string, + idxMatch string, + idxVal string, + serviceNamePresent bool, +) string { + aggBy := a.aggregateBy + if aggBy == "" { + if serviceNamePresent { + aggBy = push.LabelServiceName + } else { + aggBy = idxKey + } + } + + if serviceNamePresent { + return fmt.Sprintf( + `sum by (%s) (sum_over_time({%s%s"%s"} | logfmt`, + aggBy, + idxKey, + idxMatch, + idxVal, + ) + } else { + return fmt.Sprintf( + `sum by (%s) (sum_over_time({%s=~".+"} | logfmt`, + aggBy, + push.AggregatedMetricLabel, + ) + } +} + +func (a *aggregatedMetricQuery) BuildQuery() string { + var idxKey, idxVal, idxMatch string + filters := []string{} + serviceNamePresent := false + + for i, matcher := range a.matchers { + if i == 0 { + idxKey = matcher.Name + idxVal = matcher.Value + idxMatch = matcher.Type.String() + } + + if matcher.Name == push.LabelServiceName { + serviceNamePresent = true + idxKey = push.AggregatedMetricLabel + idxVal = matcher.Value + idxMatch = matcher.Type.String() + } else { + filters = append(filters, matcher.String()) + } + } + + query := a.buildBaseQueryString(idxKey, idxMatch, idxVal, serviceNamePresent) + + if len(filters) > 0 { + query = query + " | " + strings.Join(filters, " | ") + } + + lookBack := a.end.Sub(a.start).Truncate(time.Second) + query = query + fmt.Sprintf(` | unwrap bytes(bytes) | __error__=""[%s]))`, lookBack) + return query +} diff --git a/pkg/querier/queryrange/volume_test.go b/pkg/querier/queryrange/volume_test.go index d4d2a9febe33d..7c3112bc458ee 100644 --- a/pkg/querier/queryrange/volume_test.go +++ b/pkg/querier/queryrange/volume_test.go @@ -2,6 +2,7 @@ package queryrange import ( "context" + "fmt" "testing" "time" @@ -12,9 +13,11 @@ import ( "github.com/grafana/loki/pkg/push" "github.com/grafana/loki/v3/pkg/loghttp" + loghttp_push "github.com/grafana/loki/v3/pkg/loghttp/push" "github.com/grafana/loki/v3/pkg/logproto" "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase" "github.com/grafana/loki/v3/pkg/storage/stores/index/seriesvolume" + "github.com/prometheus/prometheus/model/labels" ) const forRangeQuery = false @@ -350,3 +353,124 @@ func Test_VolumeMiddleware(t *testing.T) { "last timestamp should be equal to the end of the requested query range") }) } + +func Test_aggregatedMetricQuery(t *testing.T) { + now := time.Now() + serviceMatcher, err := labels.NewMatcher( + labels.MatchEqual, + loghttp_push.LabelServiceName, + "foo", + ) + require.NoError(t, err) + fruitMatcher, err := labels.NewMatcher(labels.MatchNotEqual, "fruit", "apple") + require.NoError(t, err) + colorMatcher, err := labels.NewMatcher(labels.MatchRegexp, "color", "green") + require.NoError(t, err) + + t.Run("it uses service name if present in original matcher", func(t *testing.T) { + query := &aggregatedMetricQuery{ + matchers: []*labels.Matcher{serviceMatcher}, + start: now.Add(-1 * time.Hour), + end: now, + } + + expected := fmt.Sprintf( + `sum by (service_name) (sum_over_time({%s="foo"} | logfmt | unwrap bytes(bytes) | __error__=""[1h0m0s]))`, + loghttp_push.AggregatedMetricLabel, + ) + require.Equal(t, expected, query.BuildQuery()) + }) + + t.Run("it includes addtional matchers as line filters", func(t *testing.T) { + query := &aggregatedMetricQuery{ + matchers: []*labels.Matcher{serviceMatcher, fruitMatcher}, + start: now.Add(-30 * time.Minute), + end: now, + } + + expected := fmt.Sprintf( + `sum by (service_name) (sum_over_time({%s="foo"} | logfmt | fruit!="apple" | unwrap bytes(bytes) | __error__=""[30m0s]))`, + loghttp_push.AggregatedMetricLabel, + ) + require.Equal(t, expected, query.BuildQuery()) + }) + + t.Run("preserves the matcher type for service name", func(t *testing.T) { + serviceMatcher, err := labels.NewMatcher( + labels.MatchRegexp, + loghttp_push.LabelServiceName, + "foo", + ) + require.NoError(t, err) + query := &aggregatedMetricQuery{ + matchers: []*labels.Matcher{serviceMatcher}, + start: now.Add(-1 * time.Hour), + end: now, + } + + expected := fmt.Sprintf( + `sum by (service_name) (sum_over_time({%s=~"foo"} | logfmt | unwrap bytes(bytes) | __error__=""[1h0m0s]))`, + loghttp_push.AggregatedMetricLabel, + ) + require.Equal(t, expected, query.BuildQuery()) + }) + + t.Run("preserves the matcher type for additional matchers", func(t *testing.T) { + query := &aggregatedMetricQuery{ + matchers: []*labels.Matcher{serviceMatcher, fruitMatcher, colorMatcher}, + start: now.Add(-5 * time.Minute), + end: now, + } + + expected := fmt.Sprintf( + `sum by (service_name) (sum_over_time({%s="foo"} | logfmt | fruit!="apple" | color=~"green" | unwrap bytes(bytes) | __error__=""[5m0s]))`, + loghttp_push.AggregatedMetricLabel, + ) + require.Equal(t, expected, query.BuildQuery()) + }) + + t.Run( + "if service_name is not present, it uses a wildcard matcher and aggregated by the first matcher", + func(t *testing.T) { + query := &aggregatedMetricQuery{ + matchers: []*labels.Matcher{fruitMatcher, colorMatcher}, + start: now.Add(-30 * time.Minute).Add(-5 * time.Second), + end: now, + } + + expected := fmt.Sprintf( + `sum by (fruit) (sum_over_time({%s=~".+"} | logfmt | fruit!="apple" | color=~"green" | unwrap bytes(bytes) | __error__=""[30m5s]))`, + loghttp_push.AggregatedMetricLabel, + ) + require.Equal(t, expected, query.BuildQuery()) + }, + ) + + t.Run("it aggregates by aggregate_by when provided", func(t *testing.T) { + query := &aggregatedMetricQuery{ + matchers: []*labels.Matcher{fruitMatcher, colorMatcher}, + start: now.Add(-30 * time.Minute), + end: now, + aggregateBy: "color,fruit", + } + + expected := fmt.Sprintf( + `sum by (color,fruit) (sum_over_time({%s=~".+"} | logfmt | fruit!="apple" | color=~"green" | unwrap bytes(bytes) | __error__=""[30m0s]))`, + loghttp_push.AggregatedMetricLabel, + ) + require.Equal(t, expected, query.BuildQuery()) + + query = &aggregatedMetricQuery{ + matchers: []*labels.Matcher{serviceMatcher}, + start: now.Add(-5 * time.Second), + end: now, + aggregateBy: "fruit", + } + + expected = fmt.Sprintf( + `sum by (fruit) (sum_over_time({%s="foo"} | logfmt | unwrap bytes(bytes) | __error__=""[5s]))`, + loghttp_push.AggregatedMetricLabel, + ) + require.Equal(t, expected, query.BuildQuery()) + }) +}