-
Notifications
You must be signed in to change notification settings - Fork 219
Fixes **401 Unauthorized** errors when vector
forwards logs to `log…
#114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…flare` in self-hosted Kubernetes deployments. ## Summary Fixes **401 Unauthorized** errors when `vector` forwards logs to `logflare` in self-hosted Kubernetes deployments. The issue was due to authentication method mismatch: - **Old (broken):** API key passed via `?api_key=...` query param - **New (fixed):** API key passed via `Authorization: Bearer ...` header This change aligns the Kubernetes Helm chart with the working Docker Compose setup and Logflare’s expected authentication model. --- ## Related Issue Closes #37998 --- ## Changes - Updated **vector sink configuration** in Helm chart: - Replace `?api_key=SECRET[credentials.logflare_api_key]` in sink URIs with standard endpoints. - Add `Authorization: Bearer SECRET[credentials.logflare_api_key]` headers in each logflare sink. - Ensured DB sink still routes through Kong for startup ordering. - No breaking changes for users with correct `LOGFLARE_API_KEY`. --- ## Verification 1. Deployed Supabase via Helm on Kubernetes. 2. Confirmed all pods healthy (`kubectl get pods`). 3. Observed **no more `401 Unauthorized` errors** in vector logs. 4. Logs successfully appear in Logflare dashboard. 5. Curling `/health` on logflare pod returns `200 OK` as before. --- ## Checklist - [x] Verified in Kubernetes environment - [x] Ensured parity with Docker Compose behavior - [x] Helm values backward-compatible - [ ] Added release note --- ## Release Note ```markdown Fixed an authentication bug where `vector` failed with `401 Unauthorized` when sending logs to `logflare` in self-hosted Kubernetes deployments. Authentication is now handled via `Authorization: Bearer <LOGFLARE_API_KEY>` headers instead of query parameters.
Thank you for your contribution. I use the latest config in your PR, but the errors still exist.
|
ok let me do some changes then try again |
now check it again |
Thank you bro. But it still doesn't work. Do these changes work in your local environment? It's possible you're not seeing an error because Vector isn't actually collecting the logs. In the Supabase Studio launched with Docker Compose, you can see the component logs, but they are not visible when using the Kubernetes deployment. The community-provided Kubernetes configuration is quite old and doesn't enable Vector to collect logs from the other components. As a result, it doesn't write to Logflare, and therefore, no error is reported. You can reference my configuration, which does allow Vector to collect logs from the other components. However, the current issue I'm facing is a permission error when it tries to write to Logflare.
|
…flare` in self-hosted Kubernetes deployments.
Summary
Fixes 401 Unauthorized errors when
vector
forwards logs tologflare
in self-hosted Kubernetes deployments. The issue was due to authentication method mismatch:?api_key=...
query paramAuthorization: Bearer ...
headerThis change aligns the Kubernetes Helm chart with the working Docker Compose setup and Logflare’s expected authentication model.
Related Issue
Closes supabase/supabase#37998
Changes
?api_key=SECRET[credentials.logflare_api_key]
in sink URIs with standard endpoints.Authorization: Bearer SECRET[credentials.logflare_api_key]
headers in each logflare sink.LOGFLARE_API_KEY
.Verification
kubectl get pods
).401 Unauthorized
errors in vector logs./health
on logflare pod returns200 OK
as before.Checklist
Release Note