You need to write a custom tracer for this. This tracer will do the following
1. Intercept all JMS incoming and outgoing calls
javax.jms.MessageProducer.send(), javax.jms.TopicPublisher.publish(), javax.jms.QueueSender.send(), javax.jms.MessageListener.onMessage(), javax.jms.MessageConsumer.receive()
2. Read JMS Message Header and post metrics to SourceSystem|App<N>:Errors Per Interval if the key matches "SourceSystem"
Thanks,
Abhijit