From e0d6df75ac7fbc3a16aaf85f08e438ceca4b8a3a Mon Sep 17 00:00:00 2001 From: Sho Okada Date: Thu, 13 Feb 2020 18:15:42 +0900 Subject: [PATCH 1/3] Add headers for WebSocket --- production/ksonnet/loki/gateway.libsonnet | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/production/ksonnet/loki/gateway.libsonnet b/production/ksonnet/loki/gateway.libsonnet index c4fe39b629dd..63882e8e4eb2 100644 --- a/production/ksonnet/loki/gateway.libsonnet +++ b/production/ksonnet/loki/gateway.libsonnet @@ -46,19 +46,33 @@ proxy_set_header X-Scope-OrgID 1; location = /api/prom/push { - proxy_pass http://distributor.%(namespace)s.svc.cluster.local$request_uri; + proxy_pass http://distributor.%(namespace)s.svc.cluster.local$request_uri; + } + + location = /api/prom/tail { + proxy_pass http://querier.%(namespace)s.svc.cluster.local$request_uri; + proxy_set_header X-Scope-OrgID 1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } location ~ /api/prom/.* { - proxy_pass http://query-frontend.%(namespace)s.svc.cluster.local$request_uri; + proxy_pass http://query-frontend.%(namespace)s.svc.cluster.local$request_uri; } location = /loki/api/v1/push { - proxy_pass http://distributor.%(namespace)s.svc.cluster.local$request_uri; + proxy_pass http://distributor.%(namespace)s.svc.cluster.local$request_uri; + } + + location = /loki/api/v1/tail { + proxy_pass http://querier.%(namespace)s.svc.cluster.local$request_uri; + proxy_set_header X-Scope-OrgID 1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } location ~ /loki/api/.* { - proxy_pass http://query-frontend.%(namespace)s.svc.cluster.local$request_uri; + proxy_pass http://query-frontend.%(namespace)s.svc.cluster.local$request_uri; } } } From 54cd0eb6d06fd5f75aa92857c80901010a42f501 Mon Sep 17 00:00:00 2001 From: Sho Okada Date: Fri, 14 Feb 2020 11:48:30 +0900 Subject: [PATCH 2/3] Remove the OrgID --- production/ksonnet/loki/gateway.libsonnet | 3 --- 1 file changed, 3 deletions(-) diff --git a/production/ksonnet/loki/gateway.libsonnet b/production/ksonnet/loki/gateway.libsonnet index 63882e8e4eb2..9ff708313f8e 100644 --- a/production/ksonnet/loki/gateway.libsonnet +++ b/production/ksonnet/loki/gateway.libsonnet @@ -43,7 +43,6 @@ listen 80; auth_basic “Prometheus”; auth_basic_user_file /etc/nginx/secrets/.htpasswd; - proxy_set_header X-Scope-OrgID 1; location = /api/prom/push { proxy_pass http://distributor.%(namespace)s.svc.cluster.local$request_uri; @@ -51,7 +50,6 @@ location = /api/prom/tail { proxy_pass http://querier.%(namespace)s.svc.cluster.local$request_uri; - proxy_set_header X-Scope-OrgID 1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } @@ -66,7 +64,6 @@ location = /loki/api/v1/tail { proxy_pass http://querier.%(namespace)s.svc.cluster.local$request_uri; - proxy_set_header X-Scope-OrgID 1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } From 7c535a273e9ef7525af6dbb94b0068e18064a25f Mon Sep 17 00:00:00 2001 From: Sho Okada Date: Sat, 15 Feb 2020 10:22:58 +0900 Subject: [PATCH 3/3] fix --- production/ksonnet/loki/gateway.libsonnet | 1 + 1 file changed, 1 insertion(+) diff --git a/production/ksonnet/loki/gateway.libsonnet b/production/ksonnet/loki/gateway.libsonnet index 9ff708313f8e..5a969d2f123d 100644 --- a/production/ksonnet/loki/gateway.libsonnet +++ b/production/ksonnet/loki/gateway.libsonnet @@ -43,6 +43,7 @@ listen 80; auth_basic “Prometheus”; auth_basic_user_file /etc/nginx/secrets/.htpasswd; + proxy_set_header X-Scope-OrgID 1; location = /api/prom/push { proxy_pass http://distributor.%(namespace)s.svc.cluster.local$request_uri;