-
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
Open
rkargMsft
wants to merge
33
commits into
dotnet:main
Choose a base branch
from
rkargMsft:moar_tracing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
169221a
WIP
rkargMsft de49ce1
Pulling more spans in to activation tracing
rkargMsft 35e3b15
Spans for persistence state
rkargMsft b373c13
dehydrate/rehydrate spans
rkargMsft bf34edf
Separating class
rkargMsft 28d99ab
removing nullable
rkargMsft 35d44f7
reverting nullable operation
rkargMsft 14a5948
removing unnecessary change
rkargMsft 7e84718
Using activity source to ensure we see the root span in the test debu…
rkargMsft bad6862
aligning span naming with OTel conventions
rkargMsft 766ee7e
renaming remaining spans
rkargMsft e17c02a
only add dehydrate/rehydrate for grain migration participants
rkargMsft 28deb88
Refactor tracing: add granular ActivitySources and IAsyncEnumerable t…
rkargMsft 7ac178c
Implementing valid Copilot feedback
rkargMsft d711915
Updating ActivitySource versions to denote changes around IAsyncEnume…
rkargMsft d2f0988
consolidate setting Activity error properties
rkargMsft 8e17e37
setting error description string
rkargMsft 4023e16
correcting method call
rkargMsft b6a6be9
explicit using on activity
rkargMsft db53ae2
fixing locking on `this`
rkargMsft 7434d99
explicit discard
rkargMsft a2211ef
more explicit discards
rkargMsft b605059
set Activity error on rehydrate error
rkargMsft 9b9dfab
restoring current activity after placement
rkargMsft dbf9b8f
Commenting on current need to lock on `this`
rkargMsft 911cc1a
Using constants for tags and error descriptions
rkargMsft 06a72cb
adding deactivation Activity
rkargMsft 7fb2440
Fixing errant using
rkargMsft 54a3f4d
fix: adding deactivate Activity
rkargMsft f92f1d8
additional test scenario around IAsyncEnumerable use case and explici…
rkargMsft a808941
always stopping deactivate grain span
rkargMsft 680b822
correct parenting of spans for accepting migrations
rkargMsft f2656df
Improve Orleans tracing: context propagation & test coverage
rkargMsft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/Orleans.Core.Abstractions/Diagnostics/ActivitySources.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| using System.Diagnostics; | ||
|
|
||
| namespace Orleans.Diagnostics; | ||
|
|
||
| public static class ActivitySources | ||
| { | ||
| /// <summary> | ||
| /// Spans triggered from application level code | ||
| /// </summary> | ||
| public const string ApplicationGrainActivitySourceName = "Microsoft.Orleans.Application"; | ||
| /// <summary> | ||
| /// Spans triggered from Orleans runtime code | ||
| /// </summary> | ||
| public const string RuntimeActivitySourceName = "Microsoft.Orleans.Runtime"; | ||
| /// <summary> | ||
| /// Spans tied to lifecycle operations such as activation, migration, and deactivation. | ||
| /// </summary> | ||
| public const string LifecycleActivitySourceName = "Microsoft.Orleans.Lifecycle"; | ||
| /// <summary> | ||
| /// Spans tied to persistent storage operations. | ||
| /// </summary> | ||
| public const string StorageActivitySourceName = "Microsoft.Orleans.Storage"; | ||
| /// <summary> | ||
| /// A wildcard name to match all Orleans activity sources. | ||
| /// </summary> | ||
| public const string AllActivitySourceName = "Microsoft.Orleans.*"; | ||
|
|
||
| internal static readonly ActivitySource ApplicationGrainSource = new(ApplicationGrainActivitySourceName, "1.1.0"); | ||
| internal static readonly ActivitySource RuntimeGrainSource = new(RuntimeActivitySourceName, "2.0.0"); | ||
| internal static readonly ActivitySource LifecycleGrainSource = new(LifecycleActivitySourceName, "1.0.0"); | ||
| internal static readonly ActivitySource StorageGrainSource = new(StorageActivitySourceName, "1.0.0"); | ||
| } | ||
148 changes: 148 additions & 0 deletions
148
src/Orleans.Core.Abstractions/Diagnostics/ActivityTagKeys.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| namespace Orleans.Diagnostics; | ||
|
|
||
| /// <summary> | ||
| /// Contains constants for Activity tag keys used throughout Orleans. | ||
| /// </summary> | ||
| internal static class ActivityTagKeys | ||
| { | ||
| /// <summary> | ||
| /// The request ID for an async enumerable operation. | ||
| /// </summary> | ||
| public const string AsyncEnumerableRequestId = "orleans.async_enumerable.request_id"; | ||
|
|
||
| /// <summary> | ||
| /// The activation ID tag key. | ||
| /// </summary> | ||
| public const string ActivationId = "orleans.activation.id"; | ||
|
|
||
| /// <summary> | ||
| /// The activation cause tag key (e.g., "new" or "rehydrate"). | ||
| /// </summary> | ||
| public const string ActivationCause = "orleans.activation.cause"; | ||
|
|
||
| /// <summary> | ||
| /// The deactivation reason tag key. | ||
| /// </summary> | ||
| public const string DeactivationReason = "orleans.deactivation.reason"; | ||
|
|
||
| /// <summary> | ||
| /// The grain ID tag key. | ||
| /// </summary> | ||
| public const string GrainId = "orleans.grain.id"; | ||
|
|
||
| /// <summary> | ||
| /// The grain type tag key. | ||
| /// </summary> | ||
| public const string GrainType = "orleans.grain.type"; | ||
|
|
||
| /// <summary> | ||
| /// The grain type tag key. | ||
| /// </summary> | ||
| public const string GrainState = "orleans.grain.state"; | ||
|
|
||
| /// <summary> | ||
| /// The silo ID tag key. | ||
| /// </summary> | ||
| public const string SiloId = "orleans.silo.id"; | ||
|
|
||
| /// <summary> | ||
| /// The directory previous registration present tag key. | ||
| /// </summary> | ||
| public const string DirectoryPreviousRegistrationPresent = "orleans.directory.previousRegistration.present"; | ||
|
|
||
| /// <summary> | ||
| /// The directory registered address tag key. | ||
| /// </summary> | ||
| public const string DirectoryRegisteredAddress = "orleans.directory.registered.address"; | ||
|
|
||
| /// <summary> | ||
| /// The directory forwarding address tag key. | ||
| /// </summary> | ||
| public const string DirectoryForwardingAddress = "orleans.directory.forwarding.address"; | ||
|
|
||
| /// <summary> | ||
| /// The exception type tag key. | ||
| /// </summary> | ||
| public const string ExceptionType = "exception.type"; | ||
|
|
||
| /// <summary> | ||
| /// The exception message tag key. | ||
| /// </summary> | ||
| public const string ExceptionMessage = "exception.message"; | ||
|
|
||
| /// <summary> | ||
| /// The placement filter type tag key. | ||
| /// </summary> | ||
| public const string PlacementFilterType = "orleans.placement.filter.type"; | ||
|
|
||
| /// <summary> | ||
| /// The storage provider tag key. | ||
| /// </summary> | ||
| public const string StorageProvider = "orleans.storage.provider"; | ||
|
|
||
| /// <summary> | ||
| /// The storage state name tag key. | ||
| /// </summary> | ||
| public const string StorageStateName = "orleans.storage.state.name"; | ||
|
|
||
| /// <summary> | ||
| /// The storage state type tag key. | ||
| /// </summary> | ||
| public const string StorageStateType = "orleans.storage.state.type"; | ||
|
|
||
| /// <summary> | ||
| /// The RPC system tag key. | ||
| /// </summary> | ||
| public const string RpcSystem = "rpc.system"; | ||
|
|
||
| /// <summary> | ||
| /// The RPC service tag key. | ||
| /// </summary> | ||
| public const string RpcService = "rpc.service"; | ||
|
|
||
| /// <summary> | ||
| /// The RPC method tag key. | ||
| /// </summary> | ||
| public const string RpcMethod = "rpc.method"; | ||
|
|
||
| /// <summary> | ||
| /// The RPC Orleans target ID tag key. | ||
| /// </summary> | ||
| public const string RpcOrleansTargetId = "rpc.orleans.target_id"; | ||
|
|
||
| /// <summary> | ||
| /// The RPC Orleans source ID tag key. | ||
| /// </summary> | ||
| public const string RpcOrleansSourceId = "rpc.orleans.source_id"; | ||
|
|
||
| /// <summary> | ||
| /// The exception stacktrace tag key. | ||
| /// </summary> | ||
| public const string ExceptionStacktrace = "exception.stacktrace"; | ||
|
|
||
| /// <summary> | ||
| /// The exception escaped tag key. | ||
| /// </summary> | ||
| public const string ExceptionEscaped = "exception.escaped"; | ||
|
|
||
| /// <summary> | ||
| /// Indicates whether a rehydration attempt was ignored. | ||
| /// </summary> | ||
| public const string RehydrateIgnored = "orleans.rehydrate.ignored"; | ||
|
|
||
| /// <summary> | ||
| /// The reason why a rehydration attempt was ignored. | ||
| /// </summary> | ||
| public const string RehydrateIgnoredReason = "orleans.rehydrate.ignored.reason"; | ||
|
|
||
| /// <summary> | ||
| /// The previous registration address during rehydration. | ||
| /// </summary> | ||
| public const string RehydratePreviousRegistration = "orleans.rehydrate.previousRegistration"; | ||
|
|
||
| /// <summary> | ||
| /// The target silo address for migration. | ||
| /// </summary> | ||
| public const string MigrationTargetSilo = "orleans.migration.target.silo"; | ||
| } | ||
|
|
7 changes: 7 additions & 0 deletions
7
src/Orleans.Core.Abstractions/Diagnostics/OpenTelemetryHeaders.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace Orleans.Diagnostics; | ||
|
|
||
| internal static class OpenTelemetryHeaders | ||
| { | ||
| internal const string TraceParent = "traceparent"; | ||
| internal const string TraceState = "tracestate"; | ||
rkargMsft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| namespace Orleans.Runtime; | ||
|
|
||
| public static class ActivityNames | ||
| { | ||
| public const string PlaceGrain = "place grain"; | ||
| public const string FilterPlacementCandidates = "filter placement candidates"; | ||
| public const string ActivateGrain = "activate grain"; | ||
| public const string DeactivateGrain = "deactivate grain"; | ||
| public const string OnActivate = "execute OnActivateAsync"; | ||
| public const string OnDeactivate = "execute OnDeactivateAsync"; | ||
| public const string RegisterDirectoryEntry = "register directory entry"; | ||
| public const string StorageRead = "read storage"; | ||
| public const string StorageWrite = "write storage"; | ||
| public const string StorageClear = "clear storage"; | ||
| public const string ActivationDehydrate = "dehydrate activation"; | ||
| public const string ActivationRehydrate = "rehydrate activation"; | ||
| public const string WaitMigration = "wait migration"; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.