-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Additional tracing spans for activation, persistence, and migration #9870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ab73c41 to
e228a44
Compare
…racing Introduce distinct ActivitySources for application, runtime, lifecycle, and storage tracing in Orleans. Update grain call filter and runtime logic to use the correct source based on operation type. Enhance async enumerable tracing with session activities and proper context propagation. Add new grain and tests to verify async enumerable activity spans. Improve test coverage and assertions for new tracing structure, increasing observability and diagnostic precision across subsystems.
There was a problem hiding this 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 comprehensive distributed tracing support for Orleans grain lifecycle operations, including activation, placement, storage, and migration. The changes introduce new activity sources to organize telemetry spans and instrument key runtime operations that were previously not traced.
Key changes:
- Introduces new
ActivitySourcesandActivityNamesabstractions to centralize activity source management and operation naming - Adds tracing spans for grain activation, placement filtering, directory registration, and OnActivateAsync execution
- Adds tracing spans for storage operations (read, write, clear) with proper parent context propagation
- Adds tracing spans for grain migration (dehydrate/rehydrate) with context propagation across silos
- Adds comprehensive test coverage to verify span creation and proper parent-child relationships
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Orleans.Core.Abstractions/Diagnostics/ActivitySources.cs | New file defining centralized activity sources for Application, Runtime, Lifecycle, and Storage operations |
| src/Orleans.Core/Diagnostics/ActivityNames.cs | New file defining standardized operation names for tracing spans |
| src/Orleans.Core/Diagnostics/ActivityPropagationGrainCallFilter.cs | Updated to use new ActivitySources abstraction and route different interface types to appropriate activity sources |
| src/Orleans.Core.Abstractions/Runtime/AsyncEnumerableRequest.cs | Adds session-level activity tracking for async enumerable operations with proper parent-child relationships |
| src/Orleans.Core.Abstractions/Properties/AssemblyInfo.cs | Exposes internal types to Tester assembly for testing |
| src/Orleans.Runtime/Catalog/Catalog.cs | Adds activation span creation with activity context propagation from request context |
| src/Orleans.Runtime/Catalog/ActivationData.cs | Adds detailed lifecycle tracing for activation, dehydration, and rehydration with events and error tracking |
| src/Orleans.Runtime/Storage/StateStorageBridge.cs | Adds storage operation tracing spans with parent context from activation activity |
| src/Orleans.Runtime/Placement/PlacementService.cs | Adds placement operation tracing and placement filter spans with activity context restoration |
| test/Tester/ActivationTracingTests.cs | Comprehensive test suite verifying all new tracing spans and their parent-child relationships |
| test/Tester/ActivityPropagationTests.cs | Updated to use new ActivitySources constants |
| test/Grains/TestGrainInterfaces/IActivityGrain.cs | Adds test interface for async enumerable activity tracing |
| test/Grains/TestGrains/ActivityGrain.cs | Adds test grain implementation for async enumerable activity tracing |
…rable spans. Runtime (1.0.0 -> 2.0.0) no longer gets the Start/MoveNext/Dispose spans Application (1.0.0 -> 1.1.0) now gets the Start/MoveNext/Dispose spans and these are nested under a new span for the overall grain call being made.
|
@ReubenBond This PR should be ready for review. Docs PR also linked. Test failure appears to be a flaky test. |
Adds Lifecycle and Storage ActivitySources and new Spans for:
Additionally added public constants in Orleans.Diagnostics.ActivitySources to help with adding listeners, such as through OpenTelemetry's
.AddSource(ActivitySources.ApplicationGrainActivitySourceName). There is additionally aActivitySources.AllActivitySourceNamevalue to get all Orleans spans.Documentation PR: dotnet/docs#50919
Microsoft Reviewers: Open in CodeFlow