Galileo Instrumentation for LangChain Apps

Run and Verify the Trace

5 minutes

Run the travel planner, send a request through it, then confirm the multi-agent trace landed in Galileo.

Exercise Run the app and verify the trace
1

Run the app

Start the app:

bash
python3 main.py
2

Send a request to the app

In a second terminal, send a travel-planning request. You should get the planned itinerary back, confirming the workflow still runs end-to-end with the callback attached:

bash
curl http://localhost:8080/travel/plan \
  -H "Content-Type: application/json" \
  -d '{
    "origin": "Philadelphia",
    "destination": "Florida",
    "user_request": "Planning a two day long trip from Philadelphia to Florida. Looking for a boutique hotel, business-class flights and unique experiences.",
    "travelers": 2
  }'
3

Verify the trace in Galileo

In the Galileo console (https://console.multitenant.galileocloud.io/splunkse) , open the Workshop19Galileo project (unless you commented out the GALILEO_PROJECT environment variable in the .env file).

Then, to find your log stream, first echo the INSTANCE environment variable on your EC2 instance:

bash
echo $INSTANCE

Then look for the log stream named TravelPlanner- followed by your instance name. For example, TravelPlanner-shw-9306.

4

Find the trace

Open the most recent trace. Because the callback was attached at the graph level, you should see a single trace for the request containing a nested LLM span for each agent node:

  • coordinator
  • flight_specialist
  • hotel_specialist
  • activity_specialist
  • plan_synthesizer
5

Inspect the spans

Expand any span and verify it captured the system and human messages, the model response, the model name, token counts, and latency.

No trace showing up?

  • Confirm GALILEO_API_KEY is set in the environment the app runs in (it loads .env via load_dotenv()).
  • Confirm you’re viewing the right project and log stream: the values from GALILEO_PROJECT / GALILEO_LOG_STREAM if you set them, or default / default if you didn’t.
  • If you don’t see the project, you likely don’t have the correct permissions.
  • Check the app logs for Galileo errors in the bash where python3 main.py is running.
  • Confirm that you are in the splunkse organization in the top left of the web page.

A single travel-planning request produces one trace containing five nested LLM spans, rather than five separate traces. Why?

Click here to see the answer
Because the whole LangGraph workflow runs as one root run per request, and the callback was attached to that run’s config. LangGraph executes the five nodes (coordinator, flight, hotel, activity, synthesizer) within that single run, so each node’s llm.invoke(...) becomes a child span under the same trace. If you instead created a new callback and a new run for each node, you’d get five disconnected traces (and sessions) and lose the end-to-end view of the request.