.NET: Add workflow as an agent with observability sample#1612
Merged
lokitoth merged 7 commits intomicrosoft:mainfrom Nov 3, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 |
dotnet/samples/GettingStarted/Workflows/Observability/WorkflowAsAnAgent/Program.cs
Show resolved
Hide resolved
ekzhu
approved these changes
Oct 24, 2025
lokitoth
reviewed
Nov 3, 2025
dotnet/samples/GettingStarted/Workflows/Observability/WorkflowAsAnAgent/WorkflowHelper.cs
Show resolved
Hide resolved
4 tasks
lokitoth
approved these changes
Nov 3, 2025
4 tasks
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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