syepes / network_exporter

ICMP / Ping & MTR & TCP Port & HTTP Get - Network Prometheus exporter
Apache License 2.0
336 stars 60 forks source link

add support for SRV records as host #9

Closed Len4i closed 3 years ago

Len4i commented 3 years ago

Hi, I would like to add support for SRV records as host for a target of network_exporter I've got it working by extracting target records of SRV record and adding them as separate targets for network_exporter.

few notes: I had to transform hierarchical Config type to inherited in order to be able to call Targets type directly. Without it this line targets := c.Targets[:0] was messing with original targets from config file during the for loop And, this is actually my first lines in GO, so I easily imagine that code may look ugly and not "go style". Feel free to correct me.

Let me know if you are interested in this functionality

syepes commented 3 years ago

Very nice thanks for the contribution