harvest
harvest copied to clipboard
Status Formatting: Allow JSON/ possibly other formatting options for status/start/stop.
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'
},
}
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?