Skip to content

Distributed Tracing for Entities (Isolated) #404

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
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

sophiatev
Copy link

@sophiatev sophiatev commented Mar 28, 2025

This PR adds support for distributed tracing for entities in the .NET isolated framework. The actual tracing objects are created in the durabletask repo (see this PR) but this repo is where the requests to entities are generated and executed in the isolated case. The changes in this PR are then mostly to propagate information correctly to the durabletask repo for the traces (for example, the time that a signal or call request to an entity was made, or the time that the request was accomplished, any associated error messages, etc.) Related to this propagation of information, the definition of proto objects related to signaling entities or entities starting orchestrations had to be populated with extra information (like the parent trace context of the request, or the time of the request, etc. For more details see this PR in the protobuf repo). The changes in the ProtobufUtils class focus on adding this extra information (similar changes occur in this PR in the WebJobs repo).

  • The changes in the GrpcDurableEntityClient and ShimDurableEntityClient classes are to propagate this additional information in the case of a client signaling an entity,
  • In TaskEntityShim they are for entities signaling other entities, entities starting orchestrations, and the actual execution of the entity requests, and
  • In TaskOrchestrationEntityContext for orchestrations signaling and calling entities

The various other PRs related to this effort are

Copy link
Member

@jviau jviau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know where Activity.Current will be set per entity operation?

@sophiatev
Copy link
Author

Do you know where Activity.Current will be set per entity operation?

This is actually done in DurableTask.Core in this PR where the Activities are created (with the exception of a client signaling an entity, for which the Activity is created in GrpcDurableEntityClientSignalEntityAsync.. This was actually something I was wondering myself - Activity.Current seems to be set here already correctly and I use it to set the parent trace context of the signal request, but I'm not actually sure where it actually gets set...

@sophiatev sophiatev changed the title Distributing Tracing for Entities (Isolated) Distributed Tracing for Entities (Isolated) May 13, 2025
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.

3 participants