Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AGMETEOR committed Jan 17, 2025
1 parent 76cfb1c commit b19e535
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion http-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
}
Expand All @@ -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))
Expand Down
1 change: 0 additions & 1 deletion otel/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b19e535

Please sign in to comment.