fix(outputs.prometheus_client): Always default to TCP (#14471)

This commit is contained in:
Joshua Powers 2024-01-04 03:11:47 -07:00 committed by GitHub
parent 6761200309
commit 9ec0894dee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,6 @@ import (
"context"
"crypto/tls"
_ "embed"
"errors"
"fmt"
"net"
"net/http"
@ -217,12 +216,13 @@ func (p *PrometheusClient) listen() (net.Listener, error) {
return p.listenTCP(p.Listen)
}
switch strings.ToLower(u.Scheme) {
case "tcp", "http":
case "", "tcp", "http":
return p.listenTCP(u.Host)
case "vsock":
return p.listenVsock(u.Host)
default:
return p.listenTCP(u.Host)
}
return nil, errors.New("Unknown scheme")
}
func (p *PrometheusClient) Connect() error {