Closed tomalaci closed 3 years ago
@f41gh7 , are there any news on this issue?
must be fixed at related PR.
The issue must be fixed in the commit 48c8c5093b0eefbc563135d7d041aa049ea82d35 . @azeroc , could you build vmagent
from this commit and verify whether the issue is fixed in your setup? See build instructions for vmagent.
The issue must be fixed in the commit 48c8c50 . @azeroc , could you build
vmagent
from this commit and verify whether the issue is fixed in your setup? See build instructions for vmagent.
Tested vmagent from v1.52.0 branch which expectedly spammed described errors. Afterwards I built vmagent from 48c8c50 commit and the CIDR error is gone, so I think this is fixed. Thanks!
Which release will this commit be included in?
Which release will this commit be included in?
The commit will be included in v1.54.0 . Let's re-open the issue until the release with bugfix is out.
Describe the bug When you use host networking for a service and then setup prom-scrape config to scrape for tasks inside docker swarm, it will attempt to call http://services API to list docker swarm state and then spam a lot of errors about invalid CIDR conversion ("invalid CIDR address").
Those errors happen due to code defined in https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/lib/promscrape/discovery/dockerswarm/services.go#L104
That code will trigger the aforementioned error if it encounters a service with endpoint info such as this ("Addr" field is missing):
To Reproduce VictoriaMetrics has to scrape docker-swarm services/tasks. Example prom scrape config I am using (I don't think relabel_configs are needed for a quick repro):
Afterwards, create a docker swarm service which uses host networking mode. It should create a service definition which has Endpoint structured like this:
Expected behavior It shouldn't spam that error if Virtual IP Addr field is empty since it should be expected that there could be services defined to be working in host networking mode. In my specific case I have few services doing heavy UDP-based SNMP polling, using swarm overlay network kills my packet throughput.
Might be useful: as per prometheus configuration (https://prometheus.io/docs/prometheus/latest/configuration/configuration/#dockerswarm_sd_config): "The __meta_dockerswarmnetwork meta labels are not populated for ports which are published with mode=host."
Screenshots If applicable, add screenshots to help explain your problem.
Version victoriametrics/victoria-metrics:v1.52.0 docker image
Docker version:
Used command-line flags
Additional context Sample error logs being spammed: