Skip to content

Commit

Permalink
fix boltdb shipper local query in logcli and support fake tenant (#…
Browse files Browse the repository at this point in the history
…6282)

Signed-off-by: Edward Welch <edward.welch@grafana.com>
  • Loading branch information
slim-bean authored Jun 1, 2022
1 parent d91a64f commit b5f0557
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/logcli/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ type Query struct {
// DoQuery executes the query and prints out the results
func (q *Query) DoQuery(c client.Client, out output.LogOutput, statistics bool) {
if q.LocalConfig != "" {
if err := q.DoLocalQuery(out, statistics, c.GetOrgID()); err != nil {
orgID := c.GetOrgID()
if orgID == "" {
orgID = "fake"
}
if err := q.DoLocalQuery(out, statistics, orgID); err != nil {
log.Fatalf("Query failed: %+v", err)
}
return
Expand Down Expand Up @@ -190,6 +194,7 @@ func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string
}
cm := storage.NewClientMetrics()
conf.StorageConfig.BoltDBShipperConfig.Mode = indexshipper.ModeReadOnly
conf.StorageConfig.BoltDBShipperConfig.IndexGatewayClientConfig.Disabled = true

querier, err := storage.NewStore(conf.StorageConfig, conf.ChunkStoreConfig, conf.SchemaConfig, limits, cm, prometheus.DefaultRegisterer, util_log.Logger)
if err != nil {
Expand Down

0 comments on commit b5f0557

Please sign in to comment.