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
711 stars 65 forks source link

Session_id not getting updated in iframe #643

Open smallcatpd opened 1 month ago

smallcatpd commented 1 month ago

Description

The session_id does not get updated in iframe which causes traces / events / logs sent from within an iframe to have the initial session_id value even though it already got updated due to e.g. inactivity. It doesn’t seem to matter whether the persistent or volatile sessions are being used. May be related to: https://github.com/grafana/faro-web-sdk/issues/267

Steps to reproduce

Expected behavior

Actual behavior

Environment

Demo

Logs sent from outside of iframe after session update: Zrzut ekranu 2024-07-8 o 12 06 36 Logs sent from within iframe after session update: Zrzut ekranu 2024-07-8 o 12 07 16 Traces sent from outside of iframe after session update: Zrzut ekranu 2024-07-8 o 12 07 46 Traces sent from within iframe after session update: Zrzut ekranu 2024-07-8 o 12 07 32

Context

codecapitano commented 1 month ago

Hi @smallcatpd

Browsing contexts (like the parent page and the nested iframe) can only access resources in another if they share the same origin (protocol, host, and port).

smallcatpd commented 1 month ago

Hi @codecapitano

Yes they share the same origin and use same faro instance.

codecapitano commented 1 month ago

All right thanks. Do you use the NPM or CDN version?

smallcatpd commented 1 month ago

All right thanks. Do you use the NPM or CDN version?

NPM