fix(analytics): wait for logflare before starting vector#4989
Merged
jgoux merged 2 commits intosupabase:developfrom Mar 25, 2026
Merged
fix(analytics): wait for logflare before starting vector#4989jgoux merged 2 commits intosupabase:developfrom
jgoux merged 2 commits intosupabase:developfrom
Conversation
|
@singh-inder, @luizfelmach fyi |
Pull Request Test Coverage Report for Build 23560482012Details
💛 - Coveralls |
jgoux
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Vector starts before Logflare is ready to accept requests. During startup, Logflare returns 401 Unauthorized while its auth is still initializing. Vector treats 401 as a non-retriable client error (hardcoded in Vector's HTTP retry logic — only 408, 429, and 5xx are retried) and permanently drops those log batches. This results in missing startup logs in Studio and noisy error output in Vector's container logs.
What is the new behavior?
Vector's entrypoint now polls Logflare's health endpoint (
/health) every 2 seconds before starting. Vector only launches once Logflare is confirmed ready, eliminating the 401 errors and ensuring all logs are delivered from the moment Vector starts collecting.Tested locally — before: 37 x 401 errors, after: 0.
Additional context
Vector's HTTP sink retry logic is hardcoded and not configurable — 401 will never be retried regardless of
retry_max_duration_secs. The wait loop useswgetwhich is already available in the Vector Alpine image (used by its own healthcheck).