Closed moss2k13 closed 7 years ago
At first glance it looks like the initial call to get the list of current containers is successful in that it gets an answer back here: https://gist.github.com/moss2k13/735fca569864b9151ef0b0baaaff4f3f#file-hsflowd_from_container-log-L446-L457
but somehow that answer is never processed, like it is in the non-containerized version here: https://gist.github.com/moss2k13/7bf6ee39d58e41323670fee2064b2f75#file-hsflowd_from_standard_ubuntu_vm-log-L1023-L1223
Assuming you can't easily run it in the debugger and set breakpoints, I guess I would add print-statements in places like this to see what might be happening to that request: https://github.com/sflow/host-sflow/blob/master/src/Linux/mod_docker.c#L1199
Maybe mod_docker is expecting an EVSOCKETREAD_EOF status that never comes?
(You can see that GET /events answers are being processed OK, but those are handled on EVSOCKETREAD_STR. The GET /containers request is different. It will accumulate the result until it hits EOF, and then deliver the whole result at once).
I've confirmed that I have vir_* metrics when I start the same hsflowd container under ubuntu xenial:
root@ubuntu:~# curl http://localhost:8008/dump/10.x.x.81/ALL/json|grep metricName|grep vir|wc -l
28
Hsflowd log below - I created nginx container, executed bash and removed nginx:
I changed the privileges during container start from --cap-add=NET_ADMIN
to --privileged
.
When I start the same hsflowd under coreos with the same privileges vir_* metrics are not there.
I'll ask coreos guys for support - I'll update any progress here.
Vir_* metrics are available with hsflowd-ubuntu16_2.0.6.-1_amd64.deb (4c79bd3) under coreos stable 1185.3.0:
core@core-1 ~$ cat /etc/motd
CoreOS stable (1185.3.0)
core@core-1 ~ $ curl http://localhost:8008/dump/10.x.x.15/ALL/json|grep metricName|grep vir|wc -l
56
Thanks for the support!
Thanks! I still plan to experiment with a change where we close the connection from the hsflowd side instead of just assuming that the docker side will close it. Shouldn't do any harm, and it might solve the problem you saw.
Hello, I'm trying to use hsflowd as a container on coreos using this Dockerfile
Hsflowd package
hsflowd-ubuntu16_2.0.5-7_amd64.deb
has been built (commit f7bcfac) by running:I'm using below command to start the containers:
I don't have vir_* metrics available in sflow-rt from hsflowds running as a container:
I see them from hsflowd on normal ubuntu vm:
I attached hsflowd logs from both (container and vm) below:
I have other containers running on nodes 10.x.x.81-83 where I use hsflowd as a container:
I could missed something along the way though