uber-go/fx

Event log for constructor/decorator invoked

sywhang opened this issue · 1 comments

Fx currently emits logs for each constructor or decorator that is provided to the DI container, but it doesn't actually emit logs on which ones that are called.

A few users reached out asking for an observability point for dependencies that are provided to the DI container but aren't actually invoked, since Fx invokes these lazily.

This can be done if we emit logs for each constructors that are invoked (note: this is NOT fx.Invoke, just the calling the constructor itself); then any constructors that are provided but not invoked can be identified from the logs.

Internal Ref: GO-1873.

+1 for having this observability, the lazy invoking has caused a few wild goose chases at https://github.com/celestiaorg/celestia-node