syntax = "proto3"; package queryrange; import "github.com/gogo/googleapis/google/rpc/status.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "pkg/logproto/indexgateway.proto"; import "pkg/logproto/logproto.proto"; import "pkg/logproto/pattern.proto"; import "pkg/logproto/sketch.proto"; import "pkg/logqlmodel/stats/stats.proto"; import "pkg/push/push.proto"; import "pkg/querier/queryrange/queryrangebase/definitions/definitions.proto"; import "pkg/querier/queryrange/queryrangebase/queryrange.proto"; import "pkg/storage/chunk/cache/resultscache/types.proto"; option go_package = "github.com/grafana/loki/v3/pkg/querier/queryrange"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; message LokiRequest { string query = 1; // mark as reserved once we've fully migrated to plan. uint32 limit = 2; int64 step = 3; int64 interval = 9; google.protobuf.Timestamp startTs = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; google.protobuf.Timestamp endTs = 5 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; logproto.Direction direction = 6; string path = 7; repeated string shards = 8 [(gogoproto.jsontag) = "shards"]; Plan plan = 10 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"]; // If populated, these represent the chunk references that the querier should // use to fetch the data, plus any other chunks reported by ingesters. logproto.ChunkRefGroup storeChunks = 11 [(gogoproto.jsontag) = "storeChunks"]; resultscache.CachingOptions cachingOptions = 12 [(gogoproto.nullable) = false]; } message LokiInstantRequest { string query = 1; uint32 limit = 2; google.protobuf.Timestamp timeTs = 3 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; logproto.Direction direction = 4; string path = 5; repeated string shards = 6 [(gogoproto.jsontag) = "shards"]; Plan plan = 7 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"]; // If populated, these represent the chunk references that the querier should // use to fetch the data, plus any other chunks reported by ingesters. logproto.ChunkRefGroup storeChunks = 8 [(gogoproto.jsontag) = "storeChunks"]; resultscache.CachingOptions cachingOptions = 9 [(gogoproto.nullable) = false]; } message Plan { bytes raw = 1; } message LokiResponse { string Status = 1 [(gogoproto.jsontag) = "status"]; LokiData Data = 2 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "data,omitempty" ]; string ErrorType = 3 [(gogoproto.jsontag) = "errorType,omitempty"]; string Error = 4 [(gogoproto.jsontag) = "error,omitempty"]; logproto.Direction direction = 5; uint32 limit = 6; uint32 version = 7; stats.Result statistics = 8 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "statistics" ]; repeated definitions.PrometheusResponseHeader Headers = 9 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; repeated string warnings = 10 [(gogoproto.jsontag) = "warnings,omitempty"]; } message LokiSeriesRequest { repeated string match = 1; google.protobuf.Timestamp startTs = 2 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; google.protobuf.Timestamp endTs = 3 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; string path = 4; repeated string shards = 5 [(gogoproto.jsontag) = "shards"]; } message LokiSeriesResponse { string Status = 1 [(gogoproto.jsontag) = "status"]; repeated logproto.SeriesIdentifier Data = 2 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "data,omitempty" ]; uint32 version = 3; repeated definitions.PrometheusResponseHeader Headers = 4 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; stats.Result statistics = 5 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "statistics" ]; } message LokiLabelNamesResponse { string Status = 1 [(gogoproto.jsontag) = "status"]; repeated string Data = 2 [(gogoproto.jsontag) = "data,omitempty"]; uint32 version = 3; repeated definitions.PrometheusResponseHeader Headers = 4 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; stats.Result statistics = 5 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "statistics" ]; } message LokiData { string ResultType = 1 [(gogoproto.jsontag) = "resultType"]; repeated logproto.StreamAdapter Result = 2 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "result", (gogoproto.customtype) = "github.com/grafana/loki/pkg/push.Stream" ]; } // LokiPromResponse wraps a Prometheus response with statistics. message LokiPromResponse { queryrangebase.PrometheusResponse response = 1 [(gogoproto.nullable) = true]; stats.Result statistics = 2 [(gogoproto.nullable) = false]; } message IndexStatsResponse { logproto.IndexStatsResponse response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.IndexStatsResponse"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; } message VolumeResponse { logproto.VolumeResponse response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.VolumeResponse"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; } message TopKSketchesResponse { logproto.TopKMatrix response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.TopKMatrix"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; repeated string warnings = 3 [(gogoproto.jsontag) = "warnings,omitempty"]; stats.Result statistics = 4 [(gogoproto.nullable) = false]; } message QuantileSketchResponse { logproto.QuantileSketchMatrix response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.QuantileSketchMatrix"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; repeated string warnings = 3 [(gogoproto.jsontag) = "warnings,omitempty"]; stats.Result statistics = 4 [(gogoproto.nullable) = false]; } message CountMinSketchResponse { logproto.CountMinSketchVector response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.CountMinSketchVector"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; repeated string warnings = 3 [(gogoproto.jsontag) = "warnings,omitempty"]; stats.Result statistics = 4 [(gogoproto.nullable) = false]; } message ShardsResponse { indexgatewaypb.ShardsResponse response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.ShardsResponse"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; } message DetectedFieldsResponse { logproto.DetectedFieldsResponse response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.DetectedFieldsResponse"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; } message QueryPatternsResponse { logproto.QueryPatternsResponse response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.QueryPatternsResponse"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; } message DetectedLabelsResponse { logproto.DetectedLabelsResponse response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logproto.DetectedLabelsResponse"]; repeated definitions.PrometheusResponseHeader Headers = 2 [ (gogoproto.jsontag) = "-", (gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" ]; } message QueryResponse { google.rpc.Status status = 1; oneof response { LokiSeriesResponse series = 2; LokiLabelNamesResponse labels = 3; IndexStatsResponse stats = 4; LokiPromResponse prom = 5; LokiResponse streams = 6; VolumeResponse volume = 7; TopKSketchesResponse topkSketches = 8; QuantileSketchResponse quantileSketches = 9; ShardsResponse shardsResponse = 10; DetectedFieldsResponse detectedFields = 11; QueryPatternsResponse patternsResponse = 12; DetectedLabelsResponse detectedLabels = 13; CountMinSketchResponse countMinSketches = 14; } } message QueryRequest { oneof request { LokiSeriesRequest series = 1; logproto.LabelRequest labels = 2; logproto.IndexStatsRequest stats = 3; LokiInstantRequest instant = 4; LokiRequest streams = 5; logproto.VolumeRequest volume = 6; indexgatewaypb.ShardsRequest shardsRequest = 8; logproto.DetectedFieldsRequest detectedFields = 9; logproto.QueryPatternsRequest patternsRequest = 10; logproto.DetectedLabelsRequest detectedLabels = 11; } map metadata = 7 [(gogoproto.nullable) = false]; }