Skip to content

Commit f21acfc

Browse files
authored
fix: rename org_id to tenant_id (#23)
1 parent e1efa24 commit f21acfc

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ If needed, the `PYROSCOPE_AUTH_TOKEN` can be supplied.
2323
For a complete list of variables check the section below.
2424

2525
## Configuration
26-
| env var | default | description |
27-
|-----------------------------|----------------------------------|----------------------------------------------------------------------------------------------|
28-
| `PYROSCOPE_REMOTE_ADDRESS` | `https://ingest.pyroscope.cloud` | the pyroscope instance data will be relayed to |
29-
| `PYROSCOPE_AUTH_TOKEN` | `""` | authorization key (token authentication) |
30-
| `PYROSCOPE_SELF_PROFILING` | `false` | whether to profile the extension itself or not |
31-
| `PYROSCOPE_LOG_LEVEL` | `info` | `error` or `info` or `debug` or `trace` |
32-
| `PYROSCOPE_TIMEOUT` | `10s` | http client timeout ([go duration format](https://pkg.go.dev/time#Duration)) |
33-
| `PYROSCOPE_NUM_WORKERS` | `5` | num of relay workers, pick based on the number of profile types |
34-
| `PYROSCOPE_FLUSH_ON_INVOKE` | `false` | wait for all relay requests to be finished/flushed before next `Invocation` event is allowed |
35-
| `PYROSCOPE_HTTP_HEADERS` | `{}` | extra http headers in json format, for example: {"X-Header": "Value"} |
36-
| `PYROSCOPE_SCOPE_ORGID` | `""` | phlare tenant ID, passed as X-Scope-OrgID http header |
26+
| env var | default | description |
27+
|---------------------------------|----------------------------------|----------------------------------------------------------------------------------------------|
28+
| `PYROSCOPE_REMOTE_ADDRESS` | `https://ingest.pyroscope.cloud` | the pyroscope instance data will be relayed to |
29+
| `PYROSCOPE_AUTH_TOKEN` | `""` | authorization key (token authentication) |
30+
| `PYROSCOPE_SELF_PROFILING` | `false` | whether to profile the extension itself or not |
31+
| `PYROSCOPE_LOG_LEVEL` | `info` | `error` or `info` or `debug` or `trace` |
32+
| `PYROSCOPE_TIMEOUT` | `10s` | http client timeout ([go duration format](https://pkg.go.dev/time#Duration)) |
33+
| `PYROSCOPE_NUM_WORKERS` | `5` | num of relay workers, pick based on the number of profile types |
34+
| `PYROSCOPE_FLUSH_ON_INVOKE` | `false` | wait for all relay requests to be finished/flushed before next `Invocation` event is allowed |
35+
| `PYROSCOPE_HTTP_HEADERS` | `{}` | extra http headers in json format, for example: {"X-Header": "Value"} |
36+
| `PYROSCOPE_TENANT_ID` | `""` | phlare tenant ID, passed as X-Scope-OrgID http header |
3737
| `PYROSCOPE_BASIC_AUTH_USER` | `""` | HTTP basic auth user |
38-
| `PYROSCOPE_BASIC_AUTH_PASSWORD` | `""` | HTTP basic auth password |
38+
| `PYROSCOPE_BASIC_AUTH_PASSWORD` | `""` | HTTP basic auth password |
3939

4040
# How it works
4141
The profiler will run as normal, and periodically will send data to the relay server (the server running at `http://localhost:4040`).

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var (
3434
authToken = getEnvStrOr("PYROSCOPE_AUTH_TOKEN", "")
3535
basicAuthUser = getEnvStrOr("PYROSCOPE_BASIC_AUTH_USER", "")
3636
basicAuthPassword = getEnvStrOr("PYROSCOPE_BASIC_AUTH_PASSWORD", "")
37-
scopeOrgID = getEnvStrOr("PYROSCOPE_SCOPE_ORGID", "")
37+
tenantID = getEnvStrOr("PYROSCOPE_TENANT_ID", "")
3838
timeout = getEnvDurationOr("PYROSCOPE_TIMEOUT", time.Second*10)
3939
numWorkers = getEnvIntOr("PYROSCOPE_NUM_WORKERS", 5)
4040

@@ -56,7 +56,7 @@ func main() {
5656
AuthToken: authToken,
5757
BasicAuthUser: basicAuthUser,
5858
BasicAuthPassword: basicAuthPassword,
59-
ScopeOrgID: scopeOrgID,
59+
TenantID: tenantID,
6060
HTTPHeadersJSON: httpHeaders,
6161
Timeout: timeout,
6262
MaxIdleConnsPerHost: numWorkers,

relay/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type RemoteClientCfg struct {
2424
AuthToken string
2525
BasicAuthUser string
2626
BasicAuthPassword string
27-
ScopeOrgID string
27+
TenantID string
2828
HTTPHeadersJSON string
2929
Timeout time.Duration
3030
MaxIdleConnsPerHost int
@@ -70,8 +70,8 @@ func (r *RemoteClient) Send(req *http.Request) error {
7070
defer req.Body.Close()
7171
}
7272
r.enhanceWithAuthToken(req)
73-
if r.config.ScopeOrgID != "" {
74-
req.Header.Set("X-Scope-OrgID", r.config.ScopeOrgID)
73+
if r.config.TenantID != "" {
74+
req.Header.Set("X-Scope-OrgID", r.config.TenantID)
7575
}
7676
for k, v := range r.headers {
7777
req.Header.Set(k, v)

0 commit comments

Comments
 (0)