on crash use anonymous error event

This commit is contained in:
Erik Kaunismäki 2024-07-16 13:52:00 +02:00 committed by erikkaum
parent a5f50c5b39
commit 796c5cbf38
2 changed files with 7 additions and 2 deletions

View File

@ -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. 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 ## 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 ## 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.

View File

@ -474,6 +474,11 @@ async fn main() -> Result<(), RouterError> {
usage_stats::EventType::Error(e.to_string()), usage_stats::EventType::Error(e.to_string()),
); );
error_event.send().await; 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)) Err(RouterError::WebServer(e))