React Native Embrace - Performance Tracing
[!IMPORTANT]
This module requires React Native Embrace SDK.
Embrace can collect session data and crashes as you've already seen in the Crash Reporting and Session Reporting sections.
Embrace’s Performance Tracing solution gives you complete visibility into any customized operation you’d like to track,
enabling you to identify, prioritize, and resolve any performance issue. With our tool, you can quickly spot any bottlenecks
in your app’s architecture, pinpoint areas you need to troubleshoot with high precision, and ultimately deliver a truly
optimized user experience.
Install the component
yarn add @embrace-io/react-native-spans
Or
npm install @embrace-io/react-native-spans
Adding the component to your code
import { startSpan, stopSpan } from "@embrace-io/react-native-spans";
const App = () => {
const spanId = useRef<string>();
const getDataFromServer = () => {
startSpan(`tracingName`).then((id) => {
spanId.current = id;
});
getData().then(stopTracing);
};
const stopTracing = () => {
stopSpan(spanId.current);
};
useEffect(() => {
getDataFromServer();
}, []);
return <View />;
};