Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: add HTTP response text to the diagnostic messages #416

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented Dec 10, 2024

This patch adds the response text returned by the HTTP server to various diagnostic messages, so issues with the server can be diagnosed more easily.

@version: current

options { keep-hostname(yes); };

log {
	source { tcp(port(2000)); };

	destination {
		http(
			#url("https://httpbin.org/status/502")
			url("https://httpbin.org/html")
			content-compression(gzip)
			workers(1)
			tls(
				ssl_version(tlsv1_2)
				peer-verify(no)
			)
			time-reopen(1)
			body("$DATE $HOST $MSGHDR$MSG")
			batch-bytes(10MiB)
			batch-timeout(1000)
			retries(3)
		); 
	};
};

Copy link
Member

@MrAnno MrAnno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@@ -509,6 +525,7 @@ _custom_map_http_result(HTTPDestinationWorker *self, const gchar *url, HttpRespo
evt_tag_str("action", "disconnect"),
evt_tag_str("url", url),
evt_tag_int("status_code", http_code),
evt_tag_mem("response", self->response_buffer->str, self->response_buffer->len),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few of these messages are on the "notice" level, not on debug.

Nevertheless, they seem useful and hopefully they are triggered rarely under normal circumstances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants