Loki: Fix setting of tenant ID (#86433)

This commit is contained in:
Fabrizio 2024-04-22 22:02:56 +02:00 committed by GitHub
parent c32953e52c
commit 0b2e748bd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -367,7 +367,7 @@ func setXScopeOrgIDHeader(req *http.Request, ctx context.Context) *http.Request
if len(tenantids) == 0 {
// We assume we are not using multi-tenant mode, which is fine
logger.Debug("Tenant ID not present. Header not set")
} else if len(tenantids[0]) > 1 {
} else if len(tenantids) > 1 {
// Loki supports multiple tenant IDs, but we should receive them from different contexts
logger.Error(strconv.Itoa(len(tenantids)) + " tenant IDs found. Header not set")
} else {