Skip to content

Commit bf8376c

Browse files
authored
enhancement(observability): Log underlying error for unhandled HTTP errors (#17327)
To help with debugging Signed-off-by: Jesse Szwedko <[email protected]>
1 parent 80c8247 commit bf8376c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/internal_events/http.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ impl<'a> InternalEvent for HttpDecompressError<'a> {
130130
}
131131
}
132132

133-
pub struct HttpInternalError {
134-
pub message: &'static str,
133+
pub struct HttpInternalError<'a> {
134+
pub message: &'a str,
135135
}
136136

137-
impl InternalEvent for HttpInternalError {
137+
impl<'a> InternalEvent for HttpInternalError<'a> {
138138
fn emit(self) {
139139
error!(
140140
message = %self.message,

src/sources/util/http/prelude.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub trait HttpSource: Clone + Send + Sync + 'static {
165165
} else {
166166
//other internal error - will return 500 internal server error
167167
emit!(HttpInternalError {
168-
message: "Internal error."
168+
message: &format!("Internal error: {:?}", r)
169169
});
170170
Err(r)
171171
}

0 commit comments

Comments
 (0)