Skip to content

Activity source split for User/Runtime grain calls#8043

Merged
ReubenBond merged 3 commits intodotnet:mainfrom
rwkarg:activity_source
Oct 24, 2022
Merged

Activity source split for User/Runtime grain calls#8043
ReubenBond merged 3 commits intodotnet:mainfrom
rwkarg:activity_source

Conversation

@rwkarg
Copy link
Copy Markdown
Contributor

@rwkarg rwkarg commented Oct 20, 2022

This allows for selectively choosing activity for runtime grains (like IMembershipTable, IRemoteGrainDirectory, or IDeploymentLoadPublisher) or only user created grains (what the user has created for their system/application).

It is assumed that consumers will primarily want the user grain Activity and not also the runtime/internal grain calls.

Mechanically, this is achieved by looking to see if the namespace of the grain starts with "Orleans". There is the possibility that a user can create their own grain in a namespace starting with "Orleans" (ex. Orleans.MyCompany.MyApp) but this is not an idiomatic pattern for namespace naming so it may be sufficient to document this behavior.

This does introduce a breaking change for current consumers of ActivitySources.
For example, users using OpenTelemetry (and similarly for directly listening with an ActivityListener) currently add the "Microsoft.Orleans" source and get all runtime and user grain Activity.

This PR would require those users to do one of the following in their code:

  • Make no changes and stop getting any Orleans related Activity
  • Add the source as "Microsoft.Orleans.*" instead (note the asterisk/wildcard added) to get the existing set of both user and runtime grain Activity
  • Add the source as "Microsoft.Orleans.User" to get only the user grain Activity
  • Add the source as "Microsoft.Orleans.Runtime" to get only the runtime grain Activity
Microsoft Reviewers: Open in CodeFlow

@dnfadmin
Copy link
Copy Markdown

dnfadmin commented Oct 20, 2022

CLA assistant check
All CLA requirements met.

@rwkarg rwkarg changed the title Activity source Activity source split for User/Runtime grain calls Oct 20, 2022
@ReubenBond
Copy link
Copy Markdown
Member

LGTM. This will incur some reflection overhead to get the target's namespace, but perhaps that is acceptable. An alternative might be for us to guarantee a prefix for all internal grains, such as "sys." or "ms."

@ReubenBond ReubenBond merged commit ea7e324 into dotnet:main Oct 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants