diff --git a/crates/lib/pager/src/client/pager_client.rs b/crates/lib/pager/src/client/pager_client.rs index a351a4aa03..99bfa622de 100644 --- a/crates/lib/pager/src/client/pager_client.rs +++ b/crates/lib/pager/src/client/pager_client.rs @@ -108,6 +108,14 @@ impl PagerClient { let mut labels: Vec<(String, String)> = Vec::new(); + if let Some(name) = &self.application_name { + labels.push(("application_name".to_string(), name.clone())); + } + + if let Some(id) = &self.service_id { + labels.push(("service_id".to_string(), id.clone())); + } + if let Some(env) = &self.environment { labels.push(("environment".to_string(), env.clone())); } @@ -130,11 +138,24 @@ impl PagerClient { let labels = if labels.is_empty() { None } else { Some(labels) }; - // Enrich the description with HTTP context and hostname if present. + // Enrich the description with context and hostname if present. let description = match ¬ification.description { Some(desc) => { let mut parts = vec![desc.clone()]; + match (&self.application_name, &self.service_id) { + (Some(name), Some(id)) => { + parts.push(format!("Application: {} (service_id: {})", name, id)); + } + (Some(name), None) => { + parts.push(format!("Application: {}", name)); + } + (None, Some(id)) => { + parts.push(format!("Service ID: {}", id)); + } + (None, None) => {} + } + if let Some(method) = ¬ification.http_method { parts.push(format!("HTTP Method: {}", method)); }