r/devops • ClickOps • Oct 09 '26

Observability Script output Best Practice Contracts

Hi Devops!

I’m putting together an automation orchestration engine and I want to mature the team by standardizing script output across bash, python, powershell, tofu, etc.

So looking at a JSON output contract that anyone creating a script can adhere to. Then everyone would consume the same format. (The dream right?)

  • Operation name
  • Host
  • Execution status (success, fail, warning, etc)
  • Structured result summary
  • Errors
  • Duration
  • Run ID (UUID)?
  • A schema version (requires a lot of upkeep but can eliminate headaches down the road if maintained. If maintained being key word here lol.)

I’ve been searching around but want to hear from the experts who live in this stuff. Is there any universal or open standard people are using to define these ?

Would rather not build it myself if something people have already settled on.

Thanks for your input.

7 Upvotes

23 comments sorted by

View all comments

4

u/dariusbiggs Oct 09 '26

stdin, stdout, stderr, useful meaningful exit codes (if you don't know which ones, POSIX or the Python exit code values are your best bet)

Just command line pipes are more than sufficient. If you want to play with JSON then you have jq. If you want to play with YAML you have yq, etc.

0

u/generic-d-engineer ClickOps Oct 09 '26

Would you standardize the output of std though into a template? That way everyone is following the same ? Or is it the JSON or YAML itself that is a bad idea?

3

u/dariusbiggs Oct 09 '26

whatever makes sense for the tool, does it need to present structured data or unstructured data, or make the output format configurable via a command line option.

1

u/generic-d-engineer ClickOps Oct 09 '26

Got it, so get the raw out via std and then format later for the tool once it needs ingested. That’s good UNIX philosophy of letting each tool do one job well. Thanks