.NET: Workflow observability (#959)

* Add basic Workflow telemetry

* Add sample

* Add source propagation for executor spans

* Fix tests and address comments

* Fix formatting

* Fix declarative unit tests

* Address comments

* Remove Microsoft.Extensions.AI.Agents.EnableTelemetry

* Formatting

* Formatting

* Formatting

* fix solution

* Address comments

* Add workflow json definition for serialization

* Formmating

* Address comments
This commit is contained in:
Tao Chen
2025-09-30 16:40:04 -07:00
committed by GitHub
Unverified
parent 2539282d30
commit 042099009f
29 changed files with 600 additions and 74 deletions
@@ -139,14 +139,6 @@ using var telemetryAgent = baseAgent.WithOpenTelemetry();
var response = await telemetryAgent.RunAsync(messages);
```
### Integration with AppContext Switch
The implementation integrates with the standard .NET telemetry enablement pattern:
```csharp
AppContext.SetSwitch("Microsoft.Extensions.AI.Agents.EnableTelemetry", true);
```
### Relationship to Microsoft.Extensions.AI
This implementation follows the exact patterns established by Microsoft.Extensions.AI's OpenTelemetry instrumentation, ensuring consistency across the AI ecosystem and leveraging proven patterns for telemetry integration.