refactor(health): restructure health check implementations into dedicated check package

- Move health check implementations from monitor/ to new check/ package
- Add h2c, tcp4/6, udp4/6 scheme support to agent health check API
- Add timeout URL parameter to agent health check endpoint
- Remove unused agent dependencies (dnsproviders, lego, various cloud SDKs)
- Use net.JoinHostPort instead of fmt.Sprintf for port joining
This commit is contained in:
yusing
2026-01-08 14:54:33 +08:00
parent 8b5cb947c8
commit 243e7e9e95
15 changed files with 380 additions and 535 deletions

View File

@@ -104,7 +104,7 @@ func (w DockerWatcher) EventsWithOptions(ctx context.Context, options DockerList
}()
chs := client.Events(ctx, options)
defer log.Debug().Str("host", client.Address()).Msg("docker watcher closed")
defer log.Debug().Str("host", client.DaemonHost()).Msg("docker watcher closed")
for {
select {
case <-ctx.Done():
@@ -177,7 +177,7 @@ func checkConnection(ctx context.Context, client *docker.SharedClient) bool {
defer cancel()
err := client.CheckConnection(ctx)
if err != nil {
log.Debug().Err(err).Str("host", client.Address()).Msg("docker watcher: connection failed")
log.Debug().Err(err).Str("host", client.DaemonHost()).Msg("docker watcher: connection failed")
return false
}
return true