Like Prometheus, but for logs.
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.
 
 
 
 
 
 
loki/pkg/logproto/indexgateway.proto

87 lines
3.2 KiB

syntax = "proto3";
package indexgatewaypb;
import "gogoproto/gogo.proto";
import "pkg/logproto/logproto.proto";
import "pkg/logqlmodel/stats/stats.proto";
option go_package = "github.com/grafana/loki/v3/pkg/logproto";
// This exists in a different file to retain proto namespacing compatibility with it's prior definition, but has been relocated to the logproto go pkg.
service IndexGateway {
/// QueryIndex reads the indexes required for given query & sends back the batch of rows
/// in rpc streams
rpc QueryIndex(logproto.QueryIndexRequest) returns (stream logproto.QueryIndexResponse);
/// GetChunkRef returns chunk reference that match the provided label matchers
rpc GetChunkRef(logproto.GetChunkRefRequest) returns (logproto.GetChunkRefResponse) {}
rpc GetSeries(logproto.GetSeriesRequest) returns (logproto.GetSeriesResponse) {}
rpc LabelNamesForMetricName(logproto.LabelNamesForMetricNameRequest) returns (logproto.LabelResponse) {}
rpc LabelValuesForMetricName(logproto.LabelValuesForMetricNameRequest) returns (logproto.LabelResponse) {}
// Note: this MUST be the same as the variant defined in
// logproto.proto on the Querier service.
rpc GetStats(logproto.IndexStatsRequest) returns (logproto.IndexStatsResponse) {}
// Note: this MUST be the same as the variant defined in
// logproto.proto on the Querier service.
rpc GetVolume(logproto.VolumeRequest) returns (logproto.VolumeResponse) {}
// GetShards is an optimized implemented shard-planning implementation
// on the index gateway and not on the ingester.
rpc GetShards(ShardsRequest) returns (stream ShardsResponse);
}
message ShardsRequest {
int64 from = 1 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "from"
];
int64 through = 2 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "through"
];
string query = 3 [(gogoproto.jsontag) = "query"];
uint64 targetBytesPerShard = 4 [(gogoproto.jsontag) = "targetBytesPerShard"];
}
message ShardsResponse {
repeated Shard shards = 1 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "shards"
];
stats.Result statistics = 2 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "statistics"
];
// If present, includes the chunk refs for each shard,
// therefore the length will be equal to the length of the `shards` field.
repeated logproto.ChunkRefGroup chunkGroups = 3 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "chunkGroups"
];
}
message Shard {
FPBounds bounds = 1 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "bounds"
];
logproto.IndexStatsResponse stats = 2 [(gogoproto.jsontag) = "stats"];
}
// FPBounds is identical to the definition in `pkg/storage/bloom/v1/bounds.FingerprintBounds`
// which ensures we can cast between them without allocations.
message FPBounds {
uint64 min = 1 [
(gogoproto.casttype) = "github.com/prometheus/common/model.Fingerprint",
(gogoproto.jsontag) = "min"
];
uint64 max = 2 [
(gogoproto.casttype) = "github.com/prometheus/common/model.Fingerprint",
(gogoproto.jsontag) = "max"
];
}