- What does my micro frontend architecture look like?
- How is it unique?
- How is it similar to other micro frontend systems? (For example, it uses module federation.)
- What sort of information am I observing?
- At what granularity am I observing this information?
Initializing Libraries
To initialize libraries, micro frontend systems usually use either module federation or a central bootstrap. Some systems even use both approaches. Systems using module federation are much more likely to encounter issues while initializing observability libraries, whereas issues are less of a problem with micro frontends that use a central bootstrap approach. Most micro frontends will encounter problems related to the observability SDK being a singleton. OpenTelemetry libraries and the Honeycomb Web SDK must be initialized only once per page load, which can be a problem in micro frontend architectures where every module is attempting to initialize its own OpenTelemetry library or Honeycomb Web SDK. If your system allows, initialize the library in a central bootstrap or shared module, and expose it to the other modules. Some module federation systems allow you to specify “singleton dependencies” for libraries like OpenTelemetry or React.js, which require that they be singletons on the page. This example shows webpack with the ModuleFederation plugin:Understanding Your Observability Needs
The sort of challenges you face will depend on what information you need visibility into and how granular you want to be with attributing things to modules:- What metrics are done on a per-page basis?
- Which metrics should be granular enough to go down to the module, or even the component, level?