File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 77 "context"
88 "fmt"
99 "net"
10- "net/http"
10+ "net/http"
1111 "os"
1212 "path"
1313 "strconv"
@@ -325,8 +325,12 @@ func runReceive(
325325 httpserver .WithTLSConfig (* conf .httpTLSConfig ),
326326 )
327327 srv .Handle ("/-/downscale" , http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
328- n := dbs .GetTenantsLen ()
328+ tenants := dbs .GetTenants ()
329+ n := len (tenants )
329330 w .Header ().Set ("Tenant-Count" , strconv .Itoa (n ))
331+ for _ , tname := range tenants {
332+ w .Header ().Add ("Tenants" , tname )
333+ }
330334 if n > 0 {
331335 w .WriteHeader (http .StatusTooEarly )
332336 } else {
Original file line number Diff line number Diff line change @@ -122,10 +122,14 @@ func NewMultiTSDB(
122122 return mt
123123}
124124
125- func (t * MultiTSDB ) GetTenantsLen () int {
125+ func (t * MultiTSDB ) GetTenants () [] string {
126126 t .mtx .RLock ()
127+ tenants := make ([]string , 0 , len (t .tenants ))
128+ for tname := range t .tenants {
129+ tenants = append (tenants , tname )
130+ }
127131 defer t .mtx .RUnlock ()
128- return len ( t . tenants )
132+ return tenants
129133}
130134
131135type localClient struct {
You can’t perform that action at this time.
0 commit comments