Skip to content

Commit

Permalink
Debug geolocation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AGMETEOR committed Dec 5, 2024
1 parent 9b96509 commit 5fe0b0e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions instrument/instrument.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ func (ins *defaultInstrument) ProxiedBytes(ctx context.Context, sent, recv int,
record.SetBody(otlpLog.StringValue(msg))
record.SetSeverity(otlpLog.SeverityInfo)
ins.logger.Emit(ctx, record)
} else {
var record otlpLog.Record
record.SetTimestamp(time.Now())
msg := fmt.Sprintf("Geolookup successful for IP: %s in country %s", clientIP, country)
record.SetBody(otlpLog.StringValue(msg))
record.SetSeverity(otlpLog.SeverityInfo)
ins.logger.Emit(ctx, record)
}

isp := ins.ispLookup.ISP(clientIP)
Expand Down

0 comments on commit 5fe0b0e

Please sign in to comment.