-
Notifications
You must be signed in to change notification settings - Fork 996
.NET: Add AIClient HTTP Traffic Tracing sample with logging capabilities #3053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
.NET: Add AIClient HTTP Traffic Tracing sample with logging capabilities #3053
Conversation
There was a problem hiding this 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
ClientLoggingOptionsfor 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 |
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Outdated
Show resolved
Hide resolved
...es/GettingStarted/Observability/AIClientHttpTrafficTracing/AIClientHttpTrafficTracing.csproj
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/Program.cs
Show resolved
Hide resolved
dotnet/samples/GettingStarted/Observability/AIClientHttpTrafficTracing/README.md
Outdated
Show resolved
Hide resolved
…cTracing/README.md Co-authored-by: Copilot <[email protected]>
…cTracing/Program.cs Co-authored-by: Copilot <[email protected]>
…cTracing/Program.cs Co-authored-by: Copilot <[email protected]>
…cTracing/AIClientHttpTrafficTracing.csproj Co-authored-by: Copilot <[email protected]>
…cTracing/Program.cs Co-authored-by: Copilot <[email protected]>
…cTracing/README.md Co-authored-by: Copilot <[email protected]>
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