Skip to content

.NET: Add workflow as an agent with observability sample - #1612

Merged
Jacob Alber (lokitoth) merged 7 commits into
microsoft:mainfrom
TaoChenOSU:taochen/dotnet-workflow-as-an-agent-observability-sample
Nov 3, 2025
Merged

.NET: Add workflow as an agent with observability sample#1612
Jacob Alber (lokitoth) merged 7 commits into
microsoft:mainfrom
TaoChenOSU:taochen/dotnet-workflow-as-an-agent-observability-sample

Conversation

@TaoChenOSU

@TaoChenOSUTao Chen (TaoChenOSU) commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

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:

  1. The chat client level
  2. The agent level for agents inside the workflow
  3. The workflow level (implicit)
  4. The workflow agent level
image

This sample is known to fail after more than one turn. The issue is tracked here: #1613

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.

CopilotAI review requested due to automatic review settings October 21, 2025 22:54
@TaoChenOSUTao Chen (TaoChenOSU) added .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Oct 21, 2025
@github-actionsgithub-actionsBot changed the title Add workflow as an agent with observability sample.NET: Add workflow as an agent with observability sampleOct 21, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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
FileDescription
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.csEnhanced user prompt with exit instruction
agent-framework-dotnet.slnxAdded new sample project to solution

@TaoChenOSU
Tao Chen (TaoChenOSU) added this pull request to the merge queueNov 3, 2025
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Nov 3, 2025
@lokitoth
Jacob Alber (lokitoth) added this pull request to the merge queueNov 3, 2025
Merged via the queue into microsoft:main with commit b0ee702Nov 3, 2025
14 checks passed
Aris Nguyen (arisng) pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
)
* Add workflow as an agent with observability sample
* Address comment
* Fix formatting
* enable sensitive data
* enable sensitive data for sub agents
* adjust aggregator handlers
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NETUsage: [Issues, PRs], Target: .NetworkflowsUsage: [Issues, PRs], Target: Workflows

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

@TaoChenOSU@ekzhu@lokitoth