Add backend name to telemetry (#2962)

* feat: Add backend name to telemetry
This commit is contained in:
Hugo Larcher 2025-01-28 16:53:16 +01:00 committed by GitHub
parent eb3df0f46f
commit 73b7cf83f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 18 additions and 0 deletions

View File

@ -340,4 +340,8 @@ impl Backend for TensorRtLlmBackendV2 {
async fn health(&self, _: bool) -> bool {
true
}
fn name(&self) -> &'static str {
"TensorRT-LLM"
}
}

View File

@ -108,6 +108,10 @@ impl Backend for BackendV2 {
fn start_health(&self) -> bool {
true
}
fn name(&self) -> &'static str {
"tgi-v2"
}
}
/// Batching logic

View File

@ -115,6 +115,10 @@ impl Backend for BackendV3 {
fn start_health(&self) -> bool {
true
}
fn name(&self) -> &'static str {
"tgi-v3"
}
}
/// Batching logic

View File

@ -40,6 +40,8 @@ pub trait Backend {
fn start_health(&self) -> bool {
false
}
fn name(&self) -> &'static str;
}
/// Inference struct

View File

@ -1898,6 +1898,7 @@ pub async fn run(
disable_grammar_support,
max_client_batch_size,
usage_stats_level,
backend.name(),
);
Some(usage_stats::UserAgent::new(reduced_args))
}

View File

@ -97,6 +97,7 @@ pub struct Args {
disable_grammar_support: bool,
max_client_batch_size: usize,
usage_stats_level: UsageStatsLevel,
backend_name: &'static str,
}
impl Args {
@ -120,6 +121,7 @@ impl Args {
disable_grammar_support: bool,
max_client_batch_size: usize,
usage_stats_level: UsageStatsLevel,
backend_name: &'static str,
) -> Self {
Self {
model_config,
@ -140,6 +142,7 @@ impl Args {
disable_grammar_support,
max_client_batch_size,
usage_stats_level,
backend_name,
}
}
}