Why do we need to use gateways to proxy apis? why not route traffic directly to loki-read
and loki-write
?
Looking forward to any reply
The gateway serves two primary purpose:
-
Direct traffic to the right place. You need a way to send read traffic to the read path and write traffic to the write path (obviously not a concern if you run a single instance, but you don’t want to do that in production environment either). For example, you don’t want to send
/loki/api/v1/push
to the querier, and unless you want to use different URLs for read and write you need a proxy that can direct traffic based on HTTP path. -
Authentication if you want multi-tenant mode for Loki. Loki itself doesn’t do authentication, that part is offloaded to the proxy, which handles username / password and sets
X-Scope-OrgID
header accordingly.
2 Likes