Pregunta

I would like to create a service whose job is to monitor other services that are running within the same process, and then report basic information like health or service dependencies. I'm having trouble figuring out the best way for my monitoring service to access detailed information about the other services without having to have each service publish its metadata or expose some custom endpoint the monitoring service can communicate with. If I load the configuration and read through it I can get most of the way there but this approach has a few weaknesses:

  • Getting the absolute URI for each endpoint can be difficult, especially when using IIS hosting or fileless activation.
  • Any configuration that was done programmatically would not be able to be read by the monitoring service

What I'd like to be able to do is to somehow access the ServiceDescription to get all the information I need about each ServiceHost, without requiring any work on the part of the service designer to give it to me. Is something like this possible?

¿Fue útil?

Solución

If you've checked Channs links and are convinced you need to roll your own health monitoring infrastructure, you'll probably need to either derive from ServiceHost or go all out and derive from ServiceHostFactoryBase or possibly do both depending on what you need to implement. They'll give you access to the ServiceDescription instance for each service as it is spun up.

Otros consejos

One alternative would be to use WCF's built-in health monitoring and performance monitoring capabilities. This works at the individual service level though.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top