CORS issue when trying to hit /v1/traces endpoint of Signoz

171 Views Asked by At

I am getting CORS issue when trying to hit /v1/traces endpoint of Signoz dashboard from an Angular 16 application.

I followed the instructions on this and this pages. I am getting issue as,

Access to resource at http://10.50.21.234:3301/v1/traces from origin http://localhost:4200 has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

enter image description here

How to reproduce

  1. Install Signoz
  2. Create an Angular 16 app
  3. Enable CORS in the OTel Receiver
  4. Instrument Angular app with OpenTelemetry
  5. Update app.module.ts file
  6. Set the IP of the machine where SigNoz is installed.
  7. Update the same in app.module.ts
  8. Perform some API call
  9. In browser dev tools, under network check the /v1/traces giving CORS issue

Signoz Version: v0.32.1

Otel Config, I have enabled the cors through wildcard entries in the otel config under Receiving like the below,

enter image description here

Thank you for your support!!

1

There are 1 best solutions below

1
On

Can you try using just "*" instead of ["*"]?

Got below config from the docs at https://signoz.io/docs/userguide/otlp-http-enable-cors/

http:
  cors:
    allowed_origins:
      - "*"