is there a way to export console logs from reactjs...
# support
p
is there a way to export console logs from reactjs application ? I see that we can get traces but looking if there is an option for console logs
s
No, this is not supported yet by web js SDK. One workaround for you is to add these important logs as span events.
p
any example for adding span events ?
is there a way to add some context to a session so that we can query by session ?
s
any example for adding span events ?
https://opentelemetry.io/docs/instrumentation/js/instrumentation/#span-events https://opentelemetry.io/docs/instrumentation/js/instrumentation/#get-the-current-span
is there a way to add some context to a session so that we can query by session ?
Can you elaborate this?
p
for example i would like to query all the traces and spans for a specific userId
s
Yes, you can add custom attributes to these spans https://opentelemetry.io/docs/instrumentation/js/instrumentation/#attributes.
p
thanks will take a look at it 🙂
Another question is was getting cors error in local and was able to add origins in docker file but for k8's where do we add it ?
is it in otel-service receivers ?
s
Yes, receiver config should be updated to allow origins.
p
ohk