We try to follow SOA and DDD principles in our project. We use NServicebus as messaging bus. So far we have 20+ services.
How do you guys set up monitoring (i'm not talking about technical monitoring - like is service "xyz" reachable - is the hard disk full) ?
For example
If an Order is placed and the shipping is done 5 days later but it should have been executed after 1 day ... that's an error condition.
Or another example: The shipping is done. Now we send an electronic invoice to our customer. We must archive that invoice and talk asynchronously with a third party (archiving provider) to retrieve our invoice. If that invoice is not retrieved after 5 days ... that's an error condition.
I have problems when defining HOW to model criterias on what is an error and WHERE to put these criterias.
WHERE ...
... do you set up Monitoring rules ?
Are monitoring rules part of your bounded context ? I think yes.
Are monitoring rules directly related to an entity ? I think no.
Are monitoring rules directly related to an aggregate ? I think no.
Monitoring rules are like Domain-Services that span multiple aggregates but as opposed to domain services can also span multiple bounded contexts.
Who is reponsible ?
HOW ...
... do you set up Monitoring rules in code ?
If you want to do it right its a really great deal of effort. Otherwise you could do it really cheap (make some queries here and there) but thats against SOA (the major part i'm concerned about)
Please guide me to a clear and easy to implement solution.
I'm also really excited to learn how you set this up.