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

Use distinct EventSource names for compiler and workspace layer events #75613

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

RikkiGibson
Copy link
Contributor

@RikkiGibson RikkiGibson commented Oct 23, 2024

Related VS regression bug: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2289777

We think this issue may be causing CodeAnalysis events to fail to appear in IDE traces.

VS PR to enable new event source in RPS/Speedometer: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/587560

Alternatively, we could expose the CodeAnalysisEventSource as a public experimental API.

@RikkiGibson RikkiGibson requested review from a team as code owners October 23, 2024 23:09
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 23, 2024
[EventSource(Name = "Microsoft-CodeAnalysis-General")]
internal sealed partial class CodeAnalysisEventSource
{
public static readonly CodeAnalysisEventSource Log = new CodeAnalysisEventSource();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal of putting this member here is to make it so you can't log events at all if you forget to declare a partial which specifies the event source name.


namespace Microsoft.CodeAnalysis
{
[EventSource(Name = "Microsoft-CodeAnalysis-Workspaces")]
Copy link
Member

Choose a reason for hiding this comment

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

Are we going to need to ask the RPS folks to turn this collector on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am expecting the following PR to enable this collector: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/587560

@jaredpar
Copy link
Member

Pretty sure that we have documentation on how to collect traces for the compiler / IDE. Should we add both of the event source names into that document to make it easier for customers to give us traces?

@RikkiGibson
Copy link
Contributor Author

Pretty sure that we have documentation on how to collect traces for the compiler / IDE. Should we add both of the event source names into that document to make it easier for customers to give us traces?

Besides in the original attribute, I only found the provider name mentioned in Tools/Replay/README.md: https://github.com/search?q=repo%3Adotnet%2Froslyn%20microsoft-codeanalysis-general&type=code

Since Replay is only handling a compilation scenario, it feels reasonable to leave that doc as is.

@RikkiGibson RikkiGibson merged commit a1346ef into dotnet:main Oct 24, 2024
28 checks passed
@RikkiGibson RikkiGibson deleted the event-source-fix branch October 24, 2024 16:05
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Oct 24, 2024
@akhera99 akhera99 modified the milestones: Next, 17.13 P1 Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants