I am able to send logs to OpenTelemetry normally from my local javascript project (http://localhost:3000) using the below configuration:
receivers:
otlp:
protocols:
http:
cors:
allowed_origins:
- http://localhost:3000
max_age: 7200
endpoint: 0.0.0.0:4318
exporters:
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug]
logs:
receivers: [otlp]
exporters: [debug]
Note that I am using the original collector => https://github.com/open-telemetry/opentelemetry-collector
But I am not able anymore to send logs to the collector when using https://github.com/open-telemetry/opentelemetry-collector-contrib which is a superset of the opentelemetry collector
I got
Access to resource at 'http://localhost:4318/v1/traces' from origin 'http://localhost:3000' 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.
Any ideas ?