concourse-bosh-deployment
                                
                                
                                
                                    concourse-bosh-deployment copied to clipboard
                            
                            
                            
                        Exclude non-eth0 net ifaces from datadog network metrics
Currently, the network metrics being collected by the datadog agent that we have configured for all of our machines include not only "real" interfaces (like, eth0, which we care about), but also the other ones that we don't care about (bridges and the host-facing side of the virtual eth pairs).
Given that for each container that we have, we end up with at least 2 of those (a bridge and a host-side veth), and that for each unique resource config, one of those get created every hour, that's a lot of distinct timeseries.
Getting rid of these is important because otherwise we'll be paying the price of
something we don't use (similar to https://github.com/concourse/concourse-bosh-deployment/pull/195).
The configuration for this can be done in a similar way too:
- the 
networkcore collector contains a field that lets us specify a regex for to see whether to include or not a gven interface: 
## @param excluded_interface_re - string - optional
## Completely ignore any network interface matching the given regex.
#
# excluded_interface_re: <NETWORK_INTERFACE_NAME>.*
https://github.com/DataDog/integrations-core/blob/86c5e1caabaed489b19dc5cb172545fda9b99ee7/network/datadog_checks/network/data/conf.yaml.default#L25-L28
leveraging that, we can ignore anything that's not an eth0.
for instance, looking at one of the machine's ifaces, we can come up with the following:
import re
text = ['eth0', 'wlkcnldkuudo-0', 'wbrdg-0afe0014']
p = re.compile('(?!eth0)')
for t in text:
    if p.match(t):
        print("match: ", t)
match:  wlkcnldkuudo-0
match:  wbrdg-0afe0014
i.e., it'd exclude the ifaces we don't care about.
thanks!