-
Notifications
You must be signed in to change notification settings - Fork 228
Adds telemetry for LSP calls implementing AbstractRazorDelegatingEndpoint
#8868
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
Conversation
| TResponse? delegatedRequest; | ||
| try | ||
| { | ||
| using var _ = _telemetryReporter?.TrackLspRequest(nameof(HandleRequestAsync), LspName, positionInfo.LanguageKind == RazorLanguageKind.CSharp ? "Razor C# Language Server Client" : "HtmlDelegationLanguageServerClient", correlationId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO, move strings "Razor C# Language Server Client" and "HtmlDelegationLanguageServerClient" elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They already are:
razor/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/RazorLSPConstants.cs
Line 14 in c3de764
| public const string HtmlLanguageServerName = "HtmlDelegationLanguageServerClient"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RazorLSPConstants seemed inaccessible here. So I figured I had to create a new class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, because it's LanguageServerClient. I wonder if we should move that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this call is just in the wrong place. The thing that receives this request is not the delegated servers, but our code in the LSP client. This call should love to DefauktRazorLanguageServerCustomMessageTarget, where the calls to the delegated servers happen, and then those constants will be available (and probably unnecessary anyway)
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs
Outdated
Show resolved
Hide resolved
| TResponse? delegatedRequest; | ||
| try | ||
| { | ||
| using var _ = _telemetryReporter?.TrackLspRequest(nameof(HandleRequestAsync), LspName, positionInfo.LanguageKind == RazorLanguageKind.CSharp ? "Razor C# Language Server Client" : "HtmlDelegationLanguageServerClient", correlationId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They already are:
razor/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/RazorLSPConstants.cs
Line 14 in c3de764
| public const string HtmlLanguageServerName = "HtmlDelegationLanguageServerClient"; |
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SignatureHelp/SignatureHelpEndpoint.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| var correlationId = Guid.NewGuid(); | ||
| using var __ = _telemetryReporter?.TrackLspRequest(LspTarget, LanguageServerConstants.RazorLanguageServerName, correlationId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we wanted this to be opt-in, or we'll be reporting too much telemetry?
Also, should the call be moved to under the guard clauses? Seems like we'd be reporting telemetry for requests we didn't do anything with, which would skew our data.
Adds telemetry for LSP calls implementing
AbstractRazorDelegatingEndpoint