telemetry: Add language_name and model_provider (#18640)

This PR adds a bit more metadata for assistant logging.

Release Notes:

- Assistant: Added `language_name` and `model_provider` fields to
telemetry events.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Boris Cherny 2024-10-04 11:37:27 -07:00 committed by GitHub
parent dfe1e43832
commit 01ad22683d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 83 additions and 29 deletions

View file

@ -2133,13 +2133,20 @@ impl Context {
});
if let Some(telemetry) = this.telemetry.as_ref() {
let language_name = this
.buffer
.read(cx)
.language()
.map(|language| language.name());
telemetry.report_assistant_event(AssistantEvent {
conversation_id: Some(this.id.0.clone()),
kind: AssistantKind::Panel,
phase: AssistantPhase::Response,
model: model.telemetry_id(),
model_provider: model.provider_id().to_string(),
response_latency,
error_message,
language_name,
});
}