-
Notifications
You must be signed in to change notification settings - Fork 15
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
Cors errors with Grafana Agent #47
Comments
Hi @nlamirault, Your setup looks alright to me at first glance, but I would suggest some additional troubleshooting steps to see what's going on. The Check that you don't have any other ingress set up for that host:
Curl the faro endpoint from the same machine running the browser and see what headers are returned:
Check the logs for your ingress controller and verify that you can see the request you make with both curl and the browser is correctly received. In the Network tab of your browser's development tools, inspect the request Faro is doing. You won't be able to see the response (it is blocked by cors), but the request might be worth checking, in case it includes strange headers. Right click that request, "Copy as curl", and try to issue it in the terminal. There you will be able to see the response with its headers. If this does not lead you to the problem, feel free to paste the output of those commands here, and we'll do our best to help you diagnose the situation :) |
Hi @roobre i migrate to Alloy.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/cors-allow-headers: DNT,X-CustomHeader,X-LANG,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Api-Key,X-Device-Id,Access-Control-Allow-Origin
nginx.ingress.kubernetes.io/cors-allow-methods: PUT, GET, POST, OPTIONS, DELETE
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
nginx.ingress.kubernetes.io/enable-cors: "true"
labels:
app: alloy-frontend
app.kubernetes.io/instance: alloy
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: alloy-frontend
app.kubernetes.io/part-of: alloy
app.kubernetes.io/version: v1.1.0
argocd.argoproj.io/instance: alloy
helm.sh/chart: alloy-frontend-0.3.0
portefaix.xyz/version: v0.54.0
name: alloy-frontend-external
namespace: opentelemetry
spec:
ingressClassName: nginx
rules:
- host: alloy-frontend.home.portefaix.xyz
http:
paths:
- backend:
service:
name: alloy-alloy-frontend
port:
number: 12345
path: /
pathType: Prefix
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/cors-allow-methods: GET, PUT, POST, DELETE, PATCH,
OPTIONS
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
nginx.ingress.kubernetes.io/cors-max-age: "1728000"
nginx.ingress.kubernetes.io/enable-cors: "true"
labels:
app: alloy-frontend
app.kubernetes.io/instance: alloy
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: alloy-frontend
app.kubernetes.io/part-of: alloy
app.kubernetes.io/version: v1.1.0
argocd.argoproj.io/instance: alloy
helm.sh/chart: alloy-frontend-0.3.0
portefaix.xyz/version: v0.54.0
name: alloy-frontend-faro-external
namespace: opentelemetry
spec:
ingressClassName: nginx
rules:
- host: alloy-frontend-faro.home.portefaix.xyz
http:
paths:
- backend:
service:
name: alloy-alloy-frontend
port:
number: 12347
path: /
pathType: Prefix and I've got an error using curl:
|
Hey, To me something seems to be off with your ingress-nginx annotations, or config. The curl command you posted should have returned CORS headers, something like:
I'd suggest taking a look at the ingress-nginx manuals, logs, and/or generated config to try and figure out what's happening in there. |
Hi, i would like to test Faro with Grafana Agent with this application.
I use a K3s cluster with nginx-ingress-controller deployed, and a Grafana Agent with Faro configuration:
Ingress:
Pizza configuration:
Pizza application is deployed and works fine. But in the browser console, i've got these logs:
How can i fix that CORS error ? Thanks.
The text was updated successfully, but these errors were encountered: