-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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 tsserver version property to every event #37066
add tsserver version property to every event #37066
Conversation
This test was failing locally (Ubuntu 17.04) on some ipc tests, but the same tests are failing in |
@@ -23,8 +24,16 @@ export default class TelemetryReporter { | |||
} | |||
} | |||
|
|||
constructor(private client: TypeScriptServiceClient) { |
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.
This creates a circular dependency between the reporter and the service client. Can we either pass the version info in logTelemetry
or make TelemetryReporter
take an interface instead of the entire client
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.
Exposed the client version through a new IClientVersion
interface placed in typescriptServiceClient.ts
. So a circular dependency remains. This is preferable to passing the version explicitly because other services may need to report telemetry in the future, and it would be inconvenient to force them to have a handle on the tsserver version.
if (telemetryData.telemetryEventName === 'projectInfo') { | ||
this._tsserverVersion = properties['version']; | ||
} | ||
|
||
/* __GDPR__ | ||
"typingsInstalled" : { |
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.
The version field will need to be added to the gdpr annotations as well.
@kieferrm Would __GDPR__COMMON__
work for this?
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.
GDPR__COMMON means that this is a property that is on every single telemetry event we send. The TS server version is only on TS related events, so it is not a common property.
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.
Maybe this can be done with GDPR__FRAGMENT and a wildcard to match on the name? Or would we need to extend the comment-handling functionality?
Thanks. Getting this in for our October release |
Adds a property to all typescript telemetry events indicating the version of tsserver in the currently running instance of tsserver.
There are two sources of the version of tsserver:
--enableTelemetry
, which only occurs if we decided the APIVersion was >=2.0.8. If we could recover the version from the package.json, then tsserver's reported version should match the API Version unless tsserver was overwritten.Since the tsserver version is already reported (for recent tsserver versions), we could in principle join the session of an event we are interested in, say when a crash or exception occurs in tsserver, to the corresponding
projectInfo
event and recover the version of tsserver running. However, this has a couple issues:projectInfo
event fires, we get no version info.Open questions
version
from projectinfo?version
is a term that could potentially be overloaded. On the other hand,version
is already used by theprojectInfo
event, and we should (and in this implmentation, do) add the same property to every event, includingprojectInfo
. In the PR, theversion
property we append to every event will coincide exactly with theversion
fromprojectInfo
.TODO