Monitoring
Brighter emits monitoring information from an External Bus using a configured Control Bus
Configuring Monitoring
Firstly configure a Control Bus in the brighter application to emit monitoring messages
Config file
Monitoring requires a new section to be added to the application config file:
The monitoring config can then be speicified later in the file:
This enables runtime changes to enable/disable emitting of monitoring messages.
Handler Configuration
Each handler that requires monitoring must be configured in two stages, a Handler attribute and container registration of a MonitorHandler for the given request:
For example, given:
TRequest - a Brighter Request, inheriting from IRequest
TRequestHandler - handles the TRequest, inheriting IHandleRequest <TRequest>
Attribute
The following attribute must be added to the Handle method in the handler, TRequestHandler:
Please note the step and timing can vary if monitoring should be after another attribute step, or timing should be emitted after.
Container registration
The following additional handler must be registered in the application container (where MonitorHandler<T>
is a built-in Brighter handler):
Monitor message format
A message is emitted from the Control Bus on Handler Entry and Handler Exit. The following is the form of the message:
Messages can be processed from the queue and interated with your monitoring tool of choice, for example Live python consumers emitting to console or logstash consumption to the ELK stack using relevant plugins to provide performance raditators or dashboards.
Last updated