Add a new Blackbox-exporter module#
Introduction#
Blackbox-Exporter modules are part of its configuration. Adding, changing or removing a module is like modifying the configuration of Blackbox-Exporter. This should be done with care.
Before adding a new module in Blackbox-Exporter, first check if an existing module could fullfil your needs.
The list of existing modules can be controled in the documentation and in envs-ng/blackboxExporter.
Tip
The DNS modules are modules to test a DNS against a DNS entry. The DNS entry should be valid. The DNS modules are not supposed to test the entry itself. They only test the DNS server.
Add an new module#
Module file#
The new module should be defined in envs-ng/blackboxExporter directory.
In the new file, the module should inherit of the definition of an existing generic module :
#BlackboxExporterConfigModuleGenericICMP#BlackboxExporterConfigModuleGenericTCP#BlackboxExporterConfigModuleGenericHTTP#BlackboxExporterConfigModuleGenericDNS
A new module should only specialize a parameter of those existing generic modules.
blackboxExporter/modules_schemas.cue#
Generic modules are defined in envs-ng/blackboxExporter/modules_schemas.cue.
The generic schemas were made to fit the needs at that moment. Feel free to update a generic schema if it was not generic enough.
If a new generic module is defined, describe it as generic as you can in envs-ng/blackboxExporter/modules_schemas.cue and add some specialization in another file.
blackbox-exporter-core.cue#
All modules are only described in envs-ng/blackboxExporter/. You have to insert it in the configuration of Blackbox-Exporter
Edit envs-ng/blackbox-exporter-core.cue.
The list of modules is defined in
helmvalues"prometheus-blackbox-exporter"configmodules
This is where you give a name to your module and add its definition.
Documentation#
When you add a new module, you have to update the documentation. This includes the list of modules already activated in Blackbox-Exporter. If you added a new generic module definition, you will also update this documentation (see above).
Test a new module#
To test a new module, you can redeploy Blackbox-Exporter in a specific test zone.
In that zone, you can also deploy a new serviceMonitor defined to use the new module. You may try to deploy the new serviceMonitor directly with Trackbone : see the documentation.
Deployment#
Deployment is done with Trackbone as usual.