Skip to content

Commit 043c1df

Browse files
authored
Add telemetry for custom model when found for easier filtering (#274)
1 parent 3144096 commit 043c1df

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/extension/prompt/vscode-node/endpointProviderImpl.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class ProductionEndpointProvider implements IEndpointProvider {
3939
@ICAPIClientService capiClientService: ICAPIClientService,
4040
@IFetcherService fetcher: IFetcherService,
4141
@IExperimentationService private readonly _expService: IExperimentationService,
42-
@ITelemetryService telemetryService: ITelemetryService,
42+
@ITelemetryService private readonly _telemetryService: ITelemetryService,
4343
@ILogService private readonly _logService: ILogService,
4444
@IConfigurationService private readonly _configService: IConfigurationService,
4545
@IInstantiationService private readonly _instantiationService: IInstantiationService,
@@ -57,7 +57,7 @@ export class ProductionEndpointProvider implements IEndpointProvider {
5757
this._expService,
5858
_envService,
5959
_authService,
60-
telemetryService,
60+
this._telemetryService,
6161
_logService,
6262
_instantiationService,
6363
);
@@ -191,6 +191,21 @@ export class ProductionEndpointProvider implements IEndpointProvider {
191191
const experimentModelConfig = getCustomDefaultModelExperimentConfig(this._expService);
192192

193193
for (let model of models) {
194+
195+
if (model.id === experimentModelConfig?.id) {
196+
/* __GDPR__
197+
"custommodel.found" : {
198+
"owner": "karthiknadig",
199+
"comment": "Reports that an experimental model was in the list of models.",
200+
"model": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Model in found list." }
201+
}
202+
*/
203+
this._telemetryService.sendTelemetryEvent('custommodel.found', { microsoft: true, github: false }, {
204+
model: model.id,
205+
});
206+
// The above telemetry is needed for easier filtering.
207+
}
208+
194209
model = applyExperimentModifications(model, experimentModelConfig) ?? model;
195210
const chatEndpoint = this.getOrCreateChatEndpointInstance(model);
196211
chatEndpoints.push(chatEndpoint);

0 commit comments

Comments
 (0)