harvest icon indicating copy to clipboard operation
harvest copied to clipboard

Status Formatting: Allow JSON/ possibly other formatting options for status/start/stop.

Open AnshumanRohella opened this issue 4 years ago • 1 comments

Right now the format for the status is not really parsable if the service is being used by custom scripts. Having something like ./bin/harvest --format json would help to gain a better control over the lifecycle of harvest as a service.

    Datacenter   |          Poller          | PID | PromPort |   Status     
-----------------+--------------------------+-----+----------+--------------
  ap-northeast-1 | test_poller_1 |     |          | not running  
  ap-northeast-1 | test_poller_2|   23555  |   12830       | running 

After --format json

{
  {
    'datacenter': 'ap-northeast-1',
    'poller': 'test_poller_1',
    'pid': '',
    'prom_port': ''
    'status': 'not_running'
  },
  {
    'datacenter': 'ap-northeast-1',
    'poller': 'test_poller_2',
    'pid': 23555,
    'prom_port': 12830
    'status': 'not_running'
  },
}

AnshumanRohella avatar Nov 17 '21 06:11 AnshumanRohella

thanks for the feature request @AnshumanRohella this is something we've discussed in the past and will be a good addition. Any interest in trying to add it yourself and contribute it back?

cgrinds avatar Nov 17 '21 12:11 cgrinds