Repository navigation
fix: host metrics come from a collector in the host's network, so network traffic is the host's - #447
Merged
Merged
Conversation
…work traffic is the host's
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
HardMax71
enabled auto-merge (squash)
October 22, 2026 13:31
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
Found while working on #317. The collector's
host_metricsnetwork scraper reported the collector container's owneth0andlo, not the host's: gopsutil reads/proc/net/dev, and that always shows the reading process's network namespace (net_linux.go). In prod,system_network_io_bytes_total{device="eth0"}said 30.7 KB/s in while the host's realeth0moved about 300 B/s, and the host's NIC is also calledeth0.Changes
A second collector,
host-metrics, runs only thehost_metricsreceiver withnetwork_mode: hostand sends to the main collector on127.0.0.1:4317. It opens no ports: internal metrics are off and it runs no extensions. The main collector drops the receiver and the host mounts. The System row gets "Network I/O" (withoutloandveth*) and "Disk Space Used", the deploy restartshost-metricswhen its config changes, and the system diagram shows it.Type of Change
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)./deploy.sh openapi, then./deploy.sh types), never edited by handValidation: locally the agent reported the host's
enp1s0f0,wlp2s0,docker0and bridge, opened no port and used 57 MiB. Both configs passotelcol validateon 0.163.1, compose config passes, and the disk query gives 40.1% on prod against df's 41%.Checklist
pre-commit run --all-filesand all checks passSummary by cubic
Fixes host metrics so network traffic reflects the host's interfaces instead of the collector container's: gopsutil reads
/proc/net/dev, which shows the reading process's network namespace. A newhost-metricscollector runs thehost_metricsreceiver withnetwork_mode: hostin the host's network namespace and forwards to the main collector on127.0.0.1:4317.host_metricsreceiver and the/procand/sysmounts it used for it.loandveth*interfaces) and "Disk Space Used" panels.host-metricswhen its config changes; docs and the system diagram are updated.Written for commit 363d0e0. Summary will update on new commits.