diff --git a/go.mod b/go.mod index 86c032356b4..a6a6be78474 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/golang/snappy v0.0.4 github.com/google/gopacket v1.1.19 github.com/gorilla/mux v1.8.1 - github.com/grafana/dskit v0.0.0-20240704113758-97b2aa96bcb1 + github.com/grafana/dskit v0.0.0-20240712071108-b834d6b908f5 github.com/grafana/e2e v0.1.2-0.20240118170847-db90b84177fc github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/json-iterator/go v1.1.12 diff --git a/go.sum b/go.sum index 75728270bc7..d36d1d6068c 100644 --- a/go.sum +++ b/go.sum @@ -515,8 +515,8 @@ github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc h1:PXZQA2WCxe85T github.com/grafana-tools/sdk v0.0.0-20220919052116-6562121319fc/go.mod h1:AHHlOEv1+GGQ3ktHMlhuTUwo3zljV3QJbC0+8o2kn+4= github.com/grafana/alerting v0.0.0-20240708204730-284b8fe16cff h1:okOj0w7kyIfrENSFGVXTjn3aSiS2QUcqwDozQkoKdH0= github.com/grafana/alerting v0.0.0-20240708204730-284b8fe16cff/go.mod h1:DLj8frbtCaITljC2jc0L85JQViPF3mPfOSiYhm1osso= -github.com/grafana/dskit v0.0.0-20240704113758-97b2aa96bcb1 h1:Hf7Swe4Vr+makVm+TSym1u0QMolxMQ1/L9gm1Pzdq5I= -github.com/grafana/dskit v0.0.0-20240704113758-97b2aa96bcb1/go.mod h1:UA1BG0yY/B7lTcdeqoud+3/TglKmPL88OM5qCeRs8BU= +github.com/grafana/dskit v0.0.0-20240712071108-b834d6b908f5 h1:lX7Wea15AnBS0QVwZm4dWdJmSgjF4HmNkHxyiGF3/qc= +github.com/grafana/dskit v0.0.0-20240712071108-b834d6b908f5/go.mod h1:UA1BG0yY/B7lTcdeqoud+3/TglKmPL88OM5qCeRs8BU= github.com/grafana/e2e v0.1.2-0.20240118170847-db90b84177fc h1:BW+LjKJDz0So5LI8UZfW5neWeKpSkWqhmGjQFzcFfLM= github.com/grafana/e2e v0.1.2-0.20240118170847-db90b84177fc/go.mod h1:JVmqPBe8A/pZWwRoJW5ZjyALeY5OXMzPl7LrVXOdZAI= github.com/grafana/goautoneg v0.0.0-20240607115440-f335c04c58ce h1:WI1olbgS+sEl77qxEYbmt9TgRUz7iLqmjh8lYPpGlKQ= diff --git a/vendor/github.com/grafana/dskit/cache/client.go b/vendor/github.com/grafana/dskit/cache/client.go index 85551875165..033d2add605 100644 --- a/vendor/github.com/grafana/dskit/cache/client.go +++ b/vendor/github.com/grafana/dskit/cache/client.go @@ -86,6 +86,7 @@ func newClientMetrics(reg prometheus.Registerer) *clientMetrics { Help: "Total number of operations against cache that failed.", }, []string{"operation", "reason"}) for _, op := range []string{opGetMulti, opSet, opDelete, opIncrement, opFlush, opTouch, opCompareAndSwap} { + cm.failures.WithLabelValues(op, reasonConnectTimeout) cm.failures.WithLabelValues(op, reasonTimeout) cm.failures.WithLabelValues(op, reasonMalformedKey) cm.failures.WithLabelValues(op, reasonServerError) diff --git a/vendor/github.com/grafana/dskit/tenant/resolver.go b/vendor/github.com/grafana/dskit/tenant/resolver.go index 35e95b1c831..9a01d6322c9 100644 --- a/vendor/github.com/grafana/dskit/tenant/resolver.go +++ b/vendor/github.com/grafana/dskit/tenant/resolver.go @@ -16,7 +16,18 @@ import ( // //nolint:revive func TenantID(ctx context.Context) (string, error) { - orgIDs, err := TenantIDs(ctx) + //lint:ignore faillint wrapper around upstream method + orgID, err := user.ExtractOrgID(ctx) + if err != nil { + return "", err + } + if !strings.Contains(orgID, tenantIDsSeparator) { + if err := ValidTenantID(orgID); err != nil { + return "", err + } + return orgID, nil + } + orgIDs, err := tenantIDsFromString(orgID) if err != nil { return "", err } @@ -42,6 +53,10 @@ func TenantIDs(ctx context.Context) ([]string, error) { return nil, err } + return tenantIDsFromString(orgID) +} + +func tenantIDsFromString(orgID string) ([]string, error) { orgIDs := strings.Split(orgID, tenantIDsSeparator) for _, id := range orgIDs { if err := ValidTenantID(id); err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index 991ad981d22..53d9687df26 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -610,7 +610,7 @@ github.com/grafana/alerting/receivers/webex github.com/grafana/alerting/receivers/webhook github.com/grafana/alerting/receivers/wecom github.com/grafana/alerting/templates -# github.com/grafana/dskit v0.0.0-20240704113758-97b2aa96bcb1 +# github.com/grafana/dskit v0.0.0-20240712071108-b834d6b908f5 ## explicit; go 1.21 github.com/grafana/dskit/backoff github.com/grafana/dskit/ballast