envoyproxy / ratelimit

Go/gRPC service designed to enable generic rate limit scenarios from different types of applications.
Apache License 2.0
2.21k stars 428 forks source link

Redis connection Error logged in plain text #605

Closed jwillker closed 1 month ago

jwillker commented 1 month ago

Here https://github.com/envoyproxy/ratelimit/blob/ca55e1b31d023d8b8aedb8a21ca3b769fb632e95/src/redis/driver_impl.go#L45

When this error happens, the error is logged as plain text instead of using the Logger package.

Here and in many other places using fmt.Println, we should use the logger package so logs can be easily indexed in tools like Elasticsearch, Loki, or others.

The solution is to replace every Println when it should be logger.Error()

Also, there is a panic here: https://github.com/envoyproxy/ratelimit/blob/ca55e1b31d023d8b8aedb8a21ca3b769fb632e95/src/redis/driver_impl.go#L69

We should use a fatal maybe so the application stops immediately with an error message.