Configurable json body size for healthchecks hooks (don't truncate) #294
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#294
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
When using HTTP POST to the Healthchecks endpoint, you can include arbitrary payload in the request body. If the request body looks like a UTF-8 string, Healthchecks.io will log the first 10 kilobytes of the request body, so you can inspect it later.
This limit is now configurable/removable as part of
58a118c494
.Due to this I would like if we can configure the current truncation so that the full contents of a log can be POSTed to Healthchecks instead of the default 10kb.
Other notes / implementation ideas
This is a continuation of #241 and #249, to allow the full body of the borgmatic output to get to Healthchecks.
Makes sense! I could see having a configuration option for setting the truncation size (or disabling truncation altogether).
I think the biggest challenge here is not implementing the configurable truncation, but rather figuring out how to fit the option into the current borgmatic config file schema.. The current schema looks like:
So the best option may be to change the single scalar value to a map. So something like:
And then put in some code to make loading of the previous schema backwards-compatible. (There's precedent for that.)
Yep that looks great to me!
Well, it took a while to get to it (my apologies!), but this is now implemented in master. There's a new
ping_body_limit
option underhealthchecks:
that you can set to a number of bytes or even set to zero to disable truncation. Thanks for suggesting this!Released in borgmatic 1.6.1!