From d77fb953df23cafba1f4996168ab446d4b760561 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Thu, 19 Feb 2026 19:27:40 -0800 Subject: [PATCH] observer: remove TCP prober It's unused --- observer/mon_conf.go | 2 +- observer/observer.go | 1 - observer/probers/tcp/tcp.go | 32 ----------------------- observer/probers/tcp/tcp_conf.go | 45 -------------------------------- test/config-next/observer.yml | 5 ---- test/config/observer.yml | 5 ---- 6 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 observer/probers/tcp/tcp.go delete mode 100644 observer/probers/tcp/tcp_conf.go diff --git a/observer/mon_conf.go b/observer/mon_conf.go index fce31e7a145..f93d090bf5c 100644 --- a/observer/mon_conf.go +++ b/observer/mon_conf.go @@ -14,7 +14,7 @@ import ( // MonConf is exported to receive YAML configuration in `ObsConf`. type MonConf struct { Period config.Duration `yaml:"period"` - Kind string `yaml:"kind" validate:"required,oneof=DNS HTTP CRL TLS TCP AIA"` + Kind string `yaml:"kind" validate:"required,oneof=DNS HTTP CRL TLS AIA"` Settings probers.Settings `yaml:"settings" validate:"min=1,dive"` } diff --git a/observer/observer.go b/observer/observer.go index 25dd8380b5c..2c6a2facdd3 100644 --- a/observer/observer.go +++ b/observer/observer.go @@ -9,7 +9,6 @@ import ( _ "github.com/letsencrypt/boulder/observer/probers/crl" _ "github.com/letsencrypt/boulder/observer/probers/dns" _ "github.com/letsencrypt/boulder/observer/probers/http" - _ "github.com/letsencrypt/boulder/observer/probers/tcp" _ "github.com/letsencrypt/boulder/observer/probers/tls" ) diff --git a/observer/probers/tcp/tcp.go b/observer/probers/tcp/tcp.go deleted file mode 100644 index 532da81861a..00000000000 --- a/observer/probers/tcp/tcp.go +++ /dev/null @@ -1,32 +0,0 @@ -package tcp - -import ( - "context" - - "github.com/letsencrypt/boulder/observer/obsclient" -) - -type TCPProbe struct { - hostport string -} - -// Name returns a string that uniquely identifies the monitor. -func (p TCPProbe) Name() string { - return p.hostport -} - -// Kind returns a name that uniquely identifies the `Kind` of `Prober`. -func (p TCPProbe) Kind() string { - return "TCP" -} - -// Probe performs the configured TCP dial. -func (p TCPProbe) Probe(ctx context.Context) error { - c, err := obsclient.Dialer().DialContext(ctx, "tcp", p.hostport) - if err != nil { - return err - } - - c.Close() - return nil -} diff --git a/observer/probers/tcp/tcp_conf.go b/observer/probers/tcp/tcp_conf.go deleted file mode 100644 index 17576ecd78a..00000000000 --- a/observer/probers/tcp/tcp_conf.go +++ /dev/null @@ -1,45 +0,0 @@ -package tcp - -import ( - "github.com/letsencrypt/boulder/observer/probers" - "github.com/letsencrypt/boulder/strictyaml" - "github.com/prometheus/client_golang/prometheus" -) - -// TCPConf is exported to receive YAML configuration. -type TCPConf struct { - Hostport string `yaml:"hostport"` -} - -// Kind returns a name that uniquely identifies the `Kind` of `Configurer`. -func (c TCPConf) Kind() string { - return "TCP" -} - -// UnmarshalSettings takes YAML as bytes and unmarshals it to the to an -// TCPConf object. -func (c TCPConf) UnmarshalSettings(settings []byte) (probers.Configurer, error) { - var conf TCPConf - err := strictyaml.Unmarshal(settings, &conf) - if err != nil { - return nil, err - } - return conf, nil -} - -// MakeProber constructs a `TCPPProbe` object from the contents of the -// bound `TCPPConf` object. -func (c TCPConf) MakeProber(_ map[string]prometheus.Collector) (probers.Prober, error) { - return TCPProbe{c.Hostport}, nil -} - -// Instrument is a no-op to implement the `Configurer` interface. -func (c TCPConf) Instrument() map[string]prometheus.Collector { - return nil -} - -// init is called at runtime and registers `TCPConf`, a `Prober` -// `Configurer` type, as "TCP". -func init() { - probers.Register(TCPConf{}) -} diff --git a/test/config-next/observer.yml b/test/config-next/observer.yml index e8b86f12c51..282ed8154b7 100644 --- a/test/config-next/observer.yml +++ b/test/config-next/observer.yml @@ -90,8 +90,3 @@ monitors: url: http://letsencrypt.org/foo rcodes: [200, 404] useragent: "letsencrypt/boulder-observer-http-client" - - - period: 10s - kind: TCP - settings: - hostport: acme-v02.api.letsencrypt.org:443 diff --git a/test/config/observer.yml b/test/config/observer.yml index 062db6bd015..289c40c66e0 100644 --- a/test/config/observer.yml +++ b/test/config/observer.yml @@ -90,11 +90,6 @@ monitors: url: http://letsencrypt.org/foo rcodes: [200, 404] useragent: "letsencrypt/boulder-observer-http-client" - - - period: 10s - kind: TCP - settings: - hostport: acme-v02.api.letsencrypt.org:443 - period: 1h kind: AIA