hashicorp / hashicorp/nomad

`operator debug` should serialize lists as newline-delimited JSON

Open
#15,565 0 comments 0 reactions 0 assignees View on GitHub
theme/cli type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Go implementation of the `operator debug` command and its list-query handling. Review how results are written to their respective files, then verify that all list queries are paginated and streamed as newline-delimited JSON objects without building a complete array in memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.