Skip to content

Commit

Permalink
Merge pull request #135 from qclaogui:multi-tenancy
Browse files Browse the repository at this point in the history
enable multi-tenancy
  • Loading branch information
qclaogui authored May 21, 2024
2 parents 5cb1f2d + e33f691 commit 55c53ae
Show file tree
Hide file tree
Showing 52 changed files with 166 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ datasources:
isDefault: false
version: 1
editable: true
secureJsonData:
httpHeaderValue1: 'anonymous'
# httpHeaderValue2: 'Bearer XXXXXXXXX'
jsonData:
httpHeaderName1: 'X-Scope-OrgID'
# httpHeaderName2: 'Authorization'
prometheusType: Mimir
exemplarTraceIdDestinations:
- name: traceID
datasourceUid: traces


# Loki for logs
- name: Logs
type: loki
Expand All @@ -40,7 +44,10 @@ datasources:
isDefault: false
version: 1
editable: true
secureJsonData:
httpHeaderValue1: 'anonymous'
jsonData:
httpHeaderName1: 'X-Scope-OrgID'
derivedFields:
- datasourceUid: traces
matcherRegex: "[tT]race_?[iI][dD]\"?[:=]\"?(\\w+)"
Expand All @@ -60,7 +67,10 @@ datasources:
version: 1
editable: true
apiVersion: 1
secureJsonData:
httpHeaderValue1: 'anonymous'
jsonData:
httpHeaderName1: 'X-Scope-OrgID'
search:
hide: false
lokiSearch:
Expand Down Expand Up @@ -113,3 +123,7 @@ datasources:
isDefault: false
version: 1
editable: true
secureJsonData:
httpHeaderValue1: 'anonymous'
jsonData:
httpHeaderName1: 'X-Scope-OrgID'
2 changes: 0 additions & 2 deletions docker-compose/common/config/loki/gateway_loki.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ server {
access_log off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
location = /api/prom/push {
proxy_pass http://${LOKI_DISTRIBUTOR_HOST}:3100$request_uri;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
auth_enabled: false
# Multi-tenant mode is set in the configuration with auth_enabled: true
# https://grafana.com/docs/loki/latest/operations/multi-tenancy/
auth_enabled: true

# -reporting.enabled=false
analytics:
Expand Down
4 changes: 3 additions & 1 deletion docker-compose/common/config/loki/monolithic-mode-logs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
auth_enabled: false
# Multi-tenant mode is set in the configuration with auth_enabled: true
# https://grafana.com/docs/loki/latest/operations/multi-tenancy/
auth_enabled: true

# -reporting.enabled=false
analytics:
Expand Down
4 changes: 3 additions & 1 deletion docker-compose/common/config/loki/read-write-mode-logs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
auth_enabled: false
# Multi-tenant mode is set in the configuration with auth_enabled: true
# https://grafana.com/docs/loki/latest/operations/multi-tenancy/
auth_enabled: true

# -reporting.enabled=false
analytics:
Expand Down
2 changes: 0 additions & 2 deletions docker-compose/common/config/mimir/gateway_mimir.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ server {
access_log off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
location /distributor {
proxy_pass http://${MIMIR_DISTRIBUTOR_HOST}:8080$request_uri;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Do not use this configuration in production.
# It is for demonstration purposes only.
multitenancy_enabled: false
multitenancy_enabled: true

# -usage-stats.enabled=false
usage_stats:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Do not use this configuration in production.
# It is for demonstration purposes only.
multitenancy_enabled: false
multitenancy_enabled: true

# -usage-stats.enabled=false
usage_stats:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Do not use this configuration in production.
# It is for demonstration purposes only.
multitenancy_enabled: false
multitenancy_enabled: true

# -usage-stats.enabled=false
usage_stats:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose/common/config/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ http {
"" "anonymous";
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

include /etc/nginx/gateway_*.conf;
}
2 changes: 0 additions & 2 deletions docker-compose/common/config/pyroscope/gateway_pyroscope.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ server {
access_log off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
location /push.v1.PusherService {
proxy_pass http://${PYROSCOPE_DISTRIBUTOR_HOST}:4040$request_uri;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
multitenancy_enabled: false
multitenancy_enabled: true
analytics:
reporting_enabled: false

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
multitenancy_enabled: false
multitenancy_enabled: true
analytics:
reporting_enabled: false

Expand Down
2 changes: 0 additions & 2 deletions docker-compose/common/config/tempo/gateway_tempo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ server {
access_log off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
location = /jaeger/api/traces {
proxy_pass http://${TEMPO_DISTRIBUTOR_HOST}:14268/api/traces;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

stream_over_http_enabled: true

multitenancy_enabled: false
multitenancy_enabled: true
usage_report:
reporting_enabled: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

stream_over_http_enabled: true

multitenancy_enabled: false
multitenancy_enabled: true
usage_report:
reporting_enabled: false

Expand Down
16 changes: 7 additions & 9 deletions kubernetes/common/gateway/manifests/k8s-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ data:
"" "anonymous";
}
proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;
include /etc/nginx/gateway_*.conf;
}
kind: ConfigMap
metadata:
name: nginx-conf-d76dbg78td
name: nginx-conf-fbc5k874b5
namespace: gateway
---
apiVersion: v1
Expand Down Expand Up @@ -466,8 +468,6 @@ data:
access_log off;
}
proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;
# Distributor endpoints
location = /api/prom/push {
proxy_pass http://${LOKI_DISTRIBUTOR_HOST}:3100$request_uri;
Expand Down Expand Up @@ -569,9 +569,9 @@ data:
}
gateway_mimir.conf.template: "server {\n listen 8080;\n listen [::]:8080;\n\n
\ location = / {\n return 200 'OK';\n auth_basic off;\n access_log
off;\n }\n\n proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;\n\n
\ # Distributor endpoints\n location /distributor {\n proxy_pass http://${MIMIR_DISTRIBUTOR_HOST}:8080$request_uri;\n
\ }\n location = /api/v1/push {\n proxy_pass http://${MIMIR_DISTRIBUTOR_HOST}:8080$request_uri;\n
off;\n }\n\n # Distributor endpoints\n location /distributor {\n proxy_pass
\ http://${MIMIR_DISTRIBUTOR_HOST}:8080$request_uri;\n }\n location
= /api/v1/push {\n proxy_pass http://${MIMIR_DISTRIBUTOR_HOST}:8080$request_uri;\n
\ }\n location /otlp/v1/metrics {\n proxy_pass http://${MIMIR_DISTRIBUTOR_HOST}:8080$request_uri;\n
\ }\n\n # Alertmanager endpoints\n location /alertmanager {\n proxy_pass
\ http://${MIMIR_ALERT_MANAGER_HOST}:8080$request_uri;\n }\n location
Expand Down Expand Up @@ -601,8 +601,6 @@ data:
access_log off;
}
proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;
# Distributor endpoints
location /push.v1.PusherService {
proxy_pass http://${PYROSCOPE_DISTRIBUTOR_HOST}:4040$request_uri;
Expand Down Expand Up @@ -709,7 +707,7 @@ spec:
projected:
sources:
- configMap:
name: nginx-conf-d76dbg78td
name: nginx-conf-fbc5k874b5
- configMap:
name: nginx-templates
- emptyDir: {}
Expand Down
2 changes: 0 additions & 2 deletions kubernetes/common/gateway/nginx/gateway_loki.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ server {
access_log off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
location = /api/prom/push {
proxy_pass http://${LOKI_DISTRIBUTOR_HOST}:3100$request_uri;
Expand Down
2 changes: 0 additions & 2 deletions kubernetes/common/gateway/nginx/gateway_mimir.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ server {
access_log off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
location /distributor {
proxy_pass http://${MIMIR_DISTRIBUTOR_HOST}:8080$request_uri;
Expand Down
2 changes: 0 additions & 2 deletions kubernetes/common/gateway/nginx/gateway_pyroscope.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ server {
access_log off;
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

# Distributor endpoints
location /push.v1.PusherService {
proxy_pass http://${PYROSCOPE_DISTRIBUTOR_HOST}:4040$request_uri;
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/common/gateway/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ http {
"" "anonymous";
}

proxy_set_header X-Scope-OrgID $ensured_x_scope_orgid;

include /etc/nginx/gateway_*.conf;
}
Loading

0 comments on commit 55c53ae

Please sign in to comment.