feat(doctor): add cloud provider and instance type enrichment for VM deployments#222
Open
sahare-mayur-0071 wants to merge 5 commits into
Open
Conversation
Signed-off-by: Mayur Sahare <mayursahare2024@gmail.com>
Signed-off-by: Mayur Sahare <mayursahare2024@gmail.com>
Signed-off-by: Mayur Sahare <mayursahare2024@gmail.com>
Signed-off-by: Mayur Sahare <mayursahare2024@gmail.com>
Signed-off-by: Mayur Sahare <mayursahare2024@gmail.com>
Author
|
Hi @btwshivam, I've pushed a few follow-up commits to resolve the linter warnings (gofmt and gocritic). All CI checks are now passing successfully and the PR is ready for your review whenever you have a moment. Thanks!" |
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
This PR adds Cloud Provider and Instance Type fields to the kernel diagnostic report header. It enriches the
HostInfostruct with this metadata and detects the cloud environment natively from local DMI sysfs pseudo-files.Why
Fixes #221
During incident response, it is crucial to know the instance type and provider to quickly correlate kernel metrics with the machine's actual hardware capabilities without needing to switch to external cloud consoles.
How
CloudProviderandInstanceTypefields toHostInfo(insignals.go) andReport(infinding.goandrender.go).DetectCloud()function ininternal/adapter/baremetal.gothat safely reads from/sys/class/dmi/id/sys_vendorand/sys/class/dmi/id/product_name.engine.goto inject this data directly into the diagnosticReport.PrettyRendererandJSONRendererinrender.goto cleanly display and export these fields.Testing
go build ./...passesgo test ./...passesgo vet ./...passesgolangci-lint run ./...passesTested locally with:
go run ./cmd/kerno doctor --duration 5sN/A — pure docs/refactor
sudo ./bin/bpf-verify --read 5sconfirms 6/6 programs still load./scripts/verify.shpasses (or specific phase:./scripts/verify.sh quality)Checklist
feat(scope): subject)git commit -s)scripts/verify.sh