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
Truncate beginning of long request bodies instead of the end #939
Comments
Hi @StevenMassaro, thanks for the suggestion. We truncate the request bodies for two main reasons:
For (1) it would not matter if we keep the head or the tail part of the request body. I suggest doing one of the following:
|
Hi @cuu508 I think I must be missing something with regards to your #2. As the code currently reads to me, it looks like the body is loaded into memory on line 67, then truncated later. Thus, it shouldn't matter whether we retain the head or tail of the body, since it is already loaded into memory. Let me also clarify my goal here. I am already doing truncation on the client side, as described in the documentation. My problem is that the request body is further truncated when a message is sent via telegram (see code here), and it is omitting the error message, because it is retaining the head, not the tail of the message: |
Ah, sorry, I did not read carefully and misunderstood – I was thinking about truncation when ingesting a ping request, but you were talking about truncation when preparing a notification. I'll look into this again. |
@cuu508 Wondering if you've had a chance to ponder this request |
Hey @StevenMassaro I have since created a PR including settings for this behavior |
I've started making use of the feature to send log data to healthchecks. I like that I get a truncated copy of the logs in my notification provider.
Under most circumstances I can imagine, an error in the script would show up at the end, and typically this error is truncated away.
I'm proposing a change to the truncating logic here, something like this:
but I wanted to get feedback first before spending time on this change.
This would ensure that the end of the log message is included in the notification, and the beginning of the log message is omitted.
The text was updated successfully, but these errors were encountered: