Skip to content
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

Add TaskEventId to function traces #1386

Merged
merged 3 commits into from
Jun 16, 2020
Merged

Add TaskEventId to function traces #1386

merged 3 commits into from
Jun 16, 2020

Conversation

cgillum
Copy link
Member

@cgillum cgillum commented Jun 16, 2020

Resolves #1382.

With this PR, both our ETW traces and the Application Insight traces will have a new TaskEventId column for activity function executions. The TaskEventId integer value can be used to distinguish two different activity function executions that have the same name. For example, in the HelloSequence example, you'd see that each SayHello execution has a different TaskEventId value (0, 1, and 2).

For orchestrator and entity functions, this value will always be -1 since there isn't a way to associate a single event to a single orchestration function execution (there could be multiple events corresponding to a single execution).

We already have this data in the DurableTask-AzureStorage traces. This PR adds the same data to the WebJobs-Extensions-DurableTask traces (and to AppInsights).

@cgillum cgillum added this to the v2.3.0 milestone Jun 16, 2020
@cgillum cgillum self-assigned this Jun 16, 2020
@davidmrdavid
Copy link
Contributor

It mostly looks good to me, but I think there's an opportunity here to document some of the functionality that this PR interacts with. Please see my nitpicky comments above, and let me know if we can include those clarifications 😄

@cgillum
Copy link
Member Author

cgillum commented Jun 16, 2020

Thanks @davidmrdavid for the feedback! I've added more comments in my PR which will hopefully make things a bit less mysterious. This is a good reminder for me to get back into that habit. Let me know if the updated comments are helpful.

I didn't go into too much detail on the mechanics of the middleware, though, because that would be pretty involved. However, it is modeled after the ASP.NET Core middleware design so I'm hoping that folks that are already familiar with ASP.NET Core will recognize the pattern I'm using with the context parameter and the next callback.

Copy link
Contributor

@davidmrdavid davidmrdavid left a comment

Choose a reason for hiding this comment

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

Suddenly, I understand the code much better! Thanks for the clarifications and this PR, LGTM.

Copy link
Contributor

@ConnorMcMahon ConnorMcMahon left a comment

Choose a reason for hiding this comment

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

LGTM!

@cgillum cgillum merged commit c01a226 into dev Jun 16, 2020
@cgillum cgillum deleted the task-event-ids2 branch June 16, 2020 23:01
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.

Include Task Event ID in ETW and App Insights traces
3 participants