Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit 8262108

Browse files
Add store-gateway components (#701)
This PR adds a store-gateway component similar to what exists in Mimir. https://github.com/grafana/mimir/blob/main/pkg/storegateway/gateway.go This is still very early, so far I've decided to depends on Mimir to benefits from the shuffle sharding and replication strategy. I'm not planning to provide any block persistence for now only in-memory. In the future we should use memcached for symbols and tsdb index. The store gateway open block for each tenant within 24h - (now -2h). Since we don't have a compactor a single gateway can download data duplicated by the replication factor of ingesters. This means we need to deduplicate blocks data while streaming now. To speed this up I've implemented a BufferedIterator that helps merging multiple iterator in parallel. In the future we should probably only download compacted blocks. For now we always deduplicate even in the ingester code even though no duplication happens there, the PR was big enough and I don't think it's a big concern right now. The store-gateway also replicate data for high availability which means more duplicates are sent to queriers. We should consider sending block ULID and request querier to select the one to consider. To keep thing simple for the query path right now, we split the queries using the queryStoreAfter configuration. Ultimately if we dedupe by blocks we should be able to remove that configuration and select blocks that needs to be querier from the querier directly. --------- Co-authored-by: Christian Simon <simon@swine.de>
1 parent 9f19269 commit 8262108

File tree

99 files changed

+8512
-1940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+8512
-1940
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ bin
88
*.out
99

1010
/cmd/phlare/data
11+
pyroscope-sync/
1112
data/
1213
.DS_Store
1314
**/dist

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ reference-help: build
222222

223223
$(BIN)/buf: Makefile
224224
@mkdir -p $(@D)
225-
GOBIN=$(abspath $(@D)) $(GO) install github.com/bufbuild/buf/cmd/buf@v1.5.0
225+
GOBIN=$(abspath $(@D)) $(GO) install github.com/bufbuild/buf/cmd/buf@v1.20.0
226226

227227
$(BIN)/golangci-lint: Makefile
228228
@mkdir -p $(@D)
@@ -242,7 +242,7 @@ $(BIN)/protoc-gen-connect-go-mux: Makefile go.mod
242242

243243
$(BIN)/protoc-gen-go-vtproto: Makefile go.mod
244244
@mkdir -p $(@D)
245-
GOBIN=$(abspath $(@D)) $(GO) install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@v0.3.0
245+
GOBIN=$(abspath $(@D)) $(GO) install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@v0.4.0
246246

247247
$(BIN)/protoc-gen-openapiv2: Makefile go.mod
248248
@mkdir -p $(@D)
@@ -348,7 +348,7 @@ deploy: $(BIN)/kind $(BIN)/helm docker-image/phlare/build
348348

349349
.PHONY: deploy-micro-services
350350
deploy-micro-services: $(BIN)/kind $(BIN)/helm docker-image/phlare/build
351-
$(call deploy,phlare-micro-services,--values=operations/phlare/helm/phlare/values-micro-services.yaml --set phlare.components.querier.resources=null --set phlare.components.distributor.resources=null --set phlare.components.ingester.resources=null)
351+
$(call deploy,phlare-micro-services,--values=operations/phlare/helm/phlare/values-micro-services.yaml --set phlare.components.querier.resources=null --set phlare.components.distributor.resources=null --set phlare.components.ingester.resources=null --set phlare.components.store-gateway.resources=null)
352352

353353
.PHONY: deploy-monitoring
354354
deploy-monitoring: $(BIN)/tk $(BIN)/kind tools/monitoring/environments/default/spec.json

api/agent/v1/agent.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import "google/protobuf/timestamp.proto";
1010
service AgentService {
1111
// Retrieve information about targets.
1212
rpc GetTargets(GetTargetsRequest) returns (GetTargetsResponse) {
13-
option (google.api.http) = {
14-
get: "/api/v1/targets"
15-
};
13+
option (google.api.http) = {get: "/api/v1/targets"};
1614
}
1715
}
1816

api/buf.gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ plugins:
1515
out: gen/proto/go
1616
opt:
1717
- paths=source_relative
18-
- features=marshal+unmarshal+size+pool+grpc+pool
18+
- features=marshal+unmarshal+size+pool+grpc+pool+clone
1919
- pool=github.com/grafana/phlare/api/gen/proto/go/google/v1.Profile
2020
- pool=github.com/grafana/phlare/api/gen/proto/go/google/v1.Sample
2121

api/gen/proto/go/agent/v1/agent_vtproto.pb.go

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

0 commit comments

Comments
 (0)