Configurable json body size for healthchecks hooks (don't truncate)
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
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
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:
hooks: healthchecks: https://hc-ping.com/your-uuid-here
So the best option may be to change the single scalar value to a map. So something like:
hooks: healthchecks: url: https://hc-ping.com/your-uuid-here body_size: 1234
And then put in some code to make loading of the previous schema backwards-compatible. (There's precedent for that.)
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 under
healthchecks: that you can set to a number of bytes or even set to zero to disable truncation. Thanks for suggesting this!
Deleting a branch is permanent. It CANNOT be undone. Continue?