Missing HTTP route /test
Following the complete rewrite of connector-prometheus2canopsis from Python to Golang, the API test route /test
has disappeared.
At git tag
0.3
:$ git grep -E '/(webhook|test)' README.md:route `/webhook`: README.md: - url: 'http://127.0.0.1:8080/webhook' prometheus2canopsis.py: self.route('/webhook', method='POST', callback=self.webhook) prometheus2canopsis.py: self.route('/test', callback=self.test) prometheus2canopsis.py: LOGGER.debug('Message received on /webhook: %s', payload) prometheus2canopsis.py: LOGGER.info('Test request received on /test')
Now:
$ git grep -E '/(webhook|test)' README.md:route `/webhook`: README.md: - url: 'http://127.0.0.1:8080/webhook' cmd/main.go: mux.Handle("/webhook", prometheus.NewHandler(config, eventCh, logger))
(and I did not find any other
.Handle(...)
call with another route except for/webhook
)
It could have been useful for liveness/readiness checks of connector availability.
Is it possible to implement it back?
A simple GET /test
request should return 200 OK if connector is ready (no error, config loaded correctly, RabbitMQ available at env-provided URL). If unhealthy, it should return any non-2xx HTTP status code, such as a 5xx.
That way, container orchestration tools would be able to report availability or "unhealthiness" accordingly.