Class implementing monitoring service functionality.
Notes
-----
This is a singleton class which serves all client agents in an application.
It accepts records from agents, filters it based on a set of configured
rules and forwards them to one or more configured handlers. By default
there are no handlers defined which means that all records are discarded.
Default set of filtering rules is empty which accepts all agent names.
To produce a useful output from this service one has to add at least one
handler using `add_handler` method (e.g. `LoggingMonHandler` instance).
The `set_filters` methods can be used to specify the set of filtering
rules.
None lsst.dax.apdb.monitor.MonService.set_filters |
( |
| self, |
|
|
Iterable[str] | rules ) |
Define a sequence of rules for filtering of the agent names.
Parameters
----------
rules : `~collections.abc.Iterable` [`str`]
Ordered collection of rules. Each string specifies filtering rule
for a single name, or catch-all rule. The rule consist of the
agent name prefixed by minus or optional plus sign. Catch-all rule
uses name "any". If the rule starts with minus sign then matching
agent will be rejected. Otherwise matching agent is accepted.
Notes
-----
The catch-all rule (`-any`, `+any`, or `any`) can be specified in any
location in the sequence but it is always applied last. E.g.
`["-any", "+agent1"]` behaves the same as `["+agent1", "-any"]`.
If the set of rues does not include catch-all rule, filtering behaves
as if it is added implicitly as `+any`.
Filtering code evaluates each rule in order. First rule that matches
the agent name wins. Agent names are matched literally, wildcards are
not supported and there are no parent/child relations between agent
names (e.g `lsst.dax.apdb` and `lsst.dax.apdb.sql` are treated as
independent names).