Skip to content

Conversation

@TaoChenOSU
Copy link
Contributor

@TaoChenOSU TaoChenOSU commented Oct 21, 2025

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.

@TaoChenOSU TaoChenOSU self-assigned this Oct 21, 2025
Copilot AI review requested due to automatic review settings October 21, 2025 22:54
@TaoChenOSU TaoChenOSU added .NET workflows Related to Workflows in agent-framework labels Oct 21, 2025
@github-actions github-actions bot changed the title Add workflow as an agent with observability sample .NET: Add workflow as an agent with observability sample Oct 21, 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 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

@lokitoth lokitoth mentioned this pull request Nov 3, 2025
4 tasks
@TaoChenOSU TaoChenOSU added this pull request to the merge queue Nov 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 3, 2025
@lokitoth lokitoth added this pull request to the merge queue Nov 3, 2025
Merged via the queue into microsoft:main with commit b0ee702 Nov 3, 2025
14 checks passed
@lokitoth lokitoth mentioned this pull request Nov 3, 2025
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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants