Nomon/nomad-exporter

https in -nomad.server

Closed this issue · 2 comments

hynek commented

It looks like -nomad.server ignores https as an url scheme in certain cases:

$ /usr/local/bin/nomad-exporter -nomad.server=https://10.130.0.1:4646
2016/12/08 11:34:58 Listening on :9172
2016/12/08 11:35:03 Query error Get http://10.130.0.5:4646/v1/client/allocation/X-X-X-X-X/stats: malformed HTTP response "\x15\x03\x01\x00\x02\x02"

I do get some metrics though:

# HELP nomad_allocations How many allocations are there in the cluster.
# TYPE nomad_allocations gauge
nomad_allocations 1
# HELP nomad_jobs How many jobs are there in the cluster.
# TYPE nomad_jobs gauge
nomad_jobs 1
# HELP nomad_raft_peers How many peers (servers) are in the Raft cluster.
# TYPE nomad_raft_peers gauge
nomad_raft_peers 3
# HELP nomad_serf_lan_members How many members are in the cluster.
# TYPE nomad_serf_lan_members gauge
nomad_serf_lan_members 2
# HELP nomad_up Was the last query of Nomad successful.
# TYPE nomad_up gauge
nomad_up 1

Is it possible that you re-write URLs at some point that drops the URL scheme?

Nomon commented

d98a35d should do the trick.

hynek commented

Looks like it did indeed, thank you very much!