-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] too many sensors for Docker #320
Comments
Hey @Erreur32 that's quite a few sensors! So regarding the number of sensors: I'm also running the agent on some machines running Podman, but I don't see nearly as many sensors. Something seems amiss. I have 31 containers running and I only have just over 200 entities total from the agent. Mind you, I do have some containers running in pods, which reduces the number of entities created. For each network device, I would expect at most 7 entities created:
For Podman, which creates 2 network devices per container for a single running container, that would be about 14 entities. I am unsure that Docker would be creating more. So in your case, the 15 containers with 7 network entities should only generate around 100 network entities, maybe 200 if it does something similar to Podman. Is it possible some of these sensors are from previous installs of Go Hass Agent? In such a case, they wouldn't be generating sensor updates and should not affect Home Assistant load, other than increasing database storage size. If they are old sensors, the Repairs functionality in Home Assistant should offer to clean them up? So regarding the ability to disable some sensors: Yes indeed! This has been requested before (see also #171). I will try to carve out some more time to work out how this can be done. Some of the recent refactoring I've done should make it easier to do. I don't unfortunately have a current workaround for you sorry! However, I do think it would be worth looking into whether Home Assistant Repairs reports some entities can be removed, which at least will help for display purposes! |
Hey @Erreur32, I've spent some time looking into the ability to filter sensors, and I have something that might be useful. I've merged some code that now allows for exposing user preferences for some sensors, that will add some control to what data they generate. For example, the code that generates network sensors (bytes received/sent, connection status, addresses) now has a preferences file in which you add some device prefixes that will be matched against devices that should be ignored. In this particular case, the configuration file is located at # list of prefixes to match for devices to ignore, for e.g., 'eth' will ignore all devices starting with eth
ignored_devices = [] You can add devices to ignore to that toml list, for example: This will be in the next release of the agent, but if you are keen, you can try it out in the build here. Grab the If you do try it out, please let me know your feedback! |
Thanks a lot for checking that request, sound very good :).
I have redoing all cleaning in HA , and reset + renistall go-hass-agent with your build , change the settings in network_sensors_preferences.toml And "Voilà" it's working like a charme now :))) you can close this "bug" (i guess not really a bug) |
Go Hass Agent Version
Since v10 with .deb installation
Describe the bug
The number of sensors detected for Docker containers is excessive; I currently have over 3,293 entities.
This high volume of entities is causing performance issues, as the client/server setup with Home Assistant struggles with the traffic load. My CPU usage spikes significantly whenever all data is pulled.
I have 15 Dockers running, and i guessing a lot entry was generated from Docker sensors.
Example sensor entries:
To Reproduce
Install Docker with go-hass-agent and observe sensor entity counts.
Expected Behavior
It would be ideal to have the ability to disable specific sensors directly from the client (possibly in /preferences.toml) to reduce the load on Home Assistant.
Screenshots
Example of entry
Desktop (please complete the following information):
For now i have no choice to stop go-hass-agent cause all machine load is to high.
Other missing sensor
I sow some other entry missing since V10. , it is normal ?
distribution_name , distribution_version kernel_version and ** current_users**
The text was updated successfully, but these errors were encountered: