A large portion of the handler logic within the prometheus exporter file exporter.q is generally useful for many use cases but one or more handlers may need to be overwritten by a user prior to initialisation.
This PR provides a command line option for noinit which if defined will suppress the execution of .prom.init[] at the end of the exporter.q file allowing users to load other files/define logic they want to introduce before the handlers will process messages according to the prometheus exporters logic
// Behaviour when noinit not called
$ q exporter.q
q).z.ps
{[f;msg]tmp:before_ps msg;res:f msg;after_ps[tmp;msg;res];}[.:]
// Behaviour with noinit called
$ q exporter.q -noinit
q).z.ps
'.z.ps
[0] .z.ps
^
q).prom.init[]
q).z.ps
{[f;msg]tmp:before_ps msg;res:f msg;after_ps[tmp;msg;res];}[.:]
exporter.q
is generally useful for many use cases but one or more handlers may need to be overwritten by a user prior to initialisation.noinit
which if defined will suppress the execution of.prom.init[]
at the end of the exporter.q file allowing users to load other files/define logic they want to introduce before the handlers will process messages according to the prometheus exporters logic// Behaviour with noinit called $ q exporter.q -noinit q).z.ps '.z.ps [0] .z.ps ^ q).prom.init[] q).z.ps {[f;msg]tmp:before_ps msg;res:f msg;after_ps[tmp;msg;res];}[.:]