From 796c5cbf38e500e3ee5ca9f34321ae4e978ffbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Kaunism=C3=A4ki?= Date: Tue, 16 Jul 2024 13:52:00 +0200 Subject: [PATCH] on crash use anonymous error event --- docs/source/usage_statistics.md | 4 ++-- router/src/main.rs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/source/usage_statistics.md b/docs/source/usage_statistics.md index 427f0505..9761e03e 100644 --- a/docs/source/usage_statistics.md +++ b/docs/source/usage_statistics.md @@ -3,7 +3,7 @@ Text Generation Inference collects anonymous usage statistics to help us improve the service. The collected data is used to improve TGI and to understand what causes failures. The data is collected transparently and any sensitive information is omitted. -Data is sent twice 1) on server startup and 2) and when server stops. Also, usage statistics are only enabled when TGI is running in docker to avoid collecting data then TGI runs directly on the host machine. +Data is sent twice, once on server startup and once when server stops. Also, usage statistics are only enabled when TGI is running in docker to avoid collecting data then TGI runs directly on the host machine. ## What data is collected @@ -52,4 +52,4 @@ As of release 2.1.2 this is an example of the data collected: ## How to opt-out -You can easily opt out by passing the `--disable-usage-stats` to the text-generation-launcher command. This will disable all usage statistics. You can also pass `--disable-crash-reports` which disables sending of crash reports, but allows anonymous usage statistics. +You can easily opt out by passing the `--disable-usage-stats` to the text-generation-launcher command. This will disable all usage statistics. You can also pass `--disable-crash-reports` which disables sending specific crash reports, but allows anonymous usage statistics. diff --git a/router/src/main.rs b/router/src/main.rs index 1282b45e..406bfe4f 100644 --- a/router/src/main.rs +++ b/router/src/main.rs @@ -474,6 +474,11 @@ async fn main() -> Result<(), RouterError> { usage_stats::EventType::Error(e.to_string()), ); error_event.send().await; + } else { + let unknow_error_event = usage_stats::UsageStatsEvent::new( + ua.clone(), + usage_stats::EventType::Error("unknow_error".to_string())); + unknow_error_event.send().await; } }; Err(RouterError::WebServer(e))