-
Notifications
You must be signed in to change notification settings - Fork 1.1k
.NET: Add workflow as an agent with observability sample #1612
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
.NET: Add workflow as an agent with observability sample #1612
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 how to enable OpenTelemetry observability for workflows when used as AI agents. The sample creates a concurrent workflow with French and English language agents, showing telemetry instrumentation at the chat client, agent, workflow, and workflow agent levels. The sample uses an interactive loop with streaming responses and exports traces to both an Aspire dashboard and optionally to Azure Monitor.
Key changes:
- Added WorkflowAsAnAgentObservability sample with OpenTelemetry instrumentation at multiple levels
- Fixed namespace typo in existing WorkflowAsAnAgent sample from "WorkflowAsAnAgentsSample" to "WorkflowAsAnAgentSample"
- Improved prompt text in AgentOpenTelemetry sample to clarify exit instruction
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WorkflowAsAnAgent/WorkflowHelper.cs (new) | Implements workflow with concurrent French/English agents and telemetry support |
| WorkflowAsAnAgent/Program.cs (new) | Main program demonstrating OpenTelemetry setup and interactive workflow execution |
| WorkflowAsAnAgentObservability.csproj (new) | Project file with required dependencies for OpenTelemetry and Azure integration |
| WorkflowAsAnAgent/WorkflowHelper.cs (existing) | Updated namespace and refactored executor implementation to use route handlers |
| WorkflowAsAnAgent/Program.cs (existing) | Corrected namespace typo |
| AgentOpenTelemetry/Program.cs | Enhanced user prompt with exit instruction |
| agent-framework-dotnet.slnx | Added new sample project to solution |
Motivation and Context
We need a sample to show how to enable observability of workflow agents (a workflow used as an AI agent).
Also closing #1814
Description
Add a sample to show how to enable observability for workflow as an agent. The sample enables telemetry at multiple levels:
This sample is known to fail after more than one turn. The issue is tracked here: #1613
Contribution Checklist