Skip to content

Conversation

@Vijay-Nirmal
Copy link

@Vijay-Nirmal Vijay-Nirmal commented Dec 29, 2025

Motivation and Context

fix: #632

Description

This PR add a sample showing how to enable HTTP request/response logging for LLM calls (including request/response bodies) for any AIClient.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings December 29, 2025 15:41
@Vijay-Nirmal Vijay-Nirmal changed the title Add AIClient HTTP Traffic Tracing sample with logging capabilities .NET: Add AIClient HTTP Traffic Tracing sample with logging capabilities Dec 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new sample demonstrating HTTP request/response logging capabilities for AIClient implementations. The sample shows developers how to enable detailed HTTP traffic tracing including request/response bodies, headers, and URLs for debugging and troubleshooting purposes.

  • Adds a new AIClientHttpTrafficTracing sample in the Observability folder
  • Demonstrates configuration of ClientLoggingOptions for Azure OpenAI clients
  • Includes comprehensive documentation with security warnings about logging sensitive data

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 15 comments.

File Description
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/README.md Documentation explaining HTTP traffic logging setup, prerequisites, security considerations, and usage instructions
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs Sample code demonstrating ClientLoggingOptions configuration with Azure OpenAI and dependency injection
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/AIClientHttpTrafficTracing.csproj Project file with necessary dependencies for the sample
dotnet/agent-framework-dotnet.slnx Solution file updated to include the new sample project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: Sample showing how to enable tracing of HTTP traffic

1 participant