Lighthouse relies on a plugin system for it’s functionality. All load balancers, discovery methods and health checks are plugins, even the included ones!
All that’s required for creating a new plugin is to subclass the proper base class and add that subclass to the proper entry point in your project’s setup.
For example a new health check called mycheck
might have a class called
MyCheck
, a subclass of lighthouse.check.Check
and added to a
setup.py
‘s setup() call:
setup.py
from setuptools import setup
setup(
# basics...
install_requires=[
# dependencies for your plugin go here
],
entry_points={
"lighthouse.checks": [
mycheck = myproject.MyCheck
]
}
)
Each of the three plugin types have their own entrypoint. For details of each of the three plugin types see their individual documentation: