Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/grafana-cloud/monitor-applications/frontend-observability/instrument/faro-react/component-profiler.md (append .md) or send Accept: text/markdown to /docs/grafana-cloud/monitor-applications/frontend-observability/instrument/faro-react/component-profiler/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/llms-full.txt.
React component profiling
Follow this guide to setup and use the Faro Profiler to get insights into the render performance of a React components.
Warning
Using the profiler has an impact on performance and should not be used in production.
To use the Faro profiler, import the Faro web-tracing package and initialize Faro-React as follows:
import { matchRoutes } from 'react-router-dom';
import { getWebInstrumentations, initializeFaro } from '@grafana/faro-react';
import { TracingInstrumentation } from '@grafana/faro-web-tracing';
initializeFaro({
// Mandatory, the URL of the Grafana collector
url: 'my/collector/url',
// Mandatory, the identification label of your application
app: {
name: 'my-react-app',
},
instrumentations: [
// Load the default Web instrumentations
...getWebInstrumentations(),
// Tracing Instrumentation is needed if you want to use the React Profiler
new TracingInstrumentation(),
// ...
],
});import { withFaroProfiler } from '@grafana/faro-react';
export default withFaroProfiler(MyReactComponent);Was this page helpful?
Related resources from Grafana Labs


