-
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
26
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.
+1,671
−141
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b177c90
WIP
rkargMsft fb15cac
Pulling more spans in to activation tracing
rkargMsft 13b3889
Spans for persistence state
rkargMsft 0b96048
dehydrate/rehydrate spans
rkargMsft d0d6be5
Separating class
rkargMsft c42b82c
removing nullable
rkargMsft 47a4af5
reverting nullable operation
rkargMsft 72d10d7
removing unnecessary change
rkargMsft da792f3
Using activity source to ensure we see the root span in the test debu…
rkargMsft aad6601
aligning span naming with OTel conventions
rkargMsft 2c8640a
renaming remaining spans
rkargMsft ba90e7c
only add dehydrate/rehydrate for grain migration participants
rkargMsft bfc5ae5
Refactor tracing: add granular ActivitySources and IAsyncEnumerable t…
rkargMsft 1bf1541
Implementing valid Copilot feedback
rkargMsft c394df4
Updating ActivitySource versions to denote changes around IAsyncEnume…
rkargMsft e98f6b6
consolidate setting Activity error properties
rkargMsft 1136d18
setting error description string
rkargMsft 23177e1
correcting method call
rkargMsft d079809
explicit using on activity
rkargMsft 779198f
fixing locking on `this`
rkargMsft 31dbf7b
explicit discard
rkargMsft 058734e
more explicit discards
rkargMsft ba3b414
set Activity error on rehydrate error
rkargMsft d9a4ae1
restoring current activity after placement
rkargMsft 781153f
Commenting on current need to lock on `this`
rkargMsft 2fd5682
Using constants for tags and error descriptions
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"); | ||
| } | ||
138 changes: 138 additions & 0 deletions
138
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,138 @@ | ||
| 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 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 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,15 @@ | ||
| 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 OnActivate = "execute OnActivateAsync"; | ||
| 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"; | ||
| } |
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.