Skip to content

Commit 57b2dcc

Browse files
authored
Merge pull request #21 from FortnoxAB/feature/remove-host
Ability to remove host with API call
2 parents b220a3f + 742acd9 commit 57b2dcc

File tree

6 files changed

+216
-140
lines changed

6 files changed

+216
-140
lines changed

go.mod

+23-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
11
module github.com/fortnoxab/prometheus-net-discovery
22

3-
go 1.15
3+
go 1.22
44

55
require (
6-
github.com/BurntSushi/toml v0.3.1 // indirect
6+
github.com/fortnoxab/fnxlogrus v0.0.0-20220823093317-6a580c56b8fd
7+
github.com/koding/multiconfig v0.0.0-20171124222453-69c27309b2d7
8+
github.com/prometheus/client_golang v1.20.1
9+
github.com/sirupsen/logrus v1.9.3
10+
github.com/stretchr/testify v1.9.0
11+
)
12+
13+
require (
14+
github.com/BurntSushi/toml v1.4.0 // indirect
15+
github.com/beorn7/perks v1.0.1 // indirect
16+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
17+
github.com/davecgh/go-spew v1.1.1 // indirect
718
github.com/fatih/camelcase v1.0.0 // indirect
819
github.com/fatih/structs v1.1.0 // indirect
9-
github.com/fortnoxab/fnxlogrus v0.0.0-20181213065106-cbb7cf837eba
10-
github.com/koding/multiconfig v0.0.0-20171124222453-69c27309b2d7
20+
github.com/klauspost/compress v1.17.9 // indirect
21+
github.com/kr/text v0.2.0 // indirect
22+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
1123
github.com/pkg/errors v0.9.1 // indirect
12-
github.com/sirupsen/logrus v1.7.0
13-
github.com/stretchr/testify v1.2.2
14-
golang.org/x/sys v0.1.0 // indirect
24+
github.com/pmezard/go-difflib v1.0.0 // indirect
25+
github.com/prometheus/client_model v0.6.1 // indirect
26+
github.com/prometheus/common v0.55.0 // indirect
27+
github.com/prometheus/procfs v0.15.1 // indirect
28+
golang.org/x/sys v0.24.0 // indirect
29+
google.golang.org/protobuf v1.34.2 // indirect
1530
gopkg.in/yaml.v2 v2.4.0 // indirect
31+
gopkg.in/yaml.v3 v3.0.1 // indirect
1632
)

go.sum

+48-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,63 @@
1-
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
2-
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
1+
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
2+
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
3+
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
4+
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
5+
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
6+
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
7+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
8+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
39
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
410
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
511
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
612
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
713
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
814
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
9-
github.com/fortnoxab/fnxlogrus v0.0.0-20181213065106-cbb7cf837eba h1:v8Zke9co1hdogIVKYUykqbsS+vRQT2a70FiOOR1zPfU=
10-
github.com/fortnoxab/fnxlogrus v0.0.0-20181213065106-cbb7cf837eba/go.mod h1:NVouiena6I9bpmehL53/Z3h9c1nVbz01cLdtBaMjA/c=
15+
github.com/fortnoxab/fnxlogrus v0.0.0-20220823093317-6a580c56b8fd h1:vjKVmkcuAhOGIJnbCGfm1MvKvJgE7jpIZTHS6pqdV+s=
16+
github.com/fortnoxab/fnxlogrus v0.0.0-20220823093317-6a580c56b8fd/go.mod h1:R6mab3Zy+NZ3qi4krgbsMSPFVh2AFVSBG2xnus0fl0Q=
17+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
18+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
19+
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
20+
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
1121
github.com/koding/multiconfig v0.0.0-20171124222453-69c27309b2d7 h1:SWlt7BoQNASbhTUD0Oy5yysI2seJ7vWuGUp///OM4TM=
1222
github.com/koding/multiconfig v0.0.0-20171124222453-69c27309b2d7/go.mod h1:Y2SaZf2Rzd0pXkLVhLlCiAXFCLSXAIbTKDivVgff/AM=
23+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
24+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
25+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
26+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
27+
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
28+
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
29+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
30+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
1331
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
1432
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
1533
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1634
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
17-
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
18-
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
19-
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
20-
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
21-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
22-
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
23-
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
24-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
35+
github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8=
36+
github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
37+
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
38+
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
39+
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
40+
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
41+
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
42+
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
43+
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
44+
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
45+
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
46+
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
47+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
48+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
49+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
50+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
51+
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
52+
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
53+
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
54+
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
55+
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
2556
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
57+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
58+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
2659
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
2760
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
61+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
62+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
63+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

helpers.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bufio"
55
"bytes"
66
"context"
7-
"crypto/tls"
87
"encoding/json"
98
"fmt"
109
"net"
@@ -30,9 +29,19 @@ func getFirst(s []string) string {
3029
return ""
3130
}
3231

32+
var dialer = &net.Dialer{
33+
Timeout: 3 * time.Second,
34+
KeepAlive: 30 * time.Second,
35+
}
3336
var client = &http.Client{
3437
Transport: &http.Transport{
35-
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // #nosec only cockroach at the moment
38+
// TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // #nosec only cockroach at the moment
39+
DialContext: dialer.DialContext,
40+
ForceAttemptHTTP2: true,
41+
MaxIdleConns: 100,
42+
IdleConnTimeout: 10 * time.Second,
43+
TLSHandshakeTimeout: 10 * time.Second,
44+
ExpectContinueTimeout: 1 * time.Second,
3645
},
3746
}
3847

main.go

+19-117
Original file line numberDiff line numberDiff line change
@@ -23,107 +23,26 @@ import (
2323

2424
// ExporterConfig configures ports to scan to what filename to save it to.
2525
// if path is set we will try to make a HTTP get and find # TYPE in the first 10 rows of the response to make sure we know its prometheus metrics.
26-
// TODO make this runtime configurable.
2726
type ExporterConfig []struct {
2827
port string
2928
filename string
3029
path string
3130
}
3231

33-
const ExporterExporterPort = "9999"
34-
3532
var exporterConfig = ExporterConfig{
36-
{ // special exporter_exporter we scan this first to know if we can skip the other ports.
37-
port: ExporterExporterPort,
33+
// We only support exporter_exporter at the moment
34+
{
35+
port: "",
3836
filename: "",
3937
},
40-
/*
41-
disabled those since we only use exporter_exporter on 9999 for now.
42-
TODO move this to a config
43-
{
44-
port: "8081",
45-
filename: "php",
46-
path: "http://%s/metrics",
47-
},
48-
{
49-
port: "9100",
50-
filename: "node",
51-
},
52-
{
53-
port: "9108",
54-
filename: "elasticsearch",
55-
},
56-
{
57-
port: "9114",
58-
filename: "elasticsearch",
59-
},
60-
{
61-
port: "9216",
62-
filename: "mongodb",
63-
},
64-
{
65-
port: "9091",
66-
filename: "minio",
67-
path: "http://%s/minio/prometheus/metrics",
68-
},
69-
{
70-
port: "9101",
71-
filename: "haproxy",
72-
},
73-
{
74-
port: "9104",
75-
filename: "mysql",
76-
},
77-
{
78-
port: "9113",
79-
filename: "nginx",
80-
},
81-
{
82-
port: "9121",
83-
filename: "redis",
84-
},
85-
{
86-
port: "9150",
87-
filename: "memcached",
88-
},
89-
{
90-
port: "9154",
91-
filename: "postfix",
92-
},
93-
{
94-
port: "9182",
95-
filename: "wmi",
96-
},
97-
{
98-
port: "9187",
99-
filename: "postgres",
100-
},
101-
{
102-
port: "9188",
103-
filename: "pgbouncer",
104-
},
105-
{
106-
port: "9189",
107-
filename: "barman",
108-
},
109-
{
110-
port: "9253",
111-
filename: "php-fpm",
112-
},
113-
{
114-
port: "9308",
115-
filename: "kafka",
116-
},
117-
{
118-
port: "9496",
119-
filename: "389ds",
120-
},
121-
*/
12238
}
12339

40+
var mutex sync.Mutex
41+
12442
func main() {
12543
config := &Config{}
12644
multiconfig.MustLoad(&config)
45+
exporterConfig[0].port = config.ExpoterExporterPort
12746

12847
fnxlogrus.Init(config.Log, logrus.StandardLogger())
12948

@@ -138,14 +57,11 @@ func main() {
13857
logrus.Infof("Running with interval %s", interval)
13958

14059
ticker := time.NewTicker(interval)
141-
interrupt := make(chan os.Signal, 1)
142-
signal.Notify(interrupt, os.Interrupt, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
143-
144-
ctx, cancel := context.WithCancel(context.Background())
60+
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGQUIT, syscall.SIGTERM)
61+
defer cancel()
14562

14663
go func() {
147-
<-interrupt
148-
cancel()
64+
startWs(config, ctx)
14965
ticker.Stop()
15066
log.Println("Shutting down")
15167
}()
@@ -226,6 +142,8 @@ func runDiscovery(parentCtx context.Context, config *Config, networks []string)
226142
}
227143

228144
func saveConfigs(ctx context.Context, config *Config, exporters Exporters) {
145+
mutex.Lock()
146+
defer mutex.Unlock()
229147
for name, addresses := range exporters {
230148
if ctx.Err() != nil {
231149
return
@@ -260,16 +178,11 @@ func discoverNetwork(network string, queue chan func(context.Context), exporter
260178
port := data.port
261179
logrus.Debugf("scanning port: %s:%s", ip, port)
262180
var exporters []string
263-
if port == ExporterExporterPort {
264-
exporters, err = checkExporterExporter(ctx, ip, port)
265-
if err != nil {
266-
if !errors.Is(err, context.DeadlineExceeded) && !IsTimeout(err) {
267-
logrus.Errorf("error fetching from exporter_exporter: %s", err)
268-
}
269-
logrus.Debugf("%s:%s was not open", ip, port)
270-
continue
181+
exporters, err = checkExporterExporter(ctx, ip, port)
182+
if err != nil {
183+
if !errors.Is(err, context.DeadlineExceeded) && !IsTimeout(err) {
184+
logrus.Debugf("error fetching from exporter_exporter: %s", err)
271185
}
272-
} else if !alive(ctx, ip, port, data.path) {
273186
logrus.Debugf("%s:%s was not open", ip, port)
274187
continue
275188
}
@@ -297,18 +210,7 @@ func discoverNetwork(network string, queue chan func(context.Context), exporter
297210
}
298211
exporter <- &a
299212
}
300-
return // we found exporter_exporter dont scan other ports so return here
301213
}
302-
303-
a := Address{
304-
IP: strings.TrimSpace(ip),
305-
Hostname: strings.TrimSpace(hostname),
306-
Subnet: strings.TrimSpace(network),
307-
Exporter: data.filename,
308-
Port: port,
309-
}
310-
311-
exporter <- &a
312214
}
313215
}
314216
}
@@ -335,9 +237,9 @@ func getOldGroups(path string) ([]Group, error) {
335237
func writeFileSDConfig(config *Config, exporterName string, addresses []Address) error {
336238
path := filepath.Join(config.FileSdPath, exporterName+".json")
337239

338-
if _, err := os.Stat(config.FileSdPath); os.IsNotExist(err) {
339-
os.MkdirAll(config.FileSdPath, 0755)
340-
}
240+
if _, err := os.Stat(config.FileSdPath); os.IsNotExist(err) {
241+
os.MkdirAll(config.FileSdPath, 0755)
242+
}
341243

342244
groups := []Group{}
343245

@@ -349,7 +251,7 @@ func writeFileSDConfig(config *Config, exporterName string, addresses []Address)
349251
"host": v.Hostname,
350252
},
351253
}
352-
if v.Port == ExporterExporterPort {
254+
if v.Port == config.ExpoterExporterPort {
353255
group.Labels["__metrics_path__"] = "/proxy"
354256
group.Labels["__param_module"] = exporterName
355257
}

models.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ type Config struct {
99
// Interval is how often to scan. Default 60m
1010
Interval string `default:"60m"`
1111
// FileSdPath specifies where to put your generated files. Example /etc/prometheus/file_sd/
12-
FileSdPath string
13-
Log fnxlogrus.Config
12+
FileSdPath string
13+
Log fnxlogrus.Config
14+
Port string `default:"8080"`
15+
ExpoterExporterPort string `default:"9999"`
1416
}
1517

1618
// Exporters is a list of addresses grouped by exporter name.

0 commit comments

Comments
 (0)