Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with current DNS SRV implementation #127

Open
laurivosandi opened this issue Nov 14, 2021 · 0 comments
Open

Issues with current DNS SRV implementation #127

laurivosandi opened this issue Nov 14, 2021 · 0 comments

Comments

@laurivosandi
Copy link

laurivosandi commented Nov 14, 2021

There is no documentation how to configure the SRV records, but using the scheme that I had used in the past and which does in fact work with Prometheus native DNS SRV discovery dns_sd_configs I get following errors:

{"level":"info","msg":"setting up collector for devices","numDevices":1,"time":"2021-11-14T07:01:40Z"}
{"level":"info","msg":"Listening on :9436","time":"2021-11-14T07:01:40Z"}
{"device":"routers_srv_dns","error":"dial tcp :8728: connect: connection refused","level":"error","msg":"error dialing device","time":"2021-11-14T07:01:56Z"}
{"level":"error","msg":"ERROR: routers_srv_dns collector failed after 0.000418s: dial tcp :8728: connect: connection refused","time":"2021-11-14T07:01:56Z"}

Zonefile contents:

$ORIGIN example.com.
_mikrotik._tcp          SRV     0 100 8728 router1
                        SRV     0 100 8728 router2
                        SRV     0 100 8728 router3
router1              A       192.168.0.1
router2              A       192.168.0.2
router3              A       192.168.0.3

Exporter configuration:

    devices:
      - name: routers_srv_dns
        user: netpoller
        password: "123456"
        srv:
          record: _mikrotik._tcp.example.com

Instead of reinventing the DNS SRV discovery in your exporter, I would rather have you drop the homebrew code and reuse Prometheus native DNS SRV discovery as described in #126

Also looks like DNS failover will not ever work:

dnsServer := net.JoinHostPort(conf.Servers[0], strconv.Itoa(dnsPort))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant