diff --git a/http-proxy/main.go b/http-proxy/main.go index 11aa79d8..a97f81bf 100644 --- a/http-proxy/main.go +++ b/http-proxy/main.go @@ -497,7 +497,7 @@ func main() { p.ISPLookup = geo.FromWeb(geoip2ISPURL, "GeoIP2-ISP.mmdb", 24*time.Hour, *geoip2ISPDBFile, geo.ISP) } - otel.Debug(ctx, "TESTING OTEL LOGGER 123...") + otel.InitLogger() // For now I want to see if I can get logs to the otel collector err = p.ListenAndServe(ctx) if err != nil { diff --git a/http_proxy.go b/http_proxy.go index c8c44d96..4fb7224c 100644 --- a/http_proxy.go +++ b/http_proxy.go @@ -269,6 +269,8 @@ func (p *Proxy) ListenAndServe(ctx context.Context) error { p.instrument.Connection(ctx, clientIP) }, }) + + otel.Debug(ctx, "TESTING OTEL LOGGER 123...") stopProxiedBytes := p.configureTeleportProxiedBytes() defer stopProxiedBytes() @@ -289,8 +291,11 @@ func (p *Proxy) ListenAndServe(ctx context.Context) error { allListeners := make([]net.Listener, 0) listenerProtocols := make([]string, 0) + otel.Debug(ctx, "TESTING OTEL LOGGER 123...") + listenerArgs := getProtoListenersArgs(p) for _, args := range listenerArgs { + otel.Debug(ctx, "TESTING OTEL LOGGER 123...") if args.addr == "" { continue } @@ -306,6 +311,8 @@ func (p *Proxy) ListenAndServe(ctx context.Context) error { allListeners = append(allListeners, listeners.NewAllowingListener(l, blacklist.OnConnect)) } + otel.Debug(ctx, "TESTING OTEL LOGGER 123...") + errCh := make(chan error, len(allListeners)) if p.EnableMultipath { mpl := multipath.NewListener(allListeners, p.instrument.MultipathStats(listenerProtocols)) diff --git a/otel/logger.go b/otel/logger.go index d1102d7a..3d25b651 100644 --- a/otel/logger.go +++ b/otel/logger.go @@ -42,7 +42,6 @@ func InitLogger() error { } func Debug(ctx context.Context, title string) { - InitLogger() // For now I want to see if I can get logs to the otel collector var record otelLog.Record record.SetTimestamp(time.Now()) record.SetBody(otelLog.StringValue(title))