Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
migrate orgId for public data to 0
Browse files Browse the repository at this point in the history
this will allow us to use uint encoding for org id's

fix #260
  • Loading branch information
Dieterbe committed Apr 4, 2018
1 parent dee84b1 commit 5db1111
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/http-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ POST /metrics/index.json

* header `X-Org-Id` required

Returns metrics stored under the given org, as well as public data under org -1 (see [multi-tenancy](https://github.com/grafana/metrictank/blob/master/docs/multi-tenancy.md))
Returns metrics stored under the given org, as well as public data under org 0 (see [multi-tenancy](https://github.com/grafana/metrictank/blob/master/docs/multi-tenancy.md))

#### Example

Expand All @@ -56,7 +56,7 @@ POST /metrics/find
* format: json, treejson, completer, pickle, or msgpack. (defaults to json)
* jsonp

Returns metrics which match the query and are stored under the given org or are public data under org -1 (see [multi-tenancy](https://github.com/grafana/metrictank/blob/master/docs/multi-tenancy.md))
Returns metrics which match the query and are stored under the given org or are public data under org 0 (see [multi-tenancy](https://github.com/grafana/metrictank/blob/master/docs/multi-tenancy.md))
the completer format is for completion UI's such as graphite-web.
json and treejson are the same.

Expand Down Expand Up @@ -112,7 +112,7 @@ POST /render

If metrictank doesn't have a requested function, it always proxies to graphite, irrespective of this setting.

Data queried for must be stored under the given org or be public data under org -1 (see [multi-tenancy](https://github.com/grafana/metrictank/blob/master/docs/multi-tenancy.md))
Data queried for must be stored under the given org or be public data under org 0 (see [multi-tenancy](https://github.com/grafana/metrictank/blob/master/docs/multi-tenancy.md))

#### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/multi-tenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ A metrictank based stack is multi-tenant. Here's how it works:
* For a secure setup, you must make sure these headers cannot be specified by users. You may need to run something in front to set the header correctly after authentication
(e.g. [tsdb-gw](https://github.com/raintank/tsdb-gw)
* orgs can only see the data that lives under their org-id, and also public data
* public data is stored under orgId -1 and is visible to everyone.
* public data is stored under orgId 0 and is visible to everyone.
2 changes: 1 addition & 1 deletion idx/idx.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
schema "gopkg.in/raintank/schema.v1"
)

const OrgIdPublic = -1
const OrgIdPublic = 0

var (
BothBranchAndLeaf = errors.New("node can't be both branch and leaf")
Expand Down

0 comments on commit 5db1111

Please sign in to comment.