Skip to content

Commit

Permalink
Format proto defintions
Browse files Browse the repository at this point in the history
  • Loading branch information
simonswine committed Apr 6, 2022
1 parent e2eb926 commit 420fc04
Show file tree
Hide file tree
Showing 16 changed files with 455 additions and 399 deletions.
28 changes: 19 additions & 9 deletions pkg/ingester/checkpoint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ import "pkg/logproto/logproto.proto";
// Chunk is a {de,}serializable intermediate type for chunkDesc which allows
// efficient loading/unloading to disk during WAL checkpoint recovery.
message Chunk {
google.protobuf.Timestamp from = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp to = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp flushedAt = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp lastUpdated = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp from = 1
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
google.protobuf.Timestamp to = 2
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
google.protobuf.Timestamp flushedAt = 3
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
google.protobuf.Timestamp lastUpdated = 4
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
bool closed = 5;
bool synced = 6;
// data to be unmarshaled into a MemChunk
Expand All @@ -26,17 +30,23 @@ message Chunk {
// Series is a {de,}serializable intermediate type for Series.
message Series {
string userID = 1;
// post mapped fingerprint is necessary because subsequent wal writes will reference it.
// post mapped fingerprint is necessary because subsequent wal writes will
// reference it.
uint64 fingerprint = 2;
repeated logproto.LegacyLabelPair labels = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/loki/pkg/logproto.LabelAdapter"];
repeated Chunk chunks = 4 [(gogoproto.nullable) = false];
repeated logproto.LegacyLabelPair labels = 3 [
(gogoproto.nullable) = false,
(gogoproto.customtype) = "github.com/grafana/loki/pkg/logproto.LabelAdapter"
];
repeated Chunk chunks = 4 [ (gogoproto.nullable) = false ];
// most recently pushed timestamp.
google.protobuf.Timestamp to = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp to = 5
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
// most recently pushed line.
string lastLine = 6;
// highest counter value for pushes to this stream.
// Used to skip already applied entries during WAL replay.
int64 entryCt = 7;
// highest timestamp pushed to this stream.
google.protobuf.Timestamp highestTs = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp highestTs = 8
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];
}
64 changes: 28 additions & 36 deletions pkg/ingester/client/ingester.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ service Ingester {
rpc LabelNames(LabelNamesRequest) returns (LabelNamesResponse) {};
rpc UserStats(UserStatsRequest) returns (UserStatsResponse) {};
rpc AllUserStats(UserStatsRequest) returns (UsersStatsResponse) {};
rpc MetricsForLabelMatchers(MetricsForLabelMatchersRequest) returns (MetricsForLabelMatchersResponse) {};
rpc MetricsMetadata(MetricsMetadataRequest) returns (MetricsMetadataResponse) {};
rpc MetricsForLabelMatchers(MetricsForLabelMatchersRequest)
returns (MetricsForLabelMatchersResponse) {};
rpc MetricsMetadata(MetricsMetadataRequest)
returns (MetricsMetadataResponse) {};

// TransferChunks allows leaving ingester (client) to stream chunks directly to joining ingesters (server).
rpc TransferChunks(stream TimeSeriesChunk) returns (TransferChunksResponse) {};
// TransferChunks allows leaving ingester (client) to stream chunks directly
// to joining ingesters (server).
rpc TransferChunks(stream TimeSeriesChunk) returns (TransferChunksResponse) {
};
}

message ReadRequest {
repeated QueryRequest queries = 1;
}
message ReadRequest { repeated QueryRequest queries = 1; }

message ReadResponse {
repeated QueryResponse results = 1;
}
message ReadResponse { repeated QueryResponse results = 1; }

message QueryRequest {
int64 start_timestamp_ms = 1;
Expand All @@ -49,17 +49,18 @@ message ExemplarQueryRequest {
}

message QueryResponse {
repeated logproto.TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
repeated logproto.TimeSeries timeseries = 1 [ (gogoproto.nullable) = false ];
}

// QueryStreamResponse contains a batch of timeseries chunks or timeseries. Only one of these series will be populated.
// QueryStreamResponse contains a batch of timeseries chunks or timeseries. Only
// one of these series will be populated.
message QueryStreamResponse {
repeated TimeSeriesChunk chunkseries = 1 [(gogoproto.nullable) = false];
repeated logproto.TimeSeries timeseries = 2 [(gogoproto.nullable) = false];
repeated TimeSeriesChunk chunkseries = 1 [ (gogoproto.nullable) = false ];
repeated logproto.TimeSeries timeseries = 2 [ (gogoproto.nullable) = false ];
}

message ExemplarQueryResponse {
repeated logproto.TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
repeated logproto.TimeSeries timeseries = 1 [ (gogoproto.nullable) = false ];
}

message LabelValuesRequest {
Expand All @@ -69,18 +70,14 @@ message LabelValuesRequest {
LabelMatchers matchers = 4;
}

message LabelValuesResponse {
repeated string label_values = 1;
}
message LabelValuesResponse { repeated string label_values = 1; }

message LabelNamesRequest {
int64 start_timestamp_ms = 1;
int64 end_timestamp_ms = 2;
}

message LabelNamesResponse {
repeated string label_names = 1;
}
message LabelNamesResponse { repeated string label_names = 1; }

message UserStatsRequest {}

Expand All @@ -96,22 +93,17 @@ message UserIDStatsResponse {
UserStatsResponse data = 2;
}

message UsersStatsResponse {
repeated UserIDStatsResponse stats = 1;
}
message UsersStatsResponse { repeated UserIDStatsResponse stats = 1; }

message MetricsForLabelMatchersRequest {
int64 start_timestamp_ms = 1;
int64 end_timestamp_ms = 2;
repeated LabelMatchers matchers_set = 3;
}

message MetricsForLabelMatchersResponse {
repeated logproto.Metric metric = 1;
}
message MetricsForLabelMatchersResponse { repeated logproto.Metric metric = 1; }

message MetricsMetadataRequest {
}
message MetricsMetadataRequest {}

message MetricsMetadataResponse {
repeated logproto.MetricMetadata metadata = 1;
Expand All @@ -120,8 +112,11 @@ message MetricsMetadataResponse {
message TimeSeriesChunk {
string from_ingester_id = 1;
string user_id = 2;
repeated logproto.LegacyLabelPair labels = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/loki/pkg/logproto.LabelAdapter"];
repeated Chunk chunks = 4 [(gogoproto.nullable) = false];
repeated logproto.LegacyLabelPair labels = 3 [
(gogoproto.nullable) = false,
(gogoproto.customtype) = "github.com/grafana/loki/pkg/logproto.LabelAdapter"
];
repeated Chunk chunks = 4 [ (gogoproto.nullable) = false ];
}

message Chunk {
Expand All @@ -131,12 +126,9 @@ message Chunk {
bytes data = 4;
}

message TransferChunksResponse {
}
message TransferChunksResponse {}

message LabelMatchers {
repeated LabelMatcher matchers = 1;
}
message LabelMatchers { repeated LabelMatcher matchers = 1; }

enum MatchType {
EQUAL = 0;
Expand Down
Loading

0 comments on commit 420fc04

Please sign in to comment.