cleanup: minor fixes (flag init, HTTP timeouts) - #15
Merged
Conversation
added 2 commits
June 4, 2026 10:47
Remove the no-op reassignment of the map entry (collector is already a pointer) and the discarded disableFlag variable. The --no-collector.X flag is still registered for parsing and flag.Visit detection.
Previously only ReadHeaderTimeout was set. Add ReadTimeout and IdleTimeout to bound slow/idle connections, and a generous WriteTimeout sized above a normal multi-device scrape.
dobbi84
force-pushed
the
cleanup/minor-fixes
branch
2 times, most recently
from
June 4, 2026 08:59
e536aea to
25271fd
Compare
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
Two small, independent cleanups, one per commit.
Commits
collectors[name] = collectorreassignment (the value is already a pointer) and the discardeddisableFlagvariable. The--no-collector.Xflag is still registered for parsing andflag.Visitdetection.ReadHeaderTimeoutwas set. AddReadTimeoutandIdleTimeout, plus aWriteTimeoutsized generously above a normal multi-device scrape (eachnvmecall is bounded by the existing 30s command timeout) to avoid truncating responses.Note
A third planned cleanup (replacing the
map[string]interface{}inflattenNewStructurewith a typed struct) was dropped: it triggers a lint conflict —musttagrequiresjsontags,tagliatellerequires camelCase tags, but the keys must stay PascalCase to match what the collectors read via gjson. The existing map approach avoids all of this.Testing
go build ./...✅go vet ./...✅