/say-hello
endpoint, which internally calls the /generate-greeting
endpoint on the second service.
1
Create Tracing Project, API Key and copy tracing code
Follow the instructions in Getting Started to create a tracing project, generate API key and copy the
tracing code.
2
Install Dependencies
First, you need to install the following
3
Add Tracing code to FastAPI application 1
For FastAPI applications, we need to add the
Traceloop.init()
call to initialize tracing and instrument both the FastAPI app and httpx client with OpenTelemetry to capture distributed traces.FastAPI Code
4
Add Tracing code to FastAPI application 2
For FastAPI applications, we need to add the
Traceloop.init()
call to the application and instrument the FastAPI app with OpenTelemetry.FastAPI Code
Make sure to use the same tracing project fqn in the above 2 fastapi applications
5
View traces
- Start both FastAPI applications
- Hit the endpoint
http://localhost:8081/say-hello
- View the logged trace in your TrueFoundry dashboard
