Files
Tiago Silva 3b9de7dbde Initialize usage reporting via plugin registry after auth server setup (#64265)
* Initialize usage reporting via plugin registry after auth server setup

Usage reporting was previously initialized in enterprise process
constructors (cloud.NewTeleport, pro.NewTeleport), which ran after the
OSS auth server completed initialization. This caused enterprise auth
extensions to miss the UsageReporter service because they were initialized
after the OSS auth server was created but before the usage reporting was set up.

To fix the ordering, add a callback mechanism to plugin.Registry:
- SetUsageReportingInitFunc registers a callback to be called once the
  auth server is ready.
- InitUsageReporting triggers that callback from initAuthService, after
  setLocalAuth makes the server available to callers.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* update comment

* handle review feedback

* remove dynamic function load

* fix another addition

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2026-03-26 11:46:12 +00:00
..