adyatlov / bun-deprecated

DC/OS diagnostics bundle analysis tool
The Unlicense
12 stars 4 forks source link

Improve support for extracting structured JSON from the bundle files. #10

Closed rukletsov closed 6 years ago

rukletsov commented 6 years ago

Currently, each check is supposed to provide a JSON schema for the diagnostic files it uses. While this approach is extremely flexible and allows different checks to use different schemas for the same file, it requires writing extra code.

To reduce the amount of code required to write a check and hence facilitate adoption, I suggest to maintain one schema for each diagnostic file. This way, written once for a check, the schema can be used by all future checks using the same diagnostic file.

Since for some files crafting a schema is infeasible (think state.json), additionally provide a mechanism—simply expose standard golang json reader?—to dynamically build a JSON representation without a schema and allow to walk it in a check.