Skip to content

feat(doctor): add cloud provider and instance type enrichment for VM deployments#222

Open
sahare-mayur-0071 wants to merge 5 commits into
optiqor:mainfrom
sahare-mayur-0071:feat/cloud-provider-enrichment
Open

feat(doctor): add cloud provider and instance type enrichment for VM deployments#222
sahare-mayur-0071 wants to merge 5 commits into
optiqor:mainfrom
sahare-mayur-0071:feat/cloud-provider-enrichment

Conversation

@sahare-mayur-0071

Copy link
Copy Markdown

What

This PR adds Cloud Provider and Instance Type fields to the kernel diagnostic report header. It enriches the HostInfo struct 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

  • Added CloudProvider and InstanceType fields to HostInfo (in signals.go) and Report (in finding.go and render.go).
  • Created a DetectCloud() function in internal/adapter/baremetal.go that safely reads from /sys/class/dmi/id/sys_vendor and /sys/class/dmi/id/product_name.
  • Updated engine.go to inject this data directly into the diagnostic Report.
  • Updated PrettyRenderer and JSONRenderer in render.go to cleanly display and export these fields.

Testing

  • go build ./... passes

  • go test ./... passes

  • go vet ./... passes

  • golangci-lint run ./... passes

  • Tested locally with: go run ./cmd/kerno doctor --duration 5s

  • N/A — pure docs/refactor

  • sudo ./bin/bpf-verify --read 5s confirms 6/6 programs still load

  • ./scripts/verify.sh passes (or specific phase: ./scripts/verify.sh quality)

Checklist

  • PR title follows Conventional Commits (feat(scope): subject)
  • All commits are DCO-signed (git commit -s)
  • No unrelated changes pulled in
  • Documentation updated where user-visible behavior changed
  • Added/updated tests for new code paths
  • If a new doctor rule, paired with a chaos scenario in scripts/verify.sh

Signed-off-by: Mayur Sahare <mayursahare2024@gmail.com>
@github-actions github-actions Bot added level:advanced 200+ lines or 6+ files (auto-applied) area/doctor Diagnostic engine and rules labels Jun 13, 2026
@sahare-mayur-0071 sahare-mayur-0071 changed the title feat: Add Cloud Provider and Instance Type Enrichment for VM deployments feat(doctor): add cloud provider and instance type enrichment for VM deployments Jun 13, 2026
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>
@sahare-mayur-0071

Copy link
Copy Markdown
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!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/doctor Diagnostic engine and rules level:advanced 200+ lines or 6+ files (auto-applied)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add Cloud Provider and Instance Type Enrichment for VM deployments

1 participant