grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.91k stars 3.45k forks source link

logcli: live tail does not work with https proxies #6499

Open joemiller opened 2 years ago

joemiller commented 2 years ago

Describe the bug Followup issue as requested from: https://github.com/grafana/loki/pull/6484#pullrequestreview-1018094206

Support for connecting through http and https forward/CONNECT-style proxies was added to logcli in https://github.com/grafana/loki/pull/6484 with the --proxy-url flag. The current state is that both http:// and https:// proxies are supported for standard lookups. However when -t (follow/tail) is used only http:// proxies work as expected. If an https:// proxy is used the websocket proxy code in gorilla/websocket library will fail with:

Tailing logs failed: proxy: unknown scheme: https

There are a couple open issues and PR about adding https proxy support to gorilla/websocket. One in particular that I have tested as working as expected with logcli is https://github.com/gorilla/websocket/pull/740

This can be swapped in by modifying go.mod:

replace github.com/gorilla/websocket v1.4.2 => github.com/philipatl/websocket v1.4.3-0.20211206152948-d16969baa130

It is not clear when upstream gorilla/websocket will finish the work to bring in support for https proxies. It's apparent they intend to support this since there is some existing code in place, but it's not complete nor working yet.

To Reproduce Steps to reproduce the behavior:

Expected behavior Tailing of logs should work as expected as if no --proxy-url was specified.

Environment:

stale[bot] commented 2 years ago

Hi! This issue has been automatically marked as stale because it has not had any activity in the past 30 days.

We use a stalebot among other tools to help manage the state of issues in this project. A stalebot can be very useful in closing issues in a number of cases; the most common is closing issues or PRs where the original reporter has not responded.

Stalebots are also emotionless and cruel and can close issues which are still very relevant.

If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry.

We regularly sort for closed issues which have a stale label sorted by thumbs up.

We may also:

We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task, our sincere apologies if you find yourself at the mercy of the stalebot.

joemiller commented 2 years ago

please keep open