grafana / faro-web-sdk

The Grafana Faro Web SDK, part of the Grafana Faro project, is a highly configurable web SDK for real user monitoring (RUM) that instruments browser frontend applications to capture observability signals. Frontend telemetry can then be correlated with backend and infrastructure data for full-stack observability.
https://grafana.com/oss/faro/
Apache License 2.0
690 stars 62 forks source link

disable logs/events #539

Closed imrishuroy closed 3 months ago

imrishuroy commented 3 months ago

Can we have a disable func to turn off sending logs and events completely, without refreshing the browser

codecapitano commented 3 months ago

hi @imrishuroy you can call faro.pause() which will stop Faro sending signals.

Cheers, Marco

imrishuroy commented 3 months ago

hi @imrishuroy you can call faro.pause() which will stop Faro sending signals.

Cheers, Marco

It worked, is there any way we can start logs/events again without init SDK because when I initialize SDK again it gives me this error "faro is already registered? Either add instrumentations, transports, etc. to the global faro instance or use the "isolate" property"

codecapitano commented 3 months ago

Hi @imrishuroy, yes can enable Faro sending events again with faro.unpause()

Cheers, Marco

PS: We definitely should document this better, thanks for the question 🙏

imrishuroy commented 3 months ago

Hi @imrishuroy, yes can enable Faro sending events again with faro.unpause()

Cheers, Marco

PS: We definitely should document this better, thanks for the question 🙏

Yes please, I struggled a lot, but the solution was quite easy BTW, thanks a lot, it helped me a lot ❤️