register_tracer_factory¶
-
passengersim.callbacks.configured.register_tracer_factory(cls: type[GenericTracer], *, parameters_model: type[BaseModel] | None =
None, version: str | None =None, name: str | None =None) None[source]¶ Register a tracer using the configuration it declares on its class.
The hook, output name, options model, and version are read from the class attributes
hook,name,options_model, andoptions_version(seeGenericTracer), so they are defined once, beside the tracer’s constructor.- Parameters:
- cls : type[GenericTracer]¶
Tracer class declaring a
hookand a canonicalname.- parameters_model : type[pydantic.BaseModel] or None, optional¶
Overrides
cls.options_model. Fields map to constructor keyword arguments. Required if the class declares no options model.- version : str or None, optional¶
Overrides
cls.options_version, the implementation version checked against explicit YAML requirements.- name : str or None, optional¶
Registry name or alias; defaults to
cls.name. Does not rename the tracer’s output.
- Raises:
TypeError – If cls is not a GenericTracer subclass, or no options model is declared or given.
ValueError – If registration duplicates a name or declares an invalid hook/output.