< Previous Challenge - Home - Next Challenge >
Now that you have a working MVP, it’s time to add observability to your WanderAI agents using OpenTelemetry. Right now, if something goes wrong with your agent, you have no visibility into which tool was called, how long operations take, or how to correlate logs to specific requests.
OpenTelemetry is the industry standard for observability in modern applications. By instrumenting your application, you’ll be able to see traces showing the full journey of each request, capture timing information, and add structured context to your logs.
Microsoft Agent Framework already integrates with OpenTelemetry out of the box, and more specifically Agent Framework emits traces, logs, and metrics according to the OpenTelemetry GenAI Semantic Conventions.
In this challenge, you will initialize OpenTelemetry, verify telemetry in the console, and then confirm the same telemetry in New Relic before moving on to custom instrumentation in the next challenge.
Your goal is to add basic OpenTelemetry instrumentation to your travel planning application and validate the results:
OpenTelemetry Initialization:
Refer to the Agent Framework Observability Guide for details on initialization. It is recommended to start the simplest approach first, such as console exporter.
Once you updated your application to successfully emit traces to the console (hint: this should only include adding two lines of code to your app), start your app again and evaluate the console output.
Run the Flask app with the run.sh command. Then submit a travel request through the web UI. You should see traces being printed in the console output.
If everything is set up correctly, when you run your Flask app and submit a travel request, you should see detailed traces in the console output and in New Relic, including tool calls and route handling.

After some time, you should also see some metrics appear in the console.

If you see traces and logs being emitted there, proceed to send the same telemetry to New Relic.
Send the same telemetry to New Relic:
Note: You’re still using built-in Agent Framework OpenTelemetry here — no manual spans or other custom instrumentation yet.
If everything is set up correctly, when you run your Flask app and submit a travel request, you should see detailed traces in New Relic showing the full journey of the request, including tool calls and route handling.
Verify that your app appears in New Relic (it can take a few minutes for data to appear) as an entity within the APM & Services / Services - OpenTelemetry section. The name of the entity should match the OTEL_SERVICE_NAME you set in the .env file. Dig into Distributed tracing section and look for traces generated by your application. You should see a trace group with a name like invoke_agent xxx.

Click into the trace group to see all the individual traces for that group.

Investigate and observe the details of a single trace.

At trace level, you can also see logs associated with each span, which provides additional context for debugging and analysis.

After some time, you should also see some metrics appear in New Relic. While you are still looking at the APM & Services / Services - OpenTelemetry section and have your WanderAI entity open, navigate to the Metrics explorer sub-menu to see the collected metrics.

From here, click on the Open query console button to show all of the metrics that are currently being collected.

Sensitive Data Logging (Optional):
If you are curious, Agent Framework also allows you to configure logging of sensitive data (prompts, responses, function call arguments, and results). This will log sensitive data to the console and/or New Relic along with the traces. Be cautious when enabling this in production environments.
To complete this challenge successfully, you should be able to:
configure_otel_providers() that simplifies setup