Observability for Microfrontends

Rate this content
Bookmark

Teams are getting bigger and bigger following the micro-frontends architecture. Observability for teams on a scale becomes even more important in order not only to be able to identify potential issues in the runtime, but also separating the responsibilities. In this presentation we’ll learn how this can achieved.

This talk has been presented at DevOps.js Conf 2022, check out the latest edition of this Tech Conference.

FAQ

Micro-frontends are not a specific technology but a design approach where a front-end app is decomposed into individual, semi-independent 'microapps' working loosely together. Each microapp is owned by a team that can update it independently of the others.

Frontend engineers should care about observability to ensure they can manage and monitor their applications effectively, especially in complex environments like micro-frontends. It helps in identifying and resolving production issues quickly and efficiently.

Observability in micro-frontends can be achieved by implementing high cardinality data tools that help in debugging and understanding the system's internal states from its external outputs. Tools like New Relic can be used to log runtime production issues and provide insights.

Monitoring involves tracking the known metrics and logs to inform you when something goes wrong. Observability goes deeper, allowing you to understand the internal states of your systems through external outputs and explore the 'unknown unknowns'.

At DAZN, micro-frontends are used to structure teams around specific business domains, allowing each team to independently develop and manage parts of the application related to their domain, improving scalability and flexibility.

DAZN uses New Relic for logging runtime production issues in their micro-frontends. This tool helps in observing and troubleshooting by providing detailed error reports and the ability to query data for specific insights.

A practical implementation of observability in micro-frontends can involve using error boundaries to catch and handle errors locally within components, and integrating with a monitoring tool like New Relic to log these errors and generate alerts.

Yes, the observability techniques used in micro-frontends, like using high cardinality data and error boundaries, can be applied to other software architectures, including microservices and traditional monolithic applications.

Konstantinos Leimonis
Konstantinos Leimonis
24 min
25 Mar, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Microfrontends follow the microservices paradigm and observability is crucial for debugging runtime production issues. Error boundaries and tracking errors help identify and resolve issues. Automation of alerts improves incident response. Observability can help minimize the time it takes to understand and resolve production issues. Catching errors from the client and implementing boundaries can be done with tools like OpenTelemetry.
Available in Español: Observabilidad para Microfrontends

1. Introduction to Observability for Micro-frontends

Short description:

Hi, everyone. My name is Konstantinos, and I'm a software engineer based in London. Today, I'll be talking about observability for micro-frontends. We'll explore what micro-frontends are, their relationship with observability, and why frontend engineers should care about it. We'll also have a demo applying observability to micro-frontends. At DAZN, we heavily invest in micro front ends, creating teams that focus on specific business domains. Let's start with microservices, which were introduced to separate the backend monolith into smaller pieces of logic and data. We applied the same architecture to frontend applications, giving birth to microfrontend apps.

Hi, everyone. My name is Konstantinos, and I'm a software engineer based in London. The topic I would like to share with you today is about observability for micro-frontends.

Quick agenda for today, I'm going to talk about micro-frontends and observability so as to understand what are they, if they can fit together, and how they can coexist. Should we, as frontend engineers, care about observability? And finally, a demo so as we can apply observability to the micro-frontends.

Some goals for today. We're going to define the path to observability. This is going to be our starting point and how we can actually grow from there. We're going to see some useful patterns that me and my team found really helpful during our journey to identify runtime issues in production and we're gonna automate how we are getting notified and receiving alerts for production incidents.

So let's crack on. Micro-frontends. First of all, if you're wondering if they exist, I can tell you they do exist. They're not a magic unicorn, they're actually not a tool, not a technology, they're a way to scale software and teams. They help us better structure our teams in order to focus on a business domain and help a team solve and own a specific problem of the business.

At DAZN, where I'm currently working, we apply micro-frontends but let me first give you an overview of it. This video will give you some further context. DAZN is a live and on-demand sports streaming platform, giving sport fans the control and flexibility to watch their sports their way. You don't need a cable or a satellite dish to watch it, so the setup is pretty quick and simple. You can download the DAZN app and watch on multiple devices at home or on the go. We are deploying software to multiple targets like web, mobile, and TVs. At DAZN, we are heavily invested in micro front ends, creating front end teams focusing on a specific business domain.

Let's start with microservices. Some years ago, we realized that we want to start building teams around a specific problem of the business. Microservices were introduced as a way to separate the back end monolith to smaller pieces of logic and data. As you can see here, we have the discovery service, the authentication service, my account and preferences service. These services are focusing in a specific domain, in a specific business domain. Sometimes, we have an aggregation layer in front of it, like can be a backend for front-end or a GraphQL API. This is what front-end applications are using in order to consume these services if they're not directly consuming them. And at that time, front-end was still a monolith. And we said, why not apply the same architecture in front-end applications? That is how microfrontend apps were born.

2. Microfrontends and Observability

Short description:

Microfrontends follow the microservices paradigm, they separate the monolith and front-end application to separate the smaller ones. Now we have end-to-end teams with specific mission, focusing on a piece of the business. In either case, micro-front-ends have to follow the same principles like micro-services. But for the time being, I want us to focus on micro-front-ends as high observable systems. Observability is a way to democratize this process. It gives all the team members, actually the most curious ones, the ability to debug these issues. Observability is the condition of being empowered to ask why, giving you the flexibility to dig into the unknown unknowns on the fly.

Microfrontends follow the microservices paradigm, they separate the monolith and front-end application to separate the smaller ones. Now we have end-to-end teams with specific mission, focusing on a piece of the business. Like here, you can see we have the team discovery, we have the team authentication, team My Account, or team preferences, and they expand the team across the stack. We have front-end, backend, and database teams that have focused on this specific mission of the business.

The teams here might feel like very well defined, but sometimes there might not be that clear separation. If we zoom in, one of these micro-front-ends, we can find some more micro-front-ends, and this is when things start becoming a bit confusing, and separation of concerns can get a bit blurry. Here for example, we might have a team A responsible for header and footer, but we might have a team B responsible for my account details. These are different modules in this micro-front-end, but different teams might have different responsibilities.

In either case, micro-front-ends have to follow the same principles like micro-services. But for the time being, I want us to focus on micro-front-ends as high observable systems. In micro-front-ends, it's easier to observe a single system than a system split in multiple modules. But how are we able to provide high observability in the latter Zoom in case of micro-front-end? But in order to do that, let's try to understand what is observability.

Observability as a term can be quite abstract, so let's try to limit it down to a more specific definition. Monitoring is not observability. You might have seen dashboards and metrics tracking a live system. Monitoring has been the de facto approach for so long. People tend to think of it as the only way of understanding their systems instead of just one way to understand them. Monitoring tells you when something is wrong. You need to know in advance what signals you want to monitor, your known unknowns.

In a similar way intuition is not observability. You might have been to a case where in your team you have a production issue and one of the most experienced engineer in the team is able to debug and find out the root cause of that issue and finally resolve it. Observability is a way to democratize this process. It gives all the team members, actually the most curious ones, the ability to debug these issues. Kalman said, Observability is a measure of how well internal states of a system can be inferred from knowledge of its external outputs. Kalman was an engineer in the 60s and defined observability. Observability has its roots in control theory and in order to understand this definition we would need to deep dive in linear algebra and formal methods, but we won't do that. It now means different things in different communities and can also be applied to modern software systems. But one important bit of observability is this. Observability is the condition of being empowered to ask why, giving you the flexibility to dig into the unknown unknowns on the fly. How can we achieve this? We can do that with high cardinality.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Scaling Up with Remix and Micro Frontends
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Scaling Up with Remix and Micro Frontends
Top Content
This talk discusses the usage of Microfrontends in Remix and introduces the Tiny Frontend library. Kazoo, a used car buying platform, follows a domain-driven design approach and encountered issues with granular slicing. Tiny Frontend aims to solve the slicing problem and promotes type safety and compatibility of shared dependencies. The speaker demonstrates how Tiny Frontend works with server-side rendering and how Remix can consume and update components without redeploying the app. The talk also explores the usage of micro frontends and the future support for Webpack Module Federation in Remix.
Levelling up Monorepos with npm Workspaces
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Levelling up Monorepos with npm Workspaces
Top Content
NPM workspaces help manage multiple nested packages within a single top-level package, improving since the release of NPM CLI 7.0. You can easily add dependencies to workspaces and handle duplications. Running scripts and orchestration in a monorepo is made easier with NPM workspaces. The npm pkg command is useful for setting and retrieving keys and values from package.json files. NPM workspaces offer benefits compared to Lerna and future plans include better workspace linking and adding missing features.
Automating All the Code & Testing Things with GitHub Actions
React Advanced Conference 2021React Advanced Conference 2021
19 min
Automating All the Code & Testing Things with GitHub Actions
Top Content
We will learn how to automate code and testing with GitHub Actions, including linting, formatting, testing, and deployments. Automating deployments with scripts and Git hooks can help avoid mistakes. Popular CI-CD frameworks like Jenkins offer powerful orchestration but can be challenging to work with. GitHub Actions are flexible and approachable, allowing for environment setup, testing, deployment, and custom actions. A custom AppleTools Eyes GitHub action simplifies visual testing. Other examples include automating content reminders for sharing old content and tutorials.
Monolith to Micro-Frontends
React Advanced Conference 2022React Advanced Conference 2022
22 min
Monolith to Micro-Frontends
Top Content
Microfrontends are considered as a solution to the problems of exponential growth, code duplication, and unclear ownership in older applications. Transitioning from a monolith to microfrontends involves decoupling the system and exploring options like a modular monolith. Microfrontends enable independent deployments and runtime composition, but there is a discussion about the alternative of keeping an integrated application composed at runtime. Choosing a composition model and a router are crucial decisions in the technical plan. The Strangler pattern and the reverse Strangler pattern are used to gradually replace parts of the monolith with the new application.
Fine-tuning DevOps for People over Perfection
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Fine-tuning DevOps for People over Perfection
Top Content
DevOps is a journey that varies for each company, and remote work makes transformation challenging. Pull requests can be frustrating and slow, but success stories like Mateo Colia's company show the benefits of deploying every day. Challenges with tools and vulnerabilities require careful consideration and prioritization. Investing in documentation and people is important for efficient workflows and team growth. Trust is more important than excessive control when deploying to production.
Why is CI so Damn Slow?
DevOps.js Conf 2022DevOps.js Conf 2022
27 min
Why is CI so Damn Slow?
Slow CI has a negative impact on productivity and finances. Debugging CI workflows and tool slowness is even worse. Dependencies impact CI and waiting for NPM or YARN is frustrating. The ideal CI job involves native programs for static jobs and lightweight environments for dynamic jobs. Improving formatter performance and linting is a priority. Performance optimization and fast tools are essential for CI and developers using slower hardware.

Workshops on related topic

Micro Frontends with Module Federation and React
JSNation Live 2021JSNation Live 2021
113 min
Micro Frontends with Module Federation and React
Workshop
Alex Lobera
Alex Lobera
Did you ever work in a monolithic Next.js app? I did and scaling a large React app so that many teams can work simultaneously is not easy. With micro frontends you can break up a frontend monolith into smaller pieces so that each team can build and deploy independently. In this workshop you'll learn how to build large React apps that scale using micro frontends.
Deploying React Native Apps in the Cloud
React Summit 2023React Summit 2023
88 min
Deploying React Native Apps in the Cloud
WorkshopFree
Cecelia Martinez
Cecelia Martinez
Deploying React Native apps manually on a local machine can be complex. The differences between Android and iOS require developers to use specific tools and processes for each platform, including hardware requirements for iOS. Manual deployments also make it difficult to manage signing credentials, environment configurations, track releases, and to collaborate as a team.
Appflow is the cloud mobile DevOps platform built by Ionic. Using a service like Appflow to build React Native apps not only provides access to powerful computing resources, it can simplify the deployment process by providing a centralized environment for managing and distributing your app to multiple platforms. This can save time and resources, enable collaboration, as well as improve the overall reliability and scalability of an app.
In this workshop, you’ll deploy a React Native application for delivery to Android and iOS test devices using Appflow. You’ll also learn the steps for publishing to Google Play and Apple App Stores. No previous experience with deploying native applications is required, and you’ll come away with a deeper understanding of the mobile deployment process and best practices for how to use a cloud mobile DevOps platform to ship quickly at scale.
MERN Stack Application Deployment in Kubernetes
DevOps.js Conf 2022DevOps.js Conf 2022
152 min
MERN Stack Application Deployment in Kubernetes
Workshop
Joel Lord
Joel Lord
Deploying and managing JavaScript applications in Kubernetes can get tricky. Especially when a database also has to be part of the deployment. MongoDB Atlas has made developers' lives much easier, however, how do you take a SaaS product and integrate it with your existing Kubernetes cluster? This is where the MongoDB Atlas Operator comes into play. In this workshop, the attendees will learn about how to create a MERN (MongoDB, Express, React, Node.js) application locally, and how to deploy everything into a Kubernetes cluster with the Atlas Operator.
Azure Static Web Apps (SWA) with Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
13 min
Azure Static Web Apps (SWA) with Azure DevOps
WorkshopFree
Juarez Barbosa Junior
Juarez Barbosa Junior
Azure Static Web Apps were launched earlier in 2021, and out of the box, they could integrate your existing repository and deploy your Static Web App from Azure DevOps. This workshop demonstrates how to publish an Azure Static Web App with Azure DevOps.