-
Notifications
You must be signed in to change notification settings - Fork 4k
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 back request telemetry in CLaSP queue #71157
Conversation
Move some work from AbstractRequestScope to RequestTelemetryScope to allow for usage of SharedStopwatch Remove RequestMetrics class
…l, switch all usages to AbstractLspLogger.
var telemetryService = lspServices.GetRequiredServices<AbstractTelemetryService>().FirstOrDefault(); | ||
|
||
_requestTelemetryScope = telemetryService?.CreateRequestScope(methodName); |
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.
GetRequiredServices
says to me that the service is expected to always exist, but the FirstOrDefault
and null check operator says to me that it isn't. Which one is it?
(and i'm hoping that the GetRequiredServices
bit is wrong, or this will presuambly stop Razor and Web Tools from working once this is inserted)
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.
GetRequiredServices is poorly named (the whole ILspServices implementation is a bit wonky). It doesn't throw if there aren't any items, but rather returns an empty enumeration.
I went ahead and used this as it gave me what I need and I didn't want to change the interface, and really didn't want to change the implementation.
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.
Thanks, happy to hear its not actually required 😁
src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/ILspLogger.cs
Show resolved
Hide resolved
Change RequestTelemetryLogger to use TelemetryLogging apis
Should remember to add language as another property once Marco's PR is in. |
Modify CLaSP's QueueItem to explicitly send details about timing and success. This better mimics the previous RequestMetrics usage that was removed when Ryan moved clasp over.
Also, added AbstractLspLogger to help in the (eventual) transition away from the ILspLogger interface.