People have been asking us time over time, if it’s possible to disable MoSKito in a running system completely. Also we don’t understand why you’d ever want to do it, after first pull request for this feature has been opened, we understood that people are quite serious about it. Well your wish, is our command, so here it goes.
Well we actually didn’t add just a single kill switch, but you can switch off different functions. Of course some of the functions rely on other functions, so if you turn off metric collection nothing will matter anymore. But you can switch off just tracing and keep metric collection.
Following functions can be switched on/off:
- metric collection – turning this off means that MoSKito won’t collect data anymore. It has to be supported by the producer, and not all producers support it (and you’ll need to add this support explicitly if you develop your own producer). All AOP, CDI and Proxy producers support this feature. The intervals themselves will still be updated, but there will be no metric updates and the pointcuts will be completely disabled (this also means that tracing/journeys in aop monitored producers won’t work, even if still on).
- tracing – turning off tracing disables auto-tracers.
- journey – turning off journeys means that no more journeys will be started. Existing journeys will record no more data.
Turning on/off.
There are two ways to enable the kill switch: by configuration or via the MoSKito Inspect UI.
The configuration object responsible for the kill switch is located at the root level of MoSKito Configuration:
"@killSwitch": { "disableMetricCollection": false, "disableTracing": false, "disableJourneys": true },
As usual the changes havre to be performed on the agent side (the actually monitored app) and not on the MoSKito Inspect hosting side (if you are running in remote mode).
Changes are reloaded every 10 seconds and so changing the configuration of a running system will produce desired effect.
Turning off via Inspect
You can also flip the kill switch conveniently via the MoSKito Inspect console. Kill Switch navigation is located under the “Everything else” navigation point:
Once clicked the kill switch display will open up:
You can now toggle individual kill switches:
How do you know it’s on?
Once kill switch is on, the system status will not be updated anymore (so system’s threshold value is set to NONE) and you will see a warning on top of all pages:
So this is it about the kill switch. Still we recommend to always have the metric collection on. But if you want to be able to disable MoSKito, now you can.
Kill Switch is part of the upcoming MoSKito 2.9.2 Release. You can use nightly builds and SNAPSHOTs until then.