-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Explore: Loki in live mode is not working since 6.6.0 #22905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you mind rewriting the issue to abide by our standard issue template? |
I used the issue template, I just deleted some of the parts that I don't think that apply to this issue. But I will add them. Thanks for the help. |
Have the same error with Grafana 6.7.1 and Loki 1.3
|
Same issue here, grafana 6.7.1 and loki 1.3, logcli is running fine in tail mode |
Same issue: |
Hi, when I try this with Grafana 6.7.2 the live logs for Loki works for me. Has this been resolved maybe? |
I just tested 6.7.2 but the issue is still happening. From what I know it does not happen to everyone. |
Maybe you need to update Loki? What version of Loki are you using? Also try latest version of Grafana |
Maybe you have proxy in front of Grafana that does not support websockets? |
Tried latest version of Grafana and Loki with no success. I do have a proxy in front of Grafana and also a proxy between Grafana and Loki, but this setup is working great with Grafana 6.5.3, so proxies are not the problem. It breaks from Grafana 6.6.0. Maybe some change was introduced in that version that is not compatible with our setup. Do you recall any changes introduced in this version that could be the source of the problem? Maybe endpoint changes or any other change? Not saying a bug, but maybe just a breaking change that we should be aware of. |
I found the issue!! It was an endpoint change like I said in the previous message. Now Grafana is requesting this Loki's endpoint: So any setup in the proxies related to the older version, like a |
Hello @danieldabate! I am glad that you were able to solve the problem. 🚀 I am going to close this issue as in the next release we are are going to stop supporting legacy Loki endpoints (before v1). As it is a breaking change, it is going to be communicated in the release notes. |
Thanks @danieldabate, you saved my some time. |
@ivanahuckova 7.0.0-beta3 still this issue nginx-proxy |
Live mode requires websocket. |
@s5unty |
Just to help those coming here from a fresh Grafana and Loki deployment via Helm, when you add Loki to your Data Sources, check your logs on the loki pod and you will likely see errors about the Connection or Upgrade headers. You need to add two custom headers in the config for the Loki Data Source in Grafana.
|
I am having this issue no proxy in the middle (between grafan and loki) added the two custom headers the issue persists. |
I'm using ambassador Mappings, doing this worked for me, which means. for those not working, try allowing WebSocket connection upgrade. to their controllers/servers. |
Custom headers didn't solve it for me but here is the config:
I'm getting |
we are having exact same issues when X-Scope-OrgID header contains more than 1 tenant id. |
This is a completely different error than what the custom headers are supposed to solve. Custom headers only solve the issue when the error states that it is a Connection or Upgrade header issue. |
I was able to fix this by enabling httpHeaderName1: Connection
httpHeaderName2: Upgrade
httpHeaderValue1: Upgrade
httpHeaderValue2: websocket For what its worth, my grafana instance is behind HTTPProxy with Contour. Here's for nginx (https://www.civo.com/learn/using-websockets-with-ingress-controller) apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: web-socket
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/server-snippets: |
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_set_header Connection "upgrade";
proxy_cache_bypass $http_upgrade;
}
... My HTTPProxy is as follows. apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: grafana
namespace: grafana
spec:
virtualhost:
fqdn: private.com
tls:
secretName: cert-tls
routes:
- services:
- name: grafana-operator-grafana-service
port: 3000
enableWebsockets: true |
Uh oh!
There was an error while loading. Please reload this page.
What happened:
Beginning from Grafana 6.6.0 we started seeing this issue where activating Loki in live mode explodes with a generic parsing error.
An unexpected error happened Details TypeError: Cannot read property 'slice' of null
Tracing the issue we found that Loki is throwing this message:
msg="Error in upgrading websocket" err="websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"
What you expected to happen:
Grafana working correctly with Loki in live mode
How to reproduce it (as minimally and precisely as possible):
There's no particular way to reproduce the issue. Just using the Live mode for Loki with Grafana v6.6.0 or later.
Anything else we need to know?:
We are stuck in version 6.5.3 and have not found anything in our configuration that could fix this issue. We have an nginx correctly setup between Grafana and Loki and it has been working great until now.
Any help would be very appreciated.
Environment:
The text was updated successfully, but these errors were encountered: