Use log.Printf for AWS poll errors to avoid mangled log lines - #27
Draft
saltzm wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: matthew@modal.com <saltzm@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
The AWS IMDS poll loop logged failures with
fmt.Printf("error during aws poll: %v", err)— no trailing newline and no timestamp, unlike every other log call in the codebase (which uselog.Printf). The missing\ncauses the error to run into the next log line, e.g.:This is what made ~15 of these errors get mis-parsed in Datadog. Fix is a one-liner:
Context — this error is benign transient noise
Datadog (
source:vprox, 7d): 228 hits across 148 distinct hosts, ≤6/host (~0.005% of polls); 170× IMDS503(throttling), 43×connection refused, clustered on fleet-wide blips. A failed poll originates inawsClient.GetAddresses(), which returns before anysm.Start/sm.Stop, sopollAwsreturns the previous IP set unchanged and just retries on the next 5s tick — it cannot drop a live tunnel (error starting new ip= 0 occurrences in 30d).Unaddressed follow-ups (intentionally left out — judgment calls)
MaxAttempts/ add a backoff retryer to trim 503 noise.aws_pollerror counter would allow alerting on rates rather than eyeballing logs.Link to Devin session: https://modal.devinenterprise.com/sessions/456280ed46e24e64a4e317cdb1c51dc9
Requested by: @saltzm