Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise "About tenant IDs" #1158

Merged
merged 3 commits into from
Feb 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions docs/sources/about-tenant-ids.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
title: "About tenant IDs"
description: ""
weight: 100
weight: 10
---

# About tenant IDs

The tenant ID (also called "user ID" or "org ID") is the unique identifier of a tenant within a Grafana Mimir cluster. The tenant ID is an opaque information to Grafana Mimir, which doesn't make any assumption on its format/content, but its naming has two limitations:
The tenant ID is the unique identifier of a tenant within a Grafana Mimir cluster.
For information about how Grafana Mimir components use tenant IDs, refer to [About authentication and authorization]({{<relref "./about-authentication-and-authorization.md" >}}).

1. Supported characters
2. Length
## Restrictions

## Supported characters

The following character sets are generally **safe for use in the tenant ID**:
Tenant IDs must be less-than or equal-to 150 bytes/characters in length and must comprise only supported characters:

- Alphanumeric characters
- `0-9`
Expand All @@ -23,14 +21,12 @@ The following character sets are generally **safe for use in the tenant ID**:
- Exclamation point (`!`)
- Hyphen (`-`)
- Underscore (`_`)
- Single Period (`.`), but the tenant IDs `.` and `..` are considered invalid
- Single Period (`.`)
- Asterisk (`*`)
- Single quote (`'`)
- Open parenthesis (`(`)
- Close parenthesis (`)`)

All other characters are not safe to use. In particular, slashes `/` and whitespaces (` `) are **not supported**.

## Length
> **Note:** For security reasons, `.` and `..` aren't valid tenant IDs.

The tenant ID length should not exceed 150 bytes/characters.
All other characters, including slashes and whitespace, aren't supported.
2 changes: 0 additions & 2 deletions docs/sources/configuration/about-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Grafana Mimir strives to be 100% API compatible with Prometheus (under `/prometh
- Additional API around pushing metrics (under `/prometheus/api/push`).
- Additional API endpoints for management of Grafana Mimir itself, such as the ring. These APIs are not part of the any compatibility guarantees.

_For more information, please refer to the [limitations](../guides/limitations.md) doc._

## Experimental features

Grafana Mimir is an actively developed project and we want to encourage the introduction of new features and capabilities. As such, not everything in each release of Grafana Mimir is considered "production-ready". Features not considered "production-ready" and the flags used to enable and/or configure these features will be marked "Experimental". There are no backwards compatibility guarantees on anything marked experimental. Configuration and flags are subject to change.
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ A tenant (also called "user" or "org") is the owner of a set of series written t
For more information, please refer to:

- [HTTP API authentication](../api/_index.md#authentication)
- [Tenant ID limitations](./limitations.md#tenant-id-naming)
- [About tenant IDs]({{<relref "./about-tenant-ids.md" >}})

### Time series

Expand Down
2 changes: 1 addition & 1 deletion pkg/tenant/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ type MultiResolver struct {
// NewMultiResolver creates a tenant resolver, which allows request to have
// multiple tenant ids submitted separated by a '|' character. This enforces
// further limits on the character set allowed within tenants as detailed here:
// https://github.com/grafana/mimir/blob/main/docs/sources/guides/limitations.md)
// https://github.com/grafana/mimir/blob/main/docs/sources/about-tenant-ids.md
func NewMultiResolver() *MultiResolver {
return &MultiResolver{}
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/tenant/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ func JoinTenantIDs(tenantIDs []string) string {
return strings.Join(tenantIDs, tenantIDsLabelSeparator)
}

// this checks if a rune is supported in tenant IDs (according to
// https://github.com/grafana/mimir/blob/main/docs/sources/guides/limitations.md)
// This checks if a rune is supported in tenant IDs according to the rules
// documented in "About tenant IDs":
// https://github.com/grafana/mimir/blob/main/docs/sources/about-tenant-ids.md
func isSupported(c rune) bool {
// characters
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') {
Expand Down