Follow the same pattern in the prometheus plugin:
after_initialize is very likely where you want to put this code.
after_initialize