[APM] Invalidate trackPageview on route change (#107741) (#107828)

Closes #107728.

Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
This commit is contained in:
Kibana Machine 2021-08-06 09:26:31 -04:00 committed by GitHub
parent 209b062454
commit 44c1d99a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,8 +11,8 @@ import { useTrackPageview } from '../../../../observability/public';
export function TrackPageview({ children }: { children: React.ReactElement }) {
const routePath = useRoutePath();
useTrackPageview({ app: 'apm', path: routePath });
useTrackPageview({ app: 'apm', path: routePath, delay: 15000 });
useTrackPageview({ app: 'apm', path: routePath }, [routePath]);
useTrackPageview({ app: 'apm', path: routePath, delay: 15000 }, [routePath]);
return children;
}