Skip to content

Commit

Permalink
enhancement(observability): Log underlying error for unhandled HTTP e…
Browse files Browse the repository at this point in the history
…rrors (#17327)

To help with debugging

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
  • Loading branch information
jszwedko authored May 8, 2023
1 parent 80c8247 commit bf8376c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/internal_events/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ impl<'a> InternalEvent for HttpDecompressError<'a> {
}
}

pub struct HttpInternalError {
pub message: &'static str,
pub struct HttpInternalError<'a> {
pub message: &'a str,
}

impl InternalEvent for HttpInternalError {
impl<'a> InternalEvent for HttpInternalError<'a> {
fn emit(self) {
error!(
message = %self.message,
Expand Down
2 changes: 1 addition & 1 deletion src/sources/util/http/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ pub trait HttpSource: Clone + Send + Sync + 'static {
} else {
//other internal error - will return 500 internal server error
emit!(HttpInternalError {
message: "Internal error."
message: &format!("Internal error: {:?}", r)
});
Err(r)
}
Expand Down

0 comments on commit bf8376c

Please sign in to comment.