This is a sample React application that fetches data from multiple public APIs and implements OpenTelemetry tracing. You can choose between the TypeScript or JavaScript version of the app.
-
Navigate to the TypeScript directory:
cd typescript -
Install dependencies: Run the following command to install the required dependencies:
npm install
-
Configure OpenTelemetry:
- Open the
src/tracing.tsfile. - Replace
service_name,region, and thesignoz-access-token(or your ingestion key) in theOTLPTraceExporterconfiguration.
- Open the
-
Start the development server: Run the following command to start the application:
npm run start
-
Access the app: The app should now be running on
http://localhost:3000.
-
Navigate to the JavaScript directory:
cd javascript -
Install dependencies: Run the following command to install the required dependencies:
npm install
-
Configure OpenTelemetry:
- Open the
src/tracing.jsfile. - Replace
service_name,region, and thesignoz-access-token(or your ingestion key) in theOTLPTraceExporterconfiguration.
- Open the
-
Start the development server: Run the following command to start the application:
npm run start
-
Access the app: The app should now be running on
http://localhost:3000.
- For the TypeScript version, navigate to the
typescriptfolder, install dependencies, configure the tracing, and runnpm run start. - For the JavaScript version, navigate to the
javascriptfolder, install dependencies, configure the tracing, and runnpm run start.
Both versions are designed to fetch data from various public APIs and display the results on the home page while sending traces to a backend (e.g., Signoz) using OpenTelemetry.
Happy coding! 🚀