fix boltdb shipper local query in logcli and support `fake` tenant (#6282)

Signed-off-by: Edward Welch <edward.welch@grafana.com>
pull/6287/head
Ed Welch 4 years ago committed by GitHub
parent d91a64f910
commit b5f0557e79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      pkg/logcli/query/query.go

@ -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
@ -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 {

Loading…
Cancel
Save