What I want to focus on is on micro front ends that need to isolate the failure and be high observable systems. It's easier to observe a single system, but it's a bit difficult to observe a system split into multiple modules.
So here, for example, we have my account, which is the container application. And we are also having menu, which is a specific module. Footer, which is another module. And profile, which is another one. So how we're going to solve this problem. We're going to need clear boundaries. And the way that we're going to do that is by using React boundaries. This is like a solution for quite some time now. So we're going to wrap our container components and the module components using the boundaries. And that way, we're actually able to create some scope around these errors.
Another thing, and the very first step to observability, is to be able to track the error in production with structured events. What this means is that by using the error boundaries, we're able to track on the New Relic system or any other of your tools that you're using. We're able to log the error and we're also able to define some metadata about these errors. And this is about, for example, module name, module version, or whatever else we want to create some context about. This is what we're going to do for the module error boundary as well.
And finally, now that we're tracking all this data on New Relic, we're able to start querying this data from the New Relic tables. This is how New Relic query language would work. And we are able to query down to very, very specific error types and define it in the component source based on the context that we define from the metadata from the error tracking before. And we're also able to get notified from them in the simplest form with an email, or otherwise integrating with a online or on-call support system like PagerDuty. So you can actually do this, actually, also with Terraform, you can automate all the stuff and it's much, much easier.
And yeah, that's pretty much all for now. A really short introduction on the journey to observability for micro frontends. Thank you very much. If you have any questions, I'll be around after this talk. I'm on Discord and Twitter with this handle. Thank you very much.
Comments