Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 16, 2025

This PR updates OpenTelemetry.Api from version 1.1.0 to 1.12.0 across all projects in the repository and fixes the breaking API changes introduced in the newer version.

Changes Made

Package Updates

  • Updated OpenTelemetry.Api from 1.1.0 to 1.12.0
  • Updated System.Diagnostics.DiagnosticSource from 6.0.0 to 9.0.0 (required dependency for OpenTelemetry 1.12.0)

Breaking API Changes Fixed

The OpenTelemetry 1.12.0 release deprecated several extension methods and moved functionality to the core Activity class:

  1. RecordException → AddException: Replaced all instances of the deprecated ActivityExtensions.RecordException() with the new Activity.AddException() method
  2. SetStatus simplification: Updated ActivityExtensions.SetStatus(Status.Error) to use the simpler Activity.SetStatus(ActivityStatusCode.Error) and removed duplicate calls

Files Modified

  • src/WorkflowCore/WorkflowCore.csproj - Package reference updates
  • src/WorkflowCore/Services/WorkflowActivity.cs - Fixed SetStatus API usage
  • src/WorkflowCore/Services/WorkflowHost.cs - Updated exception recording
  • src/WorkflowCore/Services/BackgroundTasks/QueueConsumer.cs - Updated exception recording (2 locations)
  • src/WorkflowCore/Services/BackgroundTasks/RunnablePoller.cs - Updated exception recording (4 locations)

Testing

  • All builds now complete without OpenTelemetry-related warnings
  • Created and ran test application to verify the new APIs work correctly
  • Sample projects build successfully with the updated dependencies
  • No functional regressions detected - all telemetry functionality continues to work as expected

Benefits

  • Uses the modern, supported OpenTelemetry API
  • Eliminates deprecated API warnings
  • Maintains backward compatibility for telemetry consumers
  • Prepares the codebase for future OpenTelemetry updates

The update ensures WorkflowCore stays current with OpenTelemetry best practices while maintaining all existing observability functionality.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Update OpenTelemetry to 1.12.0 in all projects in this repo. Fix any breaking API changes and test it all works. Update OpenTelemetry to 1.12.0 and fix breaking API changes Sep 16, 2025
Copilot AI requested a review from danielgerlag September 16, 2025 23:11
@danielgerlag danielgerlag marked this pull request as ready for review September 17, 2025 14:33
@danielgerlag danielgerlag merged commit 93b436b into master Sep 17, 2025
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants