Skip to content

.NET: [BREAKING] align workflow span name with OpenTelemetry conventions - #9899

Open
Vincent Biret (baywet) wants to merge 1 commit into
mainfrom
fix/workflow-span-name
Open

Vincent Biret (baywet) wants to merge 1 commit into
mainfrom
fix/workflow-span-name

Conversation

@baywet

Copy link
Copy Markdown
Member

Motivation & Context

Workflow invocation spans currently use workflow_invoke instead of invoke_workflow, the name specified by the OpenTelemetry GenAI workflow span conventions. Correct the name so telemetry consumers can identify workflow invocations consistently.

Description & Review Guide

  • What are the major changes? Correct the shared activity-name constant, update the declarative telemetry expectation and documentation, and add six regression cases covering streaming/non-streaming execution in Lockstep, OffThread, and Concurrent environments.
  • What is the impact of these changes? Invocation spans now emit invoke_workflow; execution, span lifetime, and public API signatures are unchanged. Telemetry filters using the incorrect old name must be updated.
  • What do you want reviewers to focus on? The regression asserts the literal specification name independently of the implementation constant. All six cases failed before the fix with actual name workflow_invoke.

From dotnet, the following commands passed:

dotnet run --project tests\Microsoft.Agents.AI.Workflows.UnitTests -f net10.0 --no-restore --tl:off -- --filter-class '*ObservabilityTests' --filter-class '*WorkflowRunActivityStopTests'
# Passed: 35 tests, including all six regression cases.
dotnet run --project tests\Microsoft.Agents.AI.Workflows.Declarative.UnitTests -f net10.0 --no-restore --tl:off -- --filter-class '*DeclarativeWorkflowOptionsTest'
# Passed: 10 tests.
dotnet format src\Microsoft.Agents.AI.Workflows --no-restore --verbosity minimal
# Passed.
dotnet format tests\Microsoft.Agents.AI.Workflows.UnitTests --no-restore --verbosity minimal
# Passed.
dotnet format tests\Microsoft.Agents.AI.Workflows.Declarative.UnitTests --no-restore --verbosity minimal
# Passed.

The full solution test suite was not run.

Related Issue

N/A - trivial change: correct an unambiguous span-name mismatch with the linked specification. No competing open span-name PR was found.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: GitHub Copilot assisted with implementation, regression tests, documentation, validation, and this PR description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fa592ce6-05c6-4421-801b-59c77df4b2df

Copilot AI 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.

🟢 Approval recommended

The workflow invocation span-name correction has no active review issues.

No open issues 🎉

What changed in this PR

Corrects the .NET workflow invocation span name from workflow_invoke to invoke_workflow to align with OpenTelemetry conventions. Telemetry filters using the old name will need updating.

Changes:

  • Updates the shared span-name constant and declarative telemetry expectation.
  • Adds six regression cases covering streaming and non-streaming execution across Lockstep, OffThread, and Concurrent environments.
  • Aligns API documentation and existing test comments with the corrected name.
File Description
dotnet/​tests/​Microsoft.Agents.AI.Workflows.UnitTests/​WorkflowRunActivityStopTests.cs Updates comments only to use the corrected span name.
dotnet/​tests/​Microsoft.Agents.AI.Workflows.UnitTests/​ObservabilityTests.cs Adds six cases asserting the literal convention name.
dotnet/​tests/​Microsoft.Agents.AI.Workflows.Declarative.UnitTests/​DeclarativeWorkflowOptionsTest.cs Updates the expected invocation span name.
dotnet/​src/​Microsoft.Agents.AI.Workflows/​Observability/​WorkflowTelemetryOptions.cs Corrects the span name in API documentation.
dotnet/​src/​Microsoft.Agents.AI.Workflows/​Observability/​ActivityNames.cs Changes the shared invocation span-name constant.

Review effort: Balanced

@github-actions github-actions Bot 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.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): c0fa63f0d9bb
Model: gpt-5.6-sol

Overview

The PR centralizes the corrected invoke_workflow activity name in the existing internal constant and updates its public documentation and declarative expectation consistently. The new regression covers streaming and non-streaming runs across Lockstep, OffThread, and Concurrent execution, while existing tests preserve activity enablement, routing, and disposal guarantees. No PR-introduced Critical, High, or Medium defect remains after reconciliation.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

@github-code-quality

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: C#

C# / code-coverage/dotnet

main 4d1674b fix/workflow-span-na... c0fa63f +/-
85% 85% 0%
View coverage of the 1 most impacted file.
File main 4d1674b fix/workflow-span-na... c0fa63f +/-
/home/runner/wo...SessionStore.cs 100% 56% -44%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@baywet
Vincent Biret (baywet) marked this pull request as ready for review October 30, 2026 19:15
@baywet Vincent Biret (baywet) changed the title .NET: align workflow span name with OpenTelemetry conventions .NET: [BREAKING] align workflow span name with OpenTelemetry conventions Oct 30, 2026
@agent-framework-automation agent-framework-automation Bot added the breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible label Oct 30, 2026

This branch was successfully deployed

1 active and 1 inactive deployments
github-app-auth — c0fa63f0 Deployed Oct 30, 2026 by baywet via add_label #26742
integration — c0fa63f0 Deployed Oct 30, 2026 by baywet via dotnet-foundry-hosted-it #31800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants