librato / librato-collectd-docker

Collectd plugin for Docker cgroup metrics
MIT License
9 stars 7 forks source link

Bugfix/networking #6

Closed chancefeick closed 8 years ago

chancefeick commented 8 years ago

Bugfix for network stats. Docker Remote API v1.21 introduced the following breaking change:

GET /containers/(id)/stats will return networking information respectively for each interface.

Builds aggregated network stats for all network interfaces from new "networks" key. Maintains legacy metric namespace (librato.docker.network) to prevent any breaking changes to existing dashboards.

vagrant@vagrant-ubuntu-trusty-64:/opt/collectd/share/collectd$ sudo python collectd-docker.py
PUTVAL "localhost/docker-librato-32527f55f619/network-rx_dropped" interval=60 N:0
PUTVAL "localhost/docker-librato-32527f55f619/network-rx_errors" interval=60 N:0
PUTVAL "localhost/docker-librato-32527f55f619/network-tx_errors" interval=60 N:0
PUTVAL "localhost/docker-librato-32527f55f619/network-tx_dropped" interval=60 N:0
PUTVAL "localhost/docker-librato-32527f55f619/network-rx_packets" interval=60 N:16
PUTVAL "localhost/docker-librato-32527f55f619/network-tx_packets" interval=60 N:8
PUTVAL "localhost/docker-librato-32527f55f619/network-tx_bytes" interval=60 N:648
PUTVAL "localhost/docker-librato-32527f55f619/network-rx_bytes" interval=60 N:1296

screenshot

obfuscurity commented 8 years ago

Discussed with @chancefeick in Slack, we should try to keep the interface metrics distinct. We'll have to update our prefabs too.

obfuscurity commented 8 years ago

As discussed in our 1:1, let's continue with the aggregated statistics as originally intended (prior to my last comment). However, we need to support both API formats (pre- and post-v1.21).

chancefeick commented 8 years ago

@obfuscurity handling backward compatibility in af6c19e217619ea1492af69397833b1808d7fe52. Looks good while testing on docker version: 1.9.1/API version: 1.21 and docker version: 1.7.1/API version: 1.19.

obfuscurity commented 8 years ago

Looks good, thanks!