diff --git a/crates/lib/pager/src/client/pager_client.rs b/crates/lib/pager/src/client/pager_client.rs index 87a2cc6ffb..052af7337b 100644 --- a/crates/lib/pager/src/client/pager_client.rs +++ b/crates/lib/pager/src/client/pager_client.rs @@ -112,12 +112,36 @@ impl PagerClient { labels.push(("hostname".to_string(), h.clone())); } + if let Some(method) = ¬ification.http_method { + labels.push(("http_method".to_string(), method.clone())); + } + + if let Some(path) = ¬ification.endpoint_path { + labels.push(("http_path".to_string(), path.clone())); + } + let labels = if labels.is_empty() { None } else { Some(labels) }; - // Enrich the description with hostname if both are present. - let description = match (¬ification.description, &self.hostname) { - (Some(desc), Some(h)) => Some(format!("{}\n\nHostname: {}", desc, h)), - (desc, _) => desc.clone(), + // Enrich the description with HTTP context and hostname if present. + let description = match ¬ification.description { + Some(desc) => { + let mut parts = vec![desc.clone()]; + + if let Some(method) = ¬ification.http_method { + parts.push(format!("HTTP Method: {}", method)); + } + + if let Some(path) = ¬ification.endpoint_path { + parts.push(format!("HTTP Path: {}", path)); + } + + if let Some(h) = &self.hostname { + parts.push(format!("Hostname: {}", h)); + } + + Some(parts.join("\n\n")) + } + None => None, }; let result = create_alert(CreateAlertArgs {