Catching events when a service ist stopped

Hi there,

I'm runnig several services in my cluster and i'd like to implement some
kind of self monitoring. A dashboard should show what services are running,
how many instances are out there and what are the hostnames.

So i need to emit an event when the service is stopped just to check out
the service from the list.

How would you guys do that?

Thanks

Andreas

The easiest way would be to add your own runner script, rather than using
the `nameko run` CLI. Then you're free to do whatever you like before the
services start, and after they stop.

Take a look
at https://github.com/nameko/nameko/blob/master/nameko/cli/run.py#L158-L181
for an example.

If I had this requirement I'd use something like consul to discover the
available services though, rather than having to write a new runner.

···

On Thursday, March 16, 2017 at 1:27:20 PM UTC, Andreas Fehl wrote:

Hi there,

I'm runnig several services in my cluster and i'd like to implement some
kind of self monitoring. A dashboard should show what services are running,
how many instances are out there and what are the hostnames.

So i need to emit an event when the service is stopped just to check out
the service from the list.

How would you guys do that?

Thanks

Andreas

Thank You for your quick reply.

I'll give both suggestions a try.

···

Am Donnerstag, 16. März 2017 18:32:37 UTC+1 schrieb Matt Yule-Bennett:

The easiest way would be to add your own runner script, rather than using
the `nameko run` CLI. Then you're free to do whatever you like before the
services start, and after they stop.

Take a look at
https://github.com/nameko/nameko/blob/master/nameko/cli/run.py#L158-L181
for an example.

If I had this requirement I'd use something like consul to discover the
available services though, rather than having to write a new runner.

On Thursday, March 16, 2017 at 1:27:20 PM UTC, Andreas Fehl wrote:

Hi there,

I'm runnig several services in my cluster and i'd like to implement some
kind of self monitoring. A dashboard should show what services are running,
how many instances are out there and what are the hostnames.

So i need to emit an event when the service is stopped just to check out
the service from the list.

How would you guys do that?

Thanks

Andreas