mirror of https://github.com/grafana/loki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
227 lines
8.3 KiB
227 lines
8.3 KiB
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/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";
|
|
|
|
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"];
|
|
}
|
|
|
|
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"];
|
|
}
|
|
|
|
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"];
|
|
}
|
|
|
|
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"];
|
|
}
|
|
|
|
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 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;
|
|
DetectedLabelsResponse detectedLabels = 12;
|
|
}
|
|
}
|
|
|
|
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.DetectedLabelsRequest detectedLabels = 10;
|
|
}
|
|
map<string, string> metadata = 7 [(gogoproto.nullable) = false];
|
|
}
|
|
|