Skip to content

Commit

Permalink
add local backend to cli (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvernaz committed Nov 2, 2020
1 parent 077fd13 commit 806439d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions cmd/tempo-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/google/uuid"
tempodb_backend "github.com/grafana/tempo/tempodb/backend"
"github.com/grafana/tempo/tempodb/backend/local"
"github.com/grafana/tempo/tempodb/encoding"

"github.com/grafana/tempo/pkg/util"
Expand Down Expand Up @@ -101,19 +102,27 @@ func main() {
}

func getBackendUtils(backend, bucket, s3Endpoint, s3User, s3Pass string) (tempodb_backend.Reader, tempodb_backend.Writer, tempodb_backend.Compactor, error) {
if backend == "s3" {
switch backend {
case "s3":
return s3.New(&s3.Config{
Bucket: bucket,
Endpoint: s3Endpoint,
AccessKey: s3User,
SecretKey: s3Pass,
Insecure: true,
})
case "gcs":
return gcs.New(&gcs.Config{
BucketName: bucket,
ChunkBufferSize: 10 * 1024 * 1024,
})
case "local":
return local.New(&local.Config{
Path: bucket,
})
default:
return nil, nil, nil, fmt.Errorf("unknown backend %s", backend)
}
return gcs.New(&gcs.Config{
BucketName: bucket,
ChunkBufferSize: 10 * 1024 * 1024,
})
}

func dumpBlock(r tempodb_backend.Reader, c tempodb_backend.Compactor, tenantID string, windowRange time.Duration, blockID string) error {
Expand Down

0 comments on commit 806439d

Please sign in to comment.