nomad
nomad copied to clipboard
`operator debug` should serialize lists as newline-delimited JSON
In addition to lacking pagination (see https://github.com/hashicorp/nomad/issues/15479), the operator debug command takes the results of list queries and serializes them to a JSON array-of-objects. This format is not suitable for post-incident debugging. The entire file is a single line, which means line-oriented shell tools have to first parse the array into a stream of lines. This also means file can't be streamed into a JSON parser without ballooning the memory needed to do so (or otherwise pre-processing). For large clusters these files can be in the multi-GB range.
All list queries the operator debug command takes should be paginated and then streamed into new-line delimited JSON objects in their respective files.