Skip to content

Commit 5d10c2a

Browse files
authored
chore: refine metastore API (#3502)
1 parent 987f743 commit 5d10c2a

30 files changed

+777
-500
lines changed

api/gen/proto/go/metastore/v1/metastore.pb.go

Lines changed: 172 additions & 163 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go

Lines changed: 183 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/metastore/v1/metastore.proto

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ syntax = "proto3";
22

33
package metastore.v1;
44

5+
import "types/v1/types.proto";
6+
57
service MetastoreService {
68
rpc AddBlock(AddBlockRequest) returns (AddBlockResponse) {}
7-
rpc ListBlocksForQuery(ListBlocksForQueryRequest) returns (ListBlocksForQueryResponse) {}
9+
rpc QueryMetadata(QueryMetadataRequest) returns (QueryMetadataResponse) {}
810
rpc ReadIndex(ReadIndexRequest) returns (ReadIndexResponse) {}
911
}
1012

@@ -23,14 +25,13 @@ message BlockMeta {
2325
uint32 compaction_level = 6;
2426
// Optional. Empty if compaction level is 0.
2527
string tenant_id = 7;
26-
// TODO(kolesnikovae): Partitions with labels?
27-
repeated TenantService tenant_services = 8;
28+
repeated Dataset datasets = 8;
2829
uint64 size = 9;
2930
}
3031

31-
// TenantService object points to the offset in the block at which
32-
// the tenant service data is located.
33-
message TenantService {
32+
message Dataset {
33+
repeated types.v1.Labels labels = 8;
34+
3435
string tenant_id = 1;
3536
string name = 2;
3637
int64 min_time = 3;
@@ -47,18 +48,20 @@ message TenantService {
4748
repeated uint64 table_of_contents = 5;
4849
// Size of the section in bytes.
4950
uint64 size = 6;
51+
52+
// TODO: delete
5053
// Profile types present in the tenant service data.
5154
repeated string profile_types = 7;
5255
}
5356

54-
message ListBlocksForQueryRequest {
57+
message QueryMetadataRequest {
5558
repeated string tenant_id = 1;
5659
int64 start_time = 2;
5760
int64 end_time = 3;
5861
string query = 4;
5962
}
6063

61-
message ListBlocksForQueryResponse {
64+
message QueryMetadataResponse {
6265
repeated BlockMeta blocks = 1;
6366
}
6467

api/openapiv2/gen/phlare.swagger.json

Lines changed: 61 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -656,13 +656,12 @@
656656
"type": "string",
657657
"description": "Optional. Empty if compaction level is 0."
658658
},
659-
"tenantServices": {
659+
"datasets": {
660660
"type": "array",
661661
"items": {
662662
"type": "object",
663-
"$ref": "#/definitions/v1TenantService"
664-
},
665-
"title": "TODO(kolesnikovae): Partitions with labels?"
663+
"$ref": "#/definitions/v1Dataset"
664+
}
666665
},
667666
"size": {
668667
"type": "string",
@@ -829,6 +828,52 @@
829828
}
830829
}
831830
},
831+
"v1Dataset": {
832+
"type": "object",
833+
"properties": {
834+
"labels": {
835+
"type": "array",
836+
"items": {
837+
"type": "object",
838+
"$ref": "#/definitions/v1Labels"
839+
}
840+
},
841+
"tenantId": {
842+
"type": "string"
843+
},
844+
"name": {
845+
"type": "string"
846+
},
847+
"minTime": {
848+
"type": "string",
849+
"format": "int64"
850+
},
851+
"maxTime": {
852+
"type": "string",
853+
"format": "int64"
854+
},
855+
"tableOfContents": {
856+
"type": "array",
857+
"items": {
858+
"type": "string",
859+
"format": "uint64"
860+
},
861+
"description": "Table of contents lists data sections within the tenant\nservice region. The offsets are absolute.\n\nThe interpretation of the table of contents is specific\nto the metadata format version. By default, the sections are:\n - 0: profiles.parquet\n - 1: index.tsdb\n - 2: symbols.symdb"
862+
},
863+
"size": {
864+
"type": "string",
865+
"format": "uint64",
866+
"description": "Size of the section in bytes."
867+
},
868+
"profileTypes": {
869+
"type": "array",
870+
"items": {
871+
"type": "string"
872+
},
873+
"description": "TODO: delete\nProfile types present in the tenant service data."
874+
}
875+
}
876+
},
832877
"v1Diagnostics": {
833878
"type": "object",
834879
"description": "Diagnostic messages, events, statistics, analytics, etc."
@@ -1240,18 +1285,6 @@
12401285
}
12411286
}
12421287
},
1243-
"v1ListBlocksForQueryResponse": {
1244-
"type": "object",
1245-
"properties": {
1246-
"blocks": {
1247-
"type": "array",
1248-
"items": {
1249-
"type": "object",
1250-
"$ref": "#/definitions/v1BlockMeta"
1251-
}
1252-
}
1253-
}
1254-
},
12551288
"v1Mapping": {
12561289
"type": "object",
12571290
"properties": {
@@ -1519,6 +1552,18 @@
15191552
}
15201553
}
15211554
},
1555+
"v1QueryMetadataResponse": {
1556+
"type": "object",
1557+
"properties": {
1558+
"blocks": {
1559+
"type": "array",
1560+
"items": {
1561+
"type": "object",
1562+
"$ref": "#/definitions/v1BlockMeta"
1563+
}
1564+
}
1565+
}
1566+
},
15221567
"v1QueryPlan": {
15231568
"type": "object",
15241569
"properties": {
@@ -1925,46 +1970,6 @@
19251970
],
19261971
"default": "MERGE_FORMAT_UNSPECIFIED"
19271972
},
1928-
"v1TenantService": {
1929-
"type": "object",
1930-
"properties": {
1931-
"tenantId": {
1932-
"type": "string"
1933-
},
1934-
"name": {
1935-
"type": "string"
1936-
},
1937-
"minTime": {
1938-
"type": "string",
1939-
"format": "int64"
1940-
},
1941-
"maxTime": {
1942-
"type": "string",
1943-
"format": "int64"
1944-
},
1945-
"tableOfContents": {
1946-
"type": "array",
1947-
"items": {
1948-
"type": "string",
1949-
"format": "uint64"
1950-
},
1951-
"description": "Table of contents lists data sections within the tenant\nservice region. The offsets are absolute.\n\nThe interpretation of the table of contents is specific\nto the metadata format version. By default, the sections are:\n - 0: profiles.parquet\n - 1: index.tsdb\n - 2: symbols.symdb"
1952-
},
1953-
"size": {
1954-
"type": "string",
1955-
"format": "uint64",
1956-
"description": "Size of the section in bytes."
1957-
},
1958-
"profileTypes": {
1959-
"type": "array",
1960-
"items": {
1961-
"type": "string"
1962-
},
1963-
"description": "Profile types present in the tenant service data."
1964-
}
1965-
},
1966-
"description": "TenantService object points to the offset in the block at which\nthe tenant service data is located."
1967-
},
19681973
"v1TimeSeriesAggregationType": {
19691974
"type": "string",
19701975
"enum": [

docs/sources/configure-server/reference-configuration-parameters/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ brackets indicate that a parameter is optional.
3737
- `<prefix>`: a CLI flag prefix based on the context (look at the parent configuration block to see which CLI flags prefix should be used)
3838
- `<relabel_config>`: a [Prometheus relabeling configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config)
3939
- `<time>`: a timestamp, with available formats:
40-
- `2006-01-20` (midnight, local timezone)
41-
- `2006-01-20T15:04` (local timezone)
42-
- RFC 3339 formats: `2006-01-20T15:04:05Z` (UTC) or `2006-01-20T15:04:05+07:00` (explicit timezone)
40+
- `2006-01-20` (midnight, local timezone)
41+
- `2006-01-20T15:04` (local timezone)
42+
- RFC 3339 formats: `2006-01-20T15:04:05Z` (UTC) or `2006-01-20T15:04:05+07:00` (explicit timezone)
4343

4444
## Use environment variables in the configuration
4545

@@ -2259,4 +2259,3 @@ The `filesystem_storage_backend` block configures the usage of local file system
22592259
```
22602260

22612261
```
2262-

pkg/experiment/compactor/compaction_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func (w *Worker) startJob(ctx context.Context, job *compactorv1.CompactionJob) *
255255
"block_compaction_level", c.CompactionLevel,
256256
"block_min_time", c.MinTime,
257257
"block_max_time", c.MinTime,
258-
"tenant_services", len(c.TenantServices))
258+
"datasets", len(c.Datasets))
259259
}
260260

261261
job.Status.Status = compactorv1.CompactionStatus_COMPACTION_STATUS_SUCCESS

0 commit comments

Comments
 (0)