scieee AI-readable full text Open interactive document viewer

An observability approach for microservices architectures based on opentelemetry

Moreira, André Cunha Azevedo

Abstract

The rapid adoption of microservices and cloud-native architectures has revolutionized the way modern applications are developed and deployed. However, this shift has introduced new challenges in terms of ensuring the reliability and performance of these distributed systems. In response, observability is proposed as a new methodology to address these challenges. Observability refers to the collection of telemetry data (including traces, metrics, and logs) from a system components in real time, allowing for a comprehensive understanding of its internal status and behavior. This capability is essential for troubleshooting, performance optimization, and enhancing system reliability by facilitating the detection of errors and anomalies. The main objective of this thesis is to implement an observability concept within a Python Flask based system. The system follows a cloud-native, microservices, and event-driven architecture. The main motivation for this study is the recent, but important development of observability and the culture of Development and Operations (DevOps). The chosen method for implementation is OpenTelemetry, a neutral and open-source approach to observability. This decision aims to avoid vendor lock-in, which can be a concern with vendor-specific agents. Furthermore, a study is carried out to make a choice among the vendors considered which are compat ible with OpenTelemetry, e.g. Jaeger, Zipkin, Prometheus, Elastic Search, New Relic, Datadog, Dynatrace, Grafana, Splunk, and AppDynamics. Each vendor offers different approaches to observability and visual ization of the telemetry data. In addition, a weighted decision matrix is used to aid in the decision along with a decision criterion defined by the development team. The results of this study not only highlight the vendor selection process for telemetry data visualization but also emphasize that OpenTelemetry is a viable and standardized approach to observability, offering an effective means to prevent vendor lock-in.

Full text

University of Minho School of Engineering André Cunha Azevedo Moreira An observability approach for microservices architectures based on OpenTelemetry december 2023 University of Minho School of Engineering André Cunha Azevedo Moreira An observability approach for microservices architectures based on OpenTelemetry Master’s Dissertation in Informatics Engineering Dissertation supervised by André Ferreira Sascha Lange João Miguel Fernandes december 2023 Copyright and Terms of Use for Third Party Work This dissertation reports on academic work that can be used by third parties as long as the internationally accepted standards and good practices are respected concerning copyright and related rights. This work can thereafter be used under the terms established in the license below. Readers needing authorization conditions not provided for in the indicated licensing should contact the author through the RepositóriUM of the University of Minho. License granted to users of this work: CC BY https://creativecommons.org/licenses/by/4.0/ i Acknowledgements First and foremost, I want to express my gratitude to my parents for their support and love. Their belief in me has been my greatest source of strength. I dedicate this dissertation to them with all my love and appreciation. I owe a special thanks to my girlfriend, Diana, who has been my partner in both the ups and downs of life. Her faith in my abilities and her boundless love have been my greatest motivation. To my family and friends, your support, presence, and kindness have been essential to my success. I also want to thank Bosch for the opportunity to conduct my dissertation research within their esteemed organization. I am truly grateful for the generosity and openness with which the company welcomed me into their professional environment. This experience has not only enriched my academic journey but has also equipped me with a deeper understanding of the industry. I want to express my deep appreciation to my dissertation supervisors, André Ferreira, Sascha Lange, and João M. Fernandes. Their guidance, expertise, and support have been invaluable throughout this journey. I also want to thank Nuno Sousa for his willing to help, support, and interest in my work. His problem solving and dedication helped me throughout this challenging year. I want to pay a special tribute to the memory of my grandmother, who recently passed away and could not be there to witness this moment. Her love and wisdom have always been a guiding light in my life, and though she is no longer with us, her legacy lives on in my work. Thank you all. André Moreira ii Statement of Integrity I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho. University of Minho, Braga, december 2023 André Cunha Azevedo Moreira iii Assinado por: André Cunha Azevedo Moreira Num. de Identificação: 15168395 Data: 2023.12.20 16:28:42+00'00' Abstract The rapid adoption of microservices and cloud-native architectures has revolutionized the way modern applications are developed and deployed. However, this shift has introduced new challenges in terms of ensuring the reliability and performance of these distributed systems. In response, observability is proposed as a new methodology to address these challenges. Observability refers to the collection of telemetry data (including traces, metrics, and logs) from a system components in real time, allowing for a comprehensive understanding of its internal status and behavior. This capability is essential for troubleshooting, performance optimization, and enhancing system reliability by facilitating the detection of errors and anomalies. The main objective of this thesis is to implement an observability concept within a Python Flaskbased system. The system follows a cloud-native, microservices, and event-driven architecture. The main motivation for this study is the recent, but important development of observability and the culture of Development and Operations (DevOps). The chosen method for implementation is OpenTelemetry, a neutral and open-source approach to observability. This decision aims to avoid vendor lock-in, which can be a concern with vendor-specific agents. Furthermore, a study is carried out to make a choice among the vendors considered which are compatible with OpenTelemetry, e.g. Jaeger , Zipkin , Prometheus , Elastic Search , New Relic , Datadog , Dynatrace , Grafana , Splunk , and AppDynamics . Each vendor offers different approaches to observability and visualization of the telemetry data. In addition, a weighted decision matrix is used to aid in the decision along with a decision criterion defined by the development team. The results of this study not only highlight the vendor selection process for telemetry data visualization but also emphasize that OpenTelemetry is a viable and standardized approach to observability, offering an effective means to prevent vendor lock-in. Keywords Observability, Monitoring, Cloud-Native, Microservices, OpenTelemetry, Tracing iv Contents I Introductory material 1 1 Introduction 2 1.1 Context ........................................ 2 1.2 Objectives ...................................... 4 1.3 Document structure .................................. 4 2 State of the Art 5 2.1 Software architectures ................................ 5 2.1.1 Monolithic Architecture ............................ 6 2.1.2 Microservices Architecture .......................... 7 2.1.3 Cloud-native Architecture ........................... 9 2.1.4 Service-Oriented Architecture ......................... 11 2.1.5 Event-Driven Architecture ........................... 12 2.2 Monitoring ...................................... 15 2.3 Observability ..................................... 16 2.4 The Telemetry Problem ................................ 18 2.5 OpenTelemetry .................................... 19 2.5.1 Signals .................................... 20 2.5.2 Instrumentation ............................... 21 2.5.3 Collector ................................... 22 2.6 Comparison OpenTelemetry vs Vendor-specific Agents ................. 23 2.7 Considered observability vendors ........................... 24 2.8 OpenTelemetry Astronomy Shop Demo ........................ 31 3 The problem and its challenges 32 v II Core of the Dissertation 34 4 Methodology 35 4.1 Context description .................................. 35 4.2 Observability concept ................................. 37 4.3 Observability solution ................................. 38 4.3.1 OpenTelemetry selection ........................... 38 4.3.2 OpenTelemetry Collector selection ...................... 38 4.3.3 OpenTelemetry ................................ 39 4.3.4 OpenTelemetry Collector ........................... 40 4.3.5 Instrumentation ............................... 41 4.4 Vendors ....................................... 43 5 Results and Discussion 52 5.1 Weighted Decision Matrix ............................... 52 5.2 OpenTelemetry .................................... 54 6 Conclusions and future work 60 6.1 Conclusions ..................................... 60 6.2 Prospect for future work ................................ 61 vi can scale each service individually [44]; no need to redeploy the whole app if a small change is made [35]; development becomes easier due to the lack of interdependence between services [44]; since the functionality is isolated, there’s less chance a developer makes a change that affects other components [44]; each microservice is an independent unit [7]; each service can use different technology [1]; the separation and isolation of services helps testing functionalities [44]. The shift to microservices has aid in the rise of DevOps teams. However, microservices also introduce new challenges, such as difficulties in monitoring the software due to the high number of connections between microservices. Without proper visibility into the system, teams may struggle to understand its behaviour, making it challenging to identify the root cause of errors and troubleshoot them [44][31]. However, observability tackles these challenges due to its capacity to allowing the services to be white boxes and, in consequence, to infer about the internal state of a system [38]. In addition, since observability makes it possible to gain insights about the system, it also makes it possible to understand its behaviour and to quickly detect and resolve potential issues [33]. Understanding the historical context of OpenTelemetry emergence is crucial before diving into its details. Microservices architectures, containerization, and cloud-native technologies have all increased demand for efficient application monitoring. As a result of traditional monitoring solutions’ frequent inability to keep up with the dynamic nature of modern applications, more adaptable and scalable substitutes have emerged [22]. OpenTracing and OpenCensus, two distinct open-source projects, merged to form the basis of OpenTelemetry. The goal of this union was to establish a single, uniform standard for instrumenting services and applications in order to efficiently collect telemetry data. As these projects successor, OpenTelemetry has quickly gained traction with the help of a large group of contributors and industry leaders [19]. The critical role that OpenTelemetry plays in ensuring the reliability, performance, and security of modern software systems emphasizes its importance in the domain of application monitoring and observability. OpenTelemetry provides a vendor-agnostic, cross-language, and cross-platform framework for collecting and exporting telemetry data such as traces, metrics, and logs. This not only simplifies the process of instrumenting applications, but also ensures compatibility with a diverse set of monitoring and observability solutions, making it appealing to both developers and operators [9]. While OpenTelemetry has a lot of potential, it’s important to remember that the framework is still in its early stages. The lack of literature and best practices in the OpenTelemetry domain constitutes a gap in the current body of knowledge. This gap provides a strong incentive for researchers and developers to investigate, study, and contribute to this emerging technology, actively adding knowledge and direction while paving the way for future research. By exploring the inner workings of OpenTelemetry, examining its real-world application, and making a contri- 3 bution to the field’s evolution, this research seeks to close this gap. By doing this, the study hopes to promote OpenTelemetry’s wider adoption, which will advance the field of observability and improve the performance and reliability of contemporary software systems. 1.2 Objectives Within the scope of the project, the main goal is to implement an observability approach for microservices architectures. In order to achieve that, there is the need to do a prior study about the topic and the related subtopics; identifying the potential tools and standards to use (that supports the observability concept implementation); understanding how to instrument the system to produce telemetry data; deciding for an observability vendor that allows to consume the telemetry data, so that it is possible to visualize it. By the end, it is expected to have the definition of the approach and the implementation of a observability tool, capable of providing the microservices system with observability. 1.3 Document structure This document is divided into two main parts: Introductory Material and Core of the Dissertation. The first part - Introductory Material - contains a brief Introduction explaining the context and main objectives of this study. Next, a detailed literature review of the problem in study is presented, namely Software Architectures, Observability, The Telemetry Problem, The OpenTelemetry and Observability Vendors. At the end of this part, the problem studied and its main challenges are presented. The second part - Core of the Dissertation - contains the chapters Methodology, Results, Discussion and Conclusion. First, in the Methodology section, each decision and assumption made is explained in detail. The selection of OpenTelemetry is explained and the vendor study is conducted using a Multiple Criteria Decision Making (MCDM) method, more specifically a Weighted Decision Matrix (WDM). Next, the main results are presented in the Results section, analyzed and discussed in the Discussion section. Finally, in Conclusion section, the main achievements of the research are summarized, as well as potential lines for future research. 4 Chapter 2 State of the Art 2.1 Software architectures In 1996, Shaw and Garlan were recognized as the leading figures in the field of conscious software architecture, which was still in its earlier stages [55]. Nevertheless, the concept of software architecture has been present for decades, dating back to the 1960s when computer systems were relatively simple. During that era, software architects relied on diagrams and sketches to help in the visualization and understanding of their systems [5]. Starting from the early computer era, there was evolution from the early punch cards to the next generation assembly languages and then to the era of Fortran and Cobol, which further evolved to C, Smalltalk, and others, and then to C++, Java, and C#. Therefore, architecture had to be adaptable to the programming paradigm, including to the programming language and tools of choice [10]. Software architecture is a crucial aspect of software development that involves the high-level design of a software system. It establishes the structure, behaviour, and interactions of the software, serving as a guide for its implementation. The choices made in regards to software architecture are significant as the architecture serves as the skeleton of the system, impacting its quality attributes and constraining the system [15]. 5 2.1.1 Monolithic Architecture One example of software architecture is the monolithic architecture. It starts with a team delivering value through fast iterations within a single application. Then, the business prospers and the use cases grow. More developers are needed to keep up with the demand. The team outgrows the application and the struggles start to arise. New functionalities are added, in contrast of the old ones, which can be removed but a footprint is left behind. The application quickly grows and becomes difficult to manage and maintain [45]. Figure 1represents an example of a monolithic approach. Figure 1: Monolithic application [23]. Monoliths can be an appropriate solution in several contexts, however, as companies outgrow them, they can become a challenge. One of the main issues with monoliths is the complexity and lack of boundaries the application can have. Also, it is very difficult to keep the technology stack updated, since monoliths normally are applications with several years and some technologies might be discontinued [45]. Even though the monoliths are treated as an anti-pattern, there are a lot of misconception about the monolithic architectures. Some examples are the code reuse (since all the code is inside one application), the deployment (which is easier since there is only one application), and the monitoring (since the scope is reduced to one application, monitoring is straightforward). Likewise other architectures, there is not an one-size-fits-all solution neither an one- 6 size-fits-none solution. The architecture must be an adequate decision that depends on the situation [45]. 2.1.2 Microservices Architecture A relatively new trend in software architecture is the move towards microservices architecture. This architectural style is focused on isolating the functionality in microservices, in which the services and the development teams are as independent from each other as possible [56]. It is about breaking down a monolithic application into smaller, loosely coupled services that can be developed and deployed independently. These services are independent components, conceptually deployed in isolation and equipped with dedicated memory persistence tools [35]. Mainly, a microservice architecture involves multiple services functioning within a system, that are independent but communicate with each other through messages. Each service has a specific, singular purpose within the system. For example, using a microservices-oriented architecture software that performs basic math operations, two different microservices can be pointed out - one for displaying and the other for calculations [35]. Figure 2 demonstrates a microservice approach. Figure 2: Microservices application [24]. The utilization of microservices offers several key advantages, with increased scalability being one of the them. The division of a complex application into smaller services allows for individual scaling, maximizing resource utilization and resulting in enhanced performance and user experience. Furthermore, the microservices architecture enhances 7 fault tolerance: if one service fails, it does not impact the entire system, allowing for more resilient and robust systems [37]. Another advantage is the faster development and deployment of applications, since microservices can be developed and deployed independently, allowing for faster development cycles. The shift to microservice architectures promises faster time-to-market of individual services, less coordination and therefore less complexity through the development process [27]. The achievement of these promises is related to the independence of development teams and the efficiency on the utilization of resources, which enables the possibility of scaling individual services independently [27]. In addition to all these benefits, microservices also have better resource utilization. By deploying each service on the optimal infrastructure, resource utilization can be optimized and performance can be enhanced. Performance is a crucial factor in the success of IT systems. It is considered one of the key qualities for a software company to achieve success, as users are more satisfied with software that is fast and functions properly. Any performance problems that occur can result in a loss of revenue. For example, Google loses 20% traffic if their web sites respond 500 ms slower than usual, Amazon loses 1% of revenue for every 100 ms in latency, Mozilla’s study showed that if the page is not loaded within 1 to 5 seconds, users will leave the page [28]. Microservices offer several benefits, such as improved modularity, scalability, and reusability [10]. By breaking down a complex application into smaller, autonomous components, the system can be managed more effectively (modularity), and be able to expand and add new features without disrupting existing ones (scalability). Additionally, by developing smaller assets instead of larger ones, reusability is increased. However, there are also some challenges that need to be addressed, such as the need to observe the systems behaviour in order to monitor it [10]. Even though the usage of microservices provides various advantages, it also contains challenges that need to be overcome. Organization or reorganization is one of the challenges, since it is difficult to sync development teams. Also, there is the possibility of having to reorganize the team. So, without a proper software project management approach or a well-established DevOps team, there is limited communication and partnership between development and operations. In order to minimize this, Agile and Scrum methodologies can be adopted, for the purpose of improving organization and communication. Another challenge about microservices architecture is decomposing monolith applications into decoupled services. It is an hard task for developers to move the functionality to different microservices, delivering the same results. In addition, the communication between microservices can represent an issue, since it occurs over the network, which is unreliable. Therefore, to ensure that the whole system does not fail, there is the need to compensate the malfunctioning of one or more microservices. In order to achieve that, the quality of the service can be degraded, 8 by using default or cached values. However, this problem can not be solved regarding hardware. For example, the availability of a microservices can be improved by using hardware with higher availability, yet if the microservice fails despite the highly available hardware, the money invested in better hardware was not spent in the best way [16,56]. 2.1.3 Cloud-native Architecture One of the recent trends in software architecture is the use of cloud-native architecture. This method leverages the power of cloud computing to create software systems specifically designed for the cloud environment. Cloud-native design leads to automatic scaling, enhanced reliability, and quicker market deployment. It also results in more resource utilization and easier software system administration [32]. Before going through the cloud-native domain, it is important to have enough background about cloud computing. In 2011, Mell and Grance [36] from the National Institute of Standards and Technology published the most cited and agreed upon definition of cloud computing. They defined the cloud essential characteristics as on-demand self-service, broad network access, resource pooling, rapid elasticity, and measured service [34]. The on-demand service in cloud computing allows customers to access and utilize cloud resources automatically and at their discretion, without the need for any intervention from the cloud provider. This is facilitated by the availability of broad network access, enabling customers to access these resources from any device and internet connection. In cloud computing, resources are consolidated and grouped by cloud providers in a multi-tenant model, making it easier for customers to access and utilize these resources. However, this also hides the exact location of the resources and only provides vague information such as ”zones” or ”data-center country”. Also, cloud providers must enable their customers to quickly and easily scale up or scale down their resources as needed. Lastly, as cloud consumers consume the resources, they must be charged according to the resources used [34]. Mell and Grance [36] also defined service models (how services are consumed) as Infrastructure as a Service (IaaS),Platform as a Service (PaaS) and Software as a Service (SaaS). The main differentiation factor between them is the level of abstraction [34]. The IaaS model is considered to be the service model with the lower level of abstraction, which offers basic compute, network, and storage resources to its customers, who are responsible for managing their operating systems and applications on top of these resources. However, the underlying layers such as data-center networks, storage, servers, and virtualization are not accessible to the customers and remain under the control of the cloud provider [34]. The PaaS model offers a higher level of abstraction compared to IaaS. It abstracts virtual machines and essential resources such as network, servers, storage, and operating systems, while providing direct support for 9 programming languages, libraries, services, and tools. Consumers have some degree of control over the platform configuration through environment parameters, which are determined by the cloud providers [34]. Finally, SaaS is the highest level of abstraction among the cloud service models. In this model, cloud providers offer consumers software and applications that are already installed and maintained on their cloud infrastructure. These can be accessed through web browsers, thin clients, desktop interfaces, or API’s. The consumer does not manage any aspect of the technology stack in the data center, and can only use the software provided by the cloud provider [34]. Figure 3illustrates the cloud computing service models approached before, in which it is possible to understand what is managed by the client and what is managed by the service provider, in each cloud computing service model. Figure 3: Cloud computing service models [23]. Cloud-native architecture is based on several principles, including microservices, containerization, automated management, and resiliency. Microservices are divided into smaller, independent components that can be created, deployed and scaled individually [9]. Containerization, on the other hand, allows for self-contained units that contain all the dependencies, libraries, and configurations needed to run the application [9]. Automated management are automated through the use of continuous integration and continuous delivery (CI/CD) pipelines and other automation tools, by deploying, scaling and managing applications [9]. Finally, observability, which is the ability of a system to 10 be observable, using monitoring and logging capabilities that enable real-time monitoring and troubleshooting [9]. There are several advantages of using cloud-native architecture, including scalability, in which applications can handle increased demands without requiring manual intervention. This is achieved by the usage of microservices (allow services to scale independently) and containers (allow applications to be deployed faster and easily). In addition, flexibility makes applications more adapted to changing business requirements, since they have the ability to add or remove services as needed. Also, resilience, due to the availability, redundancy and automatic failover capabilities the architecture should have. By allowing faster development, deployment, and testing, the agility is more notable, the time-to-market is faster and there is a decrease in time to deliver new products [9][24]. Even though the cloud-native led to multiple advantages to the Information Technology (IT) world, it also brought some challenges. One of them is security, since cloud-native apps can be built from many small components and it is difficult to ensure privacy of the data in each small component. A possible solution for this problem would be to encourage development teams to bring security into development phase. Therefore, developers must build and code with security in mind, not leaving it to afterwards. In order to achieve that, DevSecOps teams were created. DevSecOps is the result of the efforts made to integrate security in DevOps [17]. 2.1.4 Service-Oriented Architecture The development, deployment, and maintenance of software systems can be made simpler and more affordable by using the approach known as Service-Oriented Architecture (SOA). It enables the integration of several applications or systems, enhancing flexibility, scalability, and adaptability. The idea of services, which are essentially reusable and loosely connected functional units that may be used by many applications or systems, is the fundamental tenet of SOA. These services are made to function regardless of the technology platform, programming language, or operating system that underlies them. As a result, developers can quickly construct, test, and integrate them into other systems as required. Standardized communication protocols like, Simple Object Access Protocol (SOAP), and REpresentational State Transfer (REST) are also essential to SOA. Regardless of the underlying technological platforms or programming languages, these protocols offer a standard means for services to communicate with one another. Without the need for difficult integration efforts, this makes it simpler for many systems to exchange data and functionality [8]. The capacity of SOA to promote software reuse is one of its most important advantages. Developers can save time and effort by decomposing big systems into smaller, reusable services rather than having to rebuild functionality that already exists. This may result in shorter development timeframes, lower costs, and higher output. Furthermore, SOA offers more scalability and flexibility. Services can be changed or replaced without having an impact on other 11 system components because they are developed and deployed independently. As a result, it is possible to react more quickly to evolving business requirements or technology developments. Besides, SOA allows for horizontal scaling, which enables the addition of more service instances to manage growing workloads without substantially altering the underlying architecture [52]. Despite all the advantages listed above, implementing SOA can be challenging, particularly when it comes to designing and managing a distributed system with multiple services. This requires a high level of technical expertise, as well as robust tools and processes for monitoring, testing, and debugging [52]. There may also be performance overhead associated with the use of standardized communication protocols, which can impact system performance [52]. 2.1.5 Event-Driven Architecture Another tendency in software architecture is the usage of the Event-Driven Architecture (EDA).EDA is a widelyused pattern for addressing the challenges caused by distributed data systems. In addition, it is also known for its scalability and flexibility, making it a popular choice among developers [44]. In an EDA, each microservice sends out an event whenever a significant occurrence takes place. This allows for real-time communication and data exchange between microservices, enabling the system to respond to changes and updates in real-time [45]. Additionally, EDA is an asynchronous architecture pattern, meaning that the microservices do not have to wait for a response before proceeding with their own processing. This allows for high levels of parallelism and improved system performance. It is made up of highly adaptable and decoupled single-purpose event processing components that interact with each other to accomplish a higher-level process [44]. This software design approach leverages the flow of messages between loosely coupled services to accomplish business processes. In this architecture, each service belongs to a distinct domain or bounded context and is assigned a specific role with limited responsibilities within that domain. The responsibility of each domain is to process and manage the relevant data and communicate any changes to other domains in a seamless manner. Also, it facilitates a decentralized approach to processing information, enabling each domain to focus on its specialized tasks and improving overall system efficiency [45][44]. EDA has two main topologies, the mediator and the broker [58]. The mediator topology is a valuable solution for complex events that require multiple steps to be executed. This topology is composed of four essential components: event queues, an event mediator, event channels, and event processors. As represented in Figure 4, the event flow begins with a client sending an event to an event queue. The queue 12 efforts when switching monitoring platforms or cloud providers. This vendor lock-in created compatibility issues, limiting the flexibility and scalability of telemetry solutions [57]. To overcome the previous mentioned challenges, specially the vendor lock-in, which can occur when an application is instrumented with vendor-specific instrumentation and, for some reason, the vendor needs to be changed, the cost and effort to reinstrument the whole application (with the new vendor-specific instrumentation) is greater than keeping the instrumentation, which constitutes vendor lock-in and dependency for a specific observability vendor. 2.5 OpenTelemetry The merge of two projects, OpenCensus (Google) and OpenTracing Cloud Native Computing Foundation (CNCF), brought OpenTelemetry, one of the most promising CNCF projects [19]. It is an open-source observability framework, developed to create and manage telemetry data, namely metrics, traces and logs. Its goal is to provide a standard way for developers to instrument their applications, which means, collecting and analyzing data from different parts of the system, to provide insights into the system’s performance, behaviour, and overall health, making it easier for developers to monitor and understand how their system works. [4]. One of the key benefits of OpenTelemetry is that it is designed to be extensible and personalized. This means that developers can adapt it to their specific needs, adding or removing instrumentation as needed, and integrating it with the tools and systems that they already use. This makes it easier to adopt observability practices in a way that fits with existing workflows and processes, rather than requiring a complete overhaul of the system [18]. Another benefit of OpenTelemetry is the common format of how observability data is collected. This is achieved by having a single instrumentation library per language, which results in a standardized data format, providing a consistent approach to capturing and transmitting telemetry data. With OpenTelemetry, developers don’t need to constantly change instrumentation and can instead focus on developing new system features [49]. In addition to the above benefits, using OpenTelemetry for observability in software systems enables an end- to-end implementation that covers the entire telemetry data management process, provides flexibility by allowing developers to choose and switch between backends, offers the ability to send data to multiple destinations in parallel through configuration, and provides a path for organizations at any stage of their observability journey [4]. One potential area for improvement in OpenTelemetry is its documentation [2]. While the platform is designed to be intuitive and user-friendly, there may be opportunities to provide more detailed documentation and guidance to developers and operations teams who are implementing and using the platform. This could include more comprehensive user guides and tutorials, as well as more active support forums and communities where users can 19 ask questions, share knowledge, and troubleshoot issues. Additionally, there may be opportunities to provide more streamlined and accessible documentation for specific use cases or integration scenarios, to help users integrate OpenTelemetry with their existing systems [2]. Overall, OpenTelemetry is an important tool for achieving observability in modern software systems. By simplifying the process of monitoring and analyzing complex systems, it helps developers to detect and diagnose issues before they become serious problems [4]. 2.5.1 Signals In the domain of modern software systems, achieving robust observability has become a paramount concern for software engineers and developers. OpenTelemetry, a prominent open-source project, has emerged as a versatile solution to this challenge, empowering developers to harness various signals, including logs, traces, and metrics, to gain profound insights into their applications’ behaviour and performance [4]. First of all, logs, in their essence, serve as a historical record of events and activities within an application. With OpenTelemetry, developers can seamlessly instrument their code, sprinkling it with strategically placed log statements that capture crucial information. These logs offer a window into the heartbeat of the application, capturing noteworthy events, errors, and user interactions [4]. When employing OpenTelemetry’s logging capabilities, engineers can customize log formats and levels, ensuring the right balance of verbosity for different stages of development and production. Logs become the chronicles of the application’s journey, enabling analysis, debugging, and performance optimization [4]. In the world of distributed systems, understanding the flow of operations across various components is an intricate puzzle. OpenTelemetry tackles this challenge with its powerful tracing mechanism. By instrumenting code to generate trace spans, developers can piece together the complex web of interactions between services [4]. Each span represents a unit of work or a request, forming the building blocks of comprehensive traces. Open- Telemetry’s distributed tracing allows engineers to connect the dots and visualize the end-to-end journey of a request as it traverses multiple services. Armed with these insights, teams can identify bottlenecks, uncover latency issues, and conduct efficient root cause analysis, enhancing the resilience and performance of their distributed systems [4]. In the quest for real-time monitoring and operational insights, OpenTelemetry offers a robust metrics instrumentation approach. Metrics provide a quantitative view of system health and performance, capturing vital statistics such as Central Processing Unit (CPU) usage, request rates, and error occurrences [4]. By defining metric instruments and updating them with relevant data, engineers obtain an empirical understanding of their applications’ resource utilization and behaviour. These metrics become essential guides for capacity 20 planning, aiding in the optimization of resource allocation and ensuring the smooth scaling of services [4]. Combining the three signals of OpenTelemetry enables to answer three important questions. First, metrics allow to answer if there is a problem. Second, traces make it possible to know where is the problem. Third, logs are able to answer what is the problem. Understanding if a problem exists, where is the problem located and what is causing the problem allows to have precise insights about the system [22]. In conclusion, as software landscapes evolve and complexities mount, OpenTelemetry signals emerge as beacons of insight and empowerment. Logs, traces, and metrics, interwoven harmoniously, unlock the doors to observability, equipping developers with the tools to demystify the intricacies of their applications. In the pursuit of excellence, OpenTelemetry’s offerings pave the way for more resilient, efficient, and user-centric software systems [4]. 2.5.2 Instrumentation In the pursuit of enhancing observability within complex systems, instrumentation plays a crucial role, enabling engineers to gain insights into the internal state and performance of applications [9]. This section examines the approaches, benefits, and comparisons between manual and automatic instrumentation, shedding light on their respective significance in the domain of OpenTelemetry and observability. Manual instrumentation involves the deliberate and strategic placement of code annotations within the application’s source code. These annotations, often referred to as instrumentation points, are meticulously crafted to capture relevant data points, such as execution times, resource utilization, and custom business metrics. Engineers have fine-grained control over what data is collected and how it is presented, tailoring observability to specific use cases [9]. One of the notable advantages of manual instrumentation is its precision. Engineers can target critical sections of code, enabling the collection of granular data. Additionally, manual instrumentation offers the flexibility to adapt to unique project requirements, allowing the incorporation of domain-specific metrics. Furthermore, the explicit nature of manual instrumentation aids in reducing overhead, as data collection focuses only on essential aspects [4]. Despite its precision, manual instrumentation can be time-consuming and error-prone. Writing and maintaining instrumentation code requires substantial effort, especially in large-scale projects with numerous components. Moreover, manual instrumentation may lead to inconsistencies and omissions, hindering a holistic view of the system [9]. In contrast, automatic instrumentation seeks to alleviate the challenges posed by manual approaches. Leveraging cutting-edge tools and frameworks, automatic instrumentation dynamically injects instrumentation code into 21 the application during runtime. This technique aims to minimize manual intervention while achieving broader observability coverage [9]. The key advantage of automatic instrumentation lies in its ease of deployment and maintenance. With automated tools, engineers can swiftly instrument entire applications, sparing valuable time and effort. This widespread coverage ensures comprehensive observability, encompassing various components and services within the system. Furthermore, automatic instrumentation can adapt to dynamic environments, accommodating changes in the application without manual adjustments [9]. However, while automatic instrumentation excels in efficiency, it may lack the precision afforded by manual methods. The automated nature of instrumentation may lead to the collection of excessive data, potentially causing performance overhead [57]. Engineers may also face challenges in fine-tuning automatic instrumentation to suit specific use cases, as the tooling might not always align perfectly with unique project requirements [9]. The choice between manual and automatic instrumentation hinges on the trade-off between precision and ease of implementation. Manual instrumentation provides unparalleled control over data collection, making it ideal for projects with specific, tailored observability needs. On the other hand, automatic instrumentation excels in simplicity and scalability, proving beneficial for large-scale systems with dynamic architectures. In practice, a hybrid approach may offer the best of both worlds. By strategically combining manual and automatic instrumentation, engineers can strike a balance, enhancing the precision of manual methods where necessary and using automated techniques to achieve broad coverage and reduce operational overhead [9][57]. Overall, in OpenTelemetry and observability domains, instrumentation emerges as an essential tool pillar, enabling engineers to acquire valuable insights into system behaviours. While manual instrumentation offers precision and customization, automatic instrumentation provides efficiency and scalability. By understanding the strengths and limitations of each approach, developers can make informed decisions to elevate the observability of their systems and drive continuous improvement in performance and reliability [9]. 2.5.3 Collector The OpenTelemetry Collector offers a vendor-agnostic implementation to capture telemetry data. It serves as a central repository, responsible for receiving, processing and exporting telemetry data, regardless of the tools sending the data [21]. In addition, it removes the need to run and maintain multiple agents or even collectors in order to support specific data formats to multiple vendors [20]. Some core objectives the collector fulfills are having a default configuration with support for popular protocols, high stability and performance under varying configurations and loads, exemplifying an observable service, capacity 22 to customize without touching the code, and having a single codebase. [20]. The collector is composed by receivers, processors, exporters and a service section that includes pipelines. Receivers, like the name suggests, are responsible for receiving telemetry data. It has the ability to receive data from multiple sources and in multiple formats. The collector supports over forty different types of receivers, and once it receives all the telemetry data it changes the data to a standard format named OpenTelemetry Protocol (OTLP) [57]. Processors are the components in between the receivers and exporters, which pre-process data before it is exported or help ensure that data makes it through a pipeline successfully [4][57]. Finally, exporters are used to export the telemetry data to an observability backend, after the processing of the telemetry data is finished [4]. Currently, there are many vendors that support OTLP natively and the tendency is to increase. It is possible to convert telemetry into a single format, having multiple exporters. It is also possible to have multiple vendor simultaneously, without conflict and allowing for a variety of observability vendor choices [57]. The service section is used to configure which components defined in receivers, processors and exporters are enable, through pipelines. Pipelines are conceived by a YAML Ain’t Markup Language (YAML) configuration file and consists of a set of receivers, processors and exporters. Each one of these must be defined in the configuration outside of the service section to be included in a pipeline. [4][57]. 2.6 Comparison OpenTelemetry vs Vendor-specific Agents Two common approaches to instrumenting and collecting telemetry data for observability are OpenTelemetry and vendor-specific agents. OpenTelemetry offers a neutrality approach to observability, which means that it is possible to choose and change observability tool as needed and wanted [9]. While vendor-specific agents can represent a vendor lock-in into the vendor’s ecosystem, making it difficult to switch to a different observability platform in the future. OpenTelemetry’s learning curve can represent a challenge, since configuring and instrumenting every component to get a well-functioning environment is not an easy task. On the other hand, vendor-specific agents represent a simpler approach in this field, being easier to set up and use. About the support given to each of the two approaches, OpenTelemetry’s open-source nature made a very collaborative community, being this community the main support for resolving issues. Apart from that, vendorspecific agents have the support from the vendor itself, which can be valuable for troubleshooting. One important 23 aspect to mention is that OpenTelemetry is an open-sourced tool, so it comes with no costs, while vendor-specific agents may come with licensing costs. Regarding technological constraints, OpenTelemetry is a community-driven project, which means that the list of organizations that natively support OpenTelemetry is growing and the tendency is to keep growing. Yet, vendorspecific agents represent a more specific but precise approach, they might lack some compatibility features with some important programming languages or frameworks, but go beyond in those who have compatibilities with. So, OpenTelemetry can lack in particular features the vendor-specific agents already has but, supports a wider range of programming languages, frameworks, or emerging technologies. Concluding, both of the approaches have their advantages and disadvantages and opting for one or another is a complex task that depends on the goal. If the goal is to have a standard approach that works for a wide range of technologies, OpenTelemetry is the best answer. In contrast, if the goal is to have a more specific approach, vendor-specific agents are the correct answer. 2.7 Considered observability vendors This section presents the observability vendors studied and considered for the thesis purpose. It is important to get some insights about the observability tools in study, such as their capabilities, and the advantages and disadvantages of their usage. Apart from the researched information it was possible to establish a contact with the support of each one of the vendors and gather more details about their product. It is also important to mention that some of the studied observability vendors were already being investigated by Bosch and some were added to the study by the author of the present thesis for being popular and widely used software vendors of observability. Jaeger To track down problems with distributed systems, many companies use the open-source Jaeger distributed tracing system. It was developed by Uber Technologies, Inc. and is currently a part of the CNCF, a reputable group that encourages and supports the usage of open-source software in cloud computing. The Jaeger client library, Jaeger agent, and Jaeger collector are some of the essential parts that make up the Jaeger system. Together, these parts may collect and store trace data, which the Jaeger UI can then use to visualize and analyze [29]. Essentially, Jaeger offers a way to track requests as they move through a large network of microservices. It collects trace data across the system, including at the entry and exit points of each microservice, and aggregates this data into a single view that can be used to comprehend the flow of requests and spot bottlenecks or other 24 problems that might be causing latency or other issues [29]. Jaeger’s capacity to support high throughput is one of its distinguishing characteristics, making it ideal for usage in production scenarios where the system may be subject to a high volume of requests. In addition, it offers sampling, which enables only a portion of requests to be recorded and examined, hence minimizing the costs associated with tracing in high-volume environments [29]. Another notable feature of Jaeger is its user interface, which offers a highly dynamic and customized way to monitor and analyze trace data. This enables users to drill down into particular areas of interest and rapidly spot patterns and trends in their system’s behaviour [29]. Support for a variety of programming languages and frameworks is also another crucial feature of Jaeger. This means that teams may continue to use their favorite tools while also taking advantage of the robust tracing capabilities offered by Jaeger. This makes it very flexible to a variety of development environments [29]. Nevertheless, Jaeger also has limitations. One of them is lacking full stack observability, since it focus only on the tracing part, not putting the same effort on metrics and logs [29]. Zipkin Zipkin is an open-source distributed tracing system used to track and troubleshoot microservices-based software. Developers can quickly detect and fix problems thanks to this system’s crucial insights on the functionality and behaviour of microservices. It gives programmers the ability to track a single request’s progress as it passes across a complex web of microservices. Developers can use this tracing to discover how long each service took to perform a task, spot bottlenecks, and track down problems [59]. Zipkin’s ability to offer distributed tracing is one of its main advantages. It is fairly simple to follow a request through the system in conventional monolithic apps. However, a single request may pass through several services in a microservices-based application, making it difficult to evaluate the system’s overall performance. Zipkin resolves this by offering developers the ability to track a request across several services, giving them knowledge of the path and performance of the entire request [59]. The capability of Zipkin to visualize the data it gathers is another important advantage. The system gathers a lot of information about each request, including how long it took for each service to perform its work, whether any mistakes occurred, and how the request moved through the system. Following that, Zipkin presents this data in an intuitive manner, enabling programmers to quickly spot any problems that require attention [59]. Last but not least, Zipkin is very adaptable and compatible with a variety of technologies. It supports a variety of programming languages, such as Python, and Java. Additionally, it can be integrated with a number of platforms 25 and frameworks, such as Kubernetes, and Docker [59]. However, Zipkin relies on traces only, which consists in a disadvantage. Also, it lacks on alerting and notification features, which are important for observability [59]. Prometheus Prometheus is an open-source monitoring and alerting tool created to give developers visibility into the functionality and performance of their applications. Developers can use this system to gather and examine metrics from numerous sources, giving them information that can help them spot problems before they become serious [42]. The capacity of Prometheus to gather metrics from a variety of sources is one of its main advantages. Developers may receive insights into the performance and health of the application and the infrastructure supporting it because of its ability to collect metrics from both sources at the application and infrastructure levels. For developers, having the ability to gather metrics from many sources is essential because it enables them to monitor the entire stack and spot problems before they have serious consequences [42]. The robust querying language, PromQL, that comes with Prometheus is another important advantage. Developers can learn more about the behaviour of their apps by using PromQL to query metrics gathered by Prometheus. This querying language is very flexible, enabling developers to run complex queries and spot patterns in the behaviour of their applications [42]. Additionally, Prometheus offers developers a robust alerting system that enables them to configure alerts based on particular metrics. These alerts can be set up to warn developers when particular thresholds are crossed, enabling them to take preventive measures before problems escalate. Any modern application’s monitoring infrastructure must include this alerting system because it enables developers to uphold high standards of availability and dependability [42]. In spite of having all these advantages, Prometheus is not capable of handling the full scope of observability, since it only deals with metrics, which consists in a disadvantage [42]. Elastic Search A reliable method for managing complicated data environments is ElasticSearch, an open-source platform for data search, analysis, and visualization. ElasticSearch is a complete data management solution that enables businesses to derive useful insights from their data thanks to its robust toolkit [14]. Elasticsearch is a distributed search engine that offers real-time search and analytics capabilities. Large amounts of data may be stored, searched for, and analyzed by users in almost real time. Logstash is a pipeline for processing 26 data that gathers, enhances, and alters data from many sources so that it is suitable for analysis and storage. Kibana, the data visualization tool, offers a simple user interface for exploring and displaying data in a variety of formats, including charts, graphs, and maps. Beats is a lightweight data shipper that provides a rapid and efficient method to send data from a number of sources to Elasticsearch and Logstash [14][13]. The scalability and flexibility of ElasticSearch are two of its main advantages. It can handle massive amounts of data and scale horizontally to handle growing demand because of its distributed architecture. Also, because of the platform’s modular structure, customers can adapt it to their particular requirements and wants. ElasticSearch currently supports a broad variety of data sources, including logs, metrics, organized and unstructured data, and more. For organizing and analyzing data in a variety of applications, including security, operations, and business intelligence, it is the perfect answer [13]. However, like many other technologies, ElasticSearch has several limitations. Setting it up and configuring it needs some technical know-how, and some users could find it complex. Nevertheless, support might not always be accessible, forcing users to rely on community forums or third-party assistance [13]. New Relic Developers can collect, store, and analyze data from their applications using New Relic, a cloud-based monitoring and troubleshooting tool. This data offers details on variables including infrastructure health, user experience, and application performance. By gathering this information, New Relic gives developers a thorough understanding of how their application behaves, enabling them to identify problems as they arise and take proactive measures to fix them [43]. The ability of New Relic to monitor apps in real-time is one of its main advantages, this implies that programmers may monitor the behaviour of their application at any time and spot problems as they appear. Since it enables developers to proactively address issues before they have an impact on end users, this real-time monitoring is crucial for maintaining high levels of availability and reliability [43]. In addition, New Relic gives developers access to a potent analytics engine that gives them deep insights into the functionality of their applications. This engine can instantly evaluate a sizable amount of data, giving programmers useful information about how their application behaves. Developers can utilize these data to find bottlenecks, enhance application performance, and enhance user experience [43]. The ability of New Relic to interface with a variety of technologies is another important advantage, it supports numerous programming languages, including Java, and Python, and it can be integrated with a variety of cloud platforms, including Amazon Web Services (AWS) and Azure. Because of its adaptability, developers may use 27 New Relic alongside their current technology stack without worrying about incompatibilities [43]. Although, New Relic also as disadvantages, one of them is the difficulty in implementing and configuring, which can result in longer deployment times [43]. Datadog Datadog is a cloud-based analytics and monitoring platform that helps developers to gather information about their system, infrastructure, and user interactions. Developers can immediately discover problems and take proactive measures to solve them when using this data to examine the performance and behaviour of the application [11]. The fact that Datadog can gather information from a variety of sources is one of its advantages. Developers can monitor the entire stack and receive insights into the performance of both the application and the infrastructure supporting it thanks to its ability to collect data from both application- and infrastructure-level sources [11]. Another important advantage is the robust analytics engine of Datadog, this engine can instantly evaluate a sizable amount of data, giving programmers useful information about how their application behaves. Developers can utilize these data to find bottlenecks, enhance application performance, and enhance user experience [11]. The flexibility of Datadog is another important advantage. Numerous technologies, including cloud platforms, databases, and monitoring tools, can be integrated with it. Because of its flexibility, Datadog may be used by developers in conjunction with their current technological stack without having to worry about compatibility issues [11]. Nevertheless, it also offers disadvantages, such as the deployment and configuration of Datadog to integrate with OpenTelemetry. [11]. Dynatrace Monitoring the performance of applications has become increasingly important in the fast-paced world of software development. Leading monitoring tool Dynatrace gives programmers real-time insights into the functionality and behaviour of their applications [12]. With the help of the cloud-based monitoring tool Dynatrace, developers may learn more about the functionality and behaviour of their applications. Developers are able to immediately discover problems and take preventative action to solve them thanks to the real-time data it offers about the performance of the application and the infrastructure that supports it [12]. Dynatrace’s capability to monitor the full stack is one of its main advantages, it can keep track of both the infrastructure and the application, giving developers a clear picture of how well their application is performing. 28 Chapter 4 Methodology 4.1 Context description In order to provide a deeper understanding of the context, the system from Bosch and it’s current state of observability are described. Regarding the system, it is a sophisticated system to leverage AI and Machine Learning, built using technologies such as Python, Flask framework, AWS, MongoDB and other AI tools. In addition, the system employs a cloud-native, microservices and event-driven architecture. Figure 9illustrates the main modules of the system, which are the ingestion, the management, and the preprocessing pipelines. Apart from these, there is also the Metadata , which is responsible for receiving messages from all other components and log them in MongoDB database. Figure 9: System’s package diagram. The ingestion pipeline manages the ingestion of data in the system through a series of selection and parsing methods. The flow of this pipeline can be resumed as the following steps, awaiting for notifications of new data 35 arriving, when the data arrives a notification is sent to the components of the pipeline, after receiving the notification that data has arrived the process of selection and parsing takes place. At the end, it is expected that the data is selected and parsed to an AWS bucket that will be useful in the next pipeline. The management pipeline main objective is to control which data will go through the preprocessing pipeline. It is also responsible for getting the data from the previous mentioned AWS bucket, in order to send it to the upcoming pipeline. The data preprocessing pipeline is responsible for cleaning and transforming data before it is sent to the final AWS bucket. In fact, raw data from multiple sources undergo a series of preprocessing techniques, in order to eliminate data inconsistencies, missing values, and to be transformed in the correct format. In the end, it is expected that the final AWS bucket only contains data that went through the preprocessing pipeline. Furthermore, it is important to mention that in parallel to the pipeline flows detailed before, the Metadata component is receiving and storing metadata in MongoDB database. This logging helps developers to understand what is happening in the system, promoting observability. Figure 10 illustrates the flow of the system described above. Figure 10: System’s sequence diagram. Concerning the current state of observability in the system, it has a vendor-specific agent already installed and being used at the present. This agent only promotes automatic instrumentation. Apart from this, the agent has multiple integrations, for example Kubernetes and AWS, that allow to gather information about these technologies. The new approach for observability should secure the information gathered by the integrations mentioned and should 36 not incorporate the use of vendor-specific agents due to the possibility of occurring vendor lock-in in the near future. 4.2 Observability concept The observability concept that has been developed is structured around a series of distinct phases, each serving as a pivotal stage in the full process. The initial phase involved attaining a comprehensive understanding of the system in question. To facilitate this comprehension, a series of meetings were strategically arranged with team members that possess an in-depth knowledge of the system’s characteristics. After obtaining a deep comprehension of the dynamics of the system, the next stage involved determining which parts of the system were the most crucial to be observed. This critical stage required additional team meetings to be scheduled in order to jointly define and rank the elements that should be included in the observability framework. Ingestion pipeline, Management pipeline, and Preprocessing pipeline are listed in order of significance according to the rating established in team meetings. Ingestion pipeline is the most important due to its major role in the system, in which there is the urge to create visibility in order to understand if the data ingested is properly imported to the system and if the pipeline is working properly. Also, it is where the interfaces of the clouds are located, making it a pivotal starting point to observe and to gather insights about the requests and responses between clouds. Management pipeline, which is the data layer of the system, is the second most critical due to the importance of observing the status of each operation within the system. The services from Preprocessing pipeline have no priority defined. The observability concept is built upon the three pillars of observability: traces, metrics and logs. Each pillar serves a distinct purpose, and together, they provide a well-structured view of the system’s behaviour. An important aspect to mention about the concept developed is the need to have a centralized and unified logging. Since there are many logs from different microservices to collect, search and analyze, the best way to deal with this is to have the logging centralized and unified in one component. Achieving this, it is now possible to correlate logs with the other pillars of observability, which will help in to diagnose issues. In addition, the ability to instrument AWS and MongoDB , as the system places a strong emphasis on these two critical technologies, is a crucial trait the new approach should have. Also, gathering information about K8s and the host is another essential capability that the observability concept should tackle. To sum up, now that the concept has been formed, it is possible to choose an observability solution that fulfills the concept designed. 37 4.3 Observability solution 4.3.1 OpenTelemetry selection With its vendor-neutral technology, OpenTelemetry appears to be a good option going forward, despite its high learning curve. This is the main reason for choosing it over vendor-specific agents. First, OpenTelemetry’s neutrality makes it possible to avoid vendor lock-in, which is essential for attaining observability both now and in the future. Second, OpenTelemetry is a continuously expanding project with a lot of potential for success in the near future because it is backed by an open-source community that has made numerous contributions in the past two years. Third, OpenTelemetry offers connectors with a variety of orchestration systems and cloud platforms. Fourth, OpenTelemetry has instrumentation libraries for a variety of frameworks and programming languages, enabling end-to-end insight into the whole request or response path. Lastly, there is no expense because OpenTelemetry is an open-source initiative. In conclusion, applying OpenTelemetry or a vendor-specific agent requires different amounts of work. Reinstrumenting the system will need more work if, for instance, vendor-specific agents are chosen as the solution and a vendor change becomes necessary later on. However, if OpenTelemetry is the answer, all that needs to be done is the initial setup and configuration of OpenTelemetry. In light of these two options, the second response is the appropriate one. 4.3.2 OpenTelemetry Collector selection The agent deployment pattern has been selected as the method for OpenTelemetry Collector deployment. This design is shown in Figure 11. It includes instrumenting the application with OpenTelemetry SDK and utilizing OTLP to enable the collection of telemetry signals. Next, the OTLP exporter is used to deliver these signals to the desired observability vendor(s). Figure 11: OpenTelemetry Collector agent deployment diagram. The collector’s unique and centralized component for gathering, analyzing, and exporting telemetry data is one of the primary arguments in favor of using it. Furthermore, the OpenTelemetry Collector can gather telemetry from 38 numerous sources and export it to various locations, making it vendor-neutral (supporting multiple vendors), which increases flexibility. This allows for the possibility to save time and costs because there is no need to reinstrument or modify the instrumentation in the event that switching vendors is necessary. Additionally, the fact that the collector is compatible with many instrumentation libraries enables it to handle a wide range of programming languages, enabling it to either travel the entire path of the request or collect telemetry data from an application written in various languages (which is possible in a microservices architecture approach). 4.3.3 OpenTelemetry Understanding how OpenTelemetry may be integrated into the current infrastructure is crucial in the early stages. The most crucial parts of the system are summarized in Figure 12, including the appropriate application to be instrumented, the OpenTelemetry framework and toolkit, and the vendors (responsible for viewing the telemetry data). Figure 12: System overview diagram. About OpenTelemetry, three components were used for the instrumentation: API,SDK, and Collector. Since the already presented applications is developed in Python, the OpenTelemetry instrumentation tools used to make the instrumentation are also in Python. Figure 13 illustrates the components used in the implementation of Open- Telemetry. Figure 13: OpenTelemetry components. The API is a set of specifications and interfaces that establishes the norm for telemetry data collection. This API is compatible with a variety of observability vendors and is vendor-neutral. It is in charge of transporting the libraries and packages required for the instrumentation and providing a standardized method for instrumenting the 39 code. Additionally, by abstracting away the exact implementation details of how telemetry data is acquired and communicated, it provides a uniform interface for instrumenting the code. The SDK is a collection of tools and libraries that offers the API’s implementation. It supports the appropriate setup for each programming language and provides different components to assist with telemetry data collection and export, making it adaptable and available for a variety of development settings. To conclude, telemetry data is received, processed, and exported using the Collector. 4.3.4 OpenTelemetry Collector Receivers, processors, and exporters are essential parts for the OpenTelemetry Collector to function, as shown in Figure 14. These components must be enabled in the service section after configuration. Figure 14: OpenTelemetry Collector components. Receivers allow telemetry data to be received and stored in the collector. The OTLP receiver, which supports receiving data via two protocols, Google Remote Procedure Call (gRPC) or HTTP, utilizing OTLP format, is a must-have receiver. The hostmetrics receiver, which enables scraping metrics from the host system, is another crucial receiver to have. The processors, which are used to make sure that data passes through the pipeline and is preprocessed before being sent, come next. The choice of processors in this domain was made based on those that were advised to be used, such as memory_limiter (used to prevent out-of-memory situations on the collector), batch (helps to compress data, reducing the number of outgoing connections), k8sattributes (allows to add Kubernetes (K8s) information to the telemetry data), and resourcedetection (used to detect resource information from the host, in this case, AWS information). Exporters must then send data to the selected vendors. The gRPC OTLP exporter is used to provide data to an endpoint so that the selected vendor can consume it. It is assumed that this component will create a connection with the vendor, often using an endpoint and a secret token that the vendor will supply. A study of observability vendors is presented in the section 4.4 regarding the selected suppliers. 40 The extensions and pipelines are lastly described in the service component. When it comes to extensions, the health_check extension is required since it may be used to test a K8s’s readiness and liveness and check the collector’s health. Receivers, processors, exporters, and extensions are enabled in the pipelines (based on the preceding configuration work). Traces, metrics, and logs are three different sorts of pipelines that can be established. It’s vital to remember that even if a component is configured but not defined in the service section, it will not be used, also, receivers, processors, and exporters can be reused across several pipelines. 4.3.5 Instrumentation The system’s instrumentation makes it possible to provide information about how it works. Additionally, automatic and manual instrumentation are two types of instrumentation. It is believed that having two forms of instrumentation is advantageous since it provides a more comprehensive and personalized instrumentation. For instance, a trace from the automatic instrumentation could not provide enough details about a component, but the manual instrumentation can quickly tackle this providing the necessary details. One method is automatic instrumentation, which employs a Python agent to collect telemetry data from libraries and frameworks without the need for any programming. Additionally, two packages — the opentelemetry-distro package, which installs the API and SDK, as well as the opentelemetry-instrumentation package — allow for automatic instrumentation. Both packages provide automatic application instrumentation without the requirement for any kind of code modifications. A TracerProvider , a BatchSpanProcessor , and an OTLPSpanExporter are automatically configured (without writing any code) after installing the opentelemetry-distro package. In order to apply automatic tracing instrumentation, the opentelemetry - instrumentation library automatically discovers packages utilized by the application. For example, the system interacts with the MongoDB database through the Pymongo package, so the opentelemetryinstrumentation-pymongo is a much needed library to instrument and trace all the requests and responses. However, it is important to note that instead of having the general opentelemetry-instrumentation library searching for the technologies used by the system, it is possible to go beyond and install specific packages related to the specific technologies used by the system The term for this strategy is Programmatic instrumentation. Programmatic instrumentation only needs a small amount of new system code. Using the previous mentioned example, it is necessary to initialize the instrumentor using PymongoInstrumentor() and the method instrument() which automatically instruments requests from MongoDB , after downloading the opentelemetryinstrumentation-pymongo package. With capture_statement=True as an input, this function can be used to capture database queries, as seen in Code Snippet 1. 41 PymongoInstrumentor().instrument(capture_statement=True) Code Snippet 1: Pymongo instrumentation. Other libraries, such as opentelemetry-instrumentation-flask , opentelemetry-instrumentation-requests , opentelemetryinstrumentation-boto3sqs , opentelemetry-instrumentation-botocore , and opentelemetry-instrumentation-urllib3 , were also used to track requests and responses. The modus operandi for utilizing these libraries consists of initializing the instrumentor first, followed by the use of the instrument() function. On the other hand, manual instrumentation enables the addition of code to the program, which is helpful to acquire precise data regarding the interactions and behaviour of the system. Code Snippet 2represents the manual technique to begin gathering traces. It is essential to initialize the TracerProvider() in order to obtain traces and to create the OTLPSpanExporter()) and the BatchSpanProcessor() in order to create and export spans. tracer_provider =TracerProvider() processor =BatchSpanProcessor(OTLPSpanExporter()) tracer_provider.add_span_processor(processor) Code Snippet 2: Starting code to manually collect traces. Additionally, the creation of spans, a single operation within a trace, enables the instrumentation of a very particular piece of code. Uploaded_file_to_bucket span is shown in Code Snippet 3. with tracer.start_as_current_span("uploaded_file_to_bucket"): Code Snippet 3: Span names ” uploaded_file_to_bucket ”. Furthermore, the Code Snippet 4demonstrates the manual method of beginning to gather metrics. First, create aPeriodicExportingMetricReader() and an OTLPMetricExporter() to read and export metrics, respectively. Then, using the earlier-created reader, initialize the MeterProvider(). It is significant to note that, despite the implementation of the manual method of metrics collection, it is not currently in use due to time constraints. reader =PeriodicExportingMetricReader(OTLPMetricExporter()) metric_provider =MeterProvider(metric_readers=[reader]) Code Snippet 4: Starting code to manually collect metrics. 42 Additionally, Code Snippet 5illustrates how to begin collecting logs manually. Apart from the fact that the Python implementation of the OpenTelemetry Logs SDK is yet to be stable, it is possible to test it out and actually collect logs onto the collector. To achieve it, the LoggerProvider(), the OTLPLogExporter(), and the BatchLogRecordProcessor(), are all initialized. The processor and exporter can then be added to the provider using the add_log_record_processor() method and the configured LoggerProvider(). Final step: using LoggerHandler(), a handler is built, its level and logger_provider are set, and it is attached to the root logger. logger_provider =LoggerProvider() set_logger_provider(logger_provider) exporter =OTLPLogExporter() logger_provider.add_log_record_processor(BatchLogRecordProcessor(exporter)) handler =LoggingHandler(level=logging.NOTSET, logger_provider=logger_provider) logging.getLogger().addHandler(handler) Code Snippet 5: Starting code to manually collect logs. 4.4 Vendors These observability vendors are Jaeger, Zipkin, Prometheus, Elastic Search, New Relic, Datadog, Dynatrace, Grafana, Splunk, and AppDynamics. They are also the ones covered in section 2.7. Some of the vendors chosen were previously being investigated by Bosch, while others were included because they offered native support for OpenTelemetry and because they are widely used and popular. The requirements that the observability tool should collect were chosen after investigation with the development team. The requirements are deterministic, indicating what the tool is or is not able to achieve. The requirements are also utilized to select among the many observability choices taken into account. As a developer I want: 1. to have a product from an observability vendor that support logs, so that I can analyze log data; 2. to have a product from an observability vendor that support metrics, so that I can measure the system’s performance; 3. to have a product from an observability vendor that support traces, so that I can troubleshoot issues; 43 4. to have a product from an observability vendor that retains data, so that I can ensure the data is stored; 5. to have a product from an observability vendor that provides an intuitive visualization of telemetry data, so that I can have a user-friendly experience; 6. to have a product from an observability vendor that has alerts and notifications, so that I can have a faster response time; 7. to have a product from an observability vendor that has built-in integrations with AWS and MongoDB, so that I can store the data; 8. to have a product from an observability vendor compatible with OpenTelemetry, so that I can have a standardized way of collecting telemetry. It is now feasible to select products from the observability software vendors that meet the deterministic requirements. In order to do this, a table is utilized to better organize and visualize the possibilities, specifications, and outcomes. The deterministic requirements are arranged in columns, while the observability vendors are arranged in rows. The requirements utilized and the vendors used are both listed in the rows and columns of Table 1. Finding one of two values — ”1” if the tool satisfies the requirement, or ”0” otherwise — for each table element is the goal. In order to conduct this kind of evaluation, a study is carried out, with the help of the team, to gather the data required to determine whether or not the vendors meet the specified requirements. The score, which is the total of all the requirement values, is shown in the table’s last row. As a result, it is anticipated that every vendor will have a score, and the ones that satisfy every condition will be the candidates for moving forward with the study. The vendors that meet every condition are Elastic Search, New Relic, Datadog, Dynatrace, Grafana, Splunk, and AppDynamic, as indicated in Table 1. However, a strategy for choosing between the vendors is still necessary. The solution found is to use a Multiple Criteria Decision Making (MCDM) method, which involves difficult decision-making scenarios where several criteria must be taken into account simultaneously. 44 Criterion Criterion Usability Learning curve Integrity Scalability Unified solution Official documentation Community support Reliability Cost Maintenance effort Implementation effort Integration Visualization Absolute importance (Wabs) Weighting [%] Relative importance (Wrel) Ranking R1Usability 2 2 2 2 2 2 2 2 0 2 2 2 22 14.1 0.9 2 R2Learning Curve 0 2 2 2 0 2 2 2 0 2 2 2 18 11.5 0.8 4 R3Integrity 0 0 0 0 0 2 2 2 0 0 1 0 7 4.5 0.3 9 R4Scalability 0 0 2 2 0 2 2 2 0 2 2 2 16 10.3 0.7 5 R5Unified solution 0 0 2 0 0 2 2 2 0 2 2 2 14 9.0 0.6 6 R6Official documentation 0 2 2 2 2 2 2 2 0 2 2 2 20 12.8 0.8 3 R7Community support 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0 0.0 13 R8Reliability 0 0 0 0 0 0 2 0 0 0 0 0 2 1.3 0.1 12 R9Cost 0 0 0 0 0 0 2 2 0 0 0 0 4 2.6 0.2 11 R10 Maintenance effort 2 2 2 2 2 2 2 2 2 2 2 2 24 15.4 1.0 1 R11 Implementation effort 0 0 2 0 0 0 2 2 2 0 2 1 11 7.1 0.5 7 R12 Integration 0 0 1 0 0 0 2 2 2 0 0 0 7 4.5 0.3 9 R13 Visualization 0 0 2 0 0 0 2 2 2 0 1 2 11 7.1 0.5 7 156 100 Table 3: Paired comparison and weighting definition. It is necessary to evaluate each observability vendor criterion in order to finish the WDM. The assessment value (A) is then multiplied by the weight previously specified in this section for each criterion, and the sum of all values results in the final evaluation for each vendor, as shown in Equation 4.3. Evaluation =∑(W×A)(4.3) 51 Chapter 5 Results and Discussion 5.1 Weighted Decision Matrix Before analyzing the findings, it is critical to keep in mind that two of the criteria, namely the community support and cost criteria, do not have an impact on the final assessment of the observability vendors (described in the section 4.4). Additionally, the OpenTelemetry Demo enables configuration of all the observability providers under consideration, enabling quick hands-on time with each vendor and streamlining the evaluation. It’s also critical to realize that the evaluations are based on the author’s personal interactions with each vendor of observability. Table 4displays the criteria, their assigned weightings, the assessments given to each criterion, and the product of the weighting and assessment for each criterion. 52 Elastic Search New Relic Datadog Dynatrace Grafana Splunk AppDynamics Criterion W A W ×A A W ×AAW×AAW×A A W ×A A W ×A A W ×A Usability 14.1 3 42.3 3 42.3 3 42.3 3 42.3 3 42.3 3 42.3 3 42.3 Learning Curve 11.5 3 34.5 2 23.0 2 23.0 2 23.0 2 23.0 2 23.0 2 23.0 Integrity 4.5 3 13.5 3 13.5 3 13.5 3 13.5 3 13.5 3 13.5 3 13.5 Scalability 10.3 3 30.9 2 20.6 3 30.9 3 30.9 3 30.9 3 30.9 3 30.9 Unified Solution 9.0 3 27.0 3 27.0 3 27.0 3 27.0 1 9.0 3 27.0 3 27.0 Official Documentation 12.8 3 38.4 3 38.4 3 38.4 3 38.4 3 38.4 3 38.4 3 38.4 Community Support 0.0 3 0.0 2 0.0 2 0.0 3 0.0 2 0.0 2 0.0 2 0.0 Reliability 1.3 3 3.9 3 3.9 3 3.9 3 3.9 3 3.9 3 3.9 3 3.9 Cost 2.6 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 Maintenance Effort 15.4 3 46.2 3 46.2 3 46.2 3 46.2 3 46.2 3 46.2 3 46.2 Implementation Effort 7.1 2 14.2 2 14.2 2 14.2 2 14.2 2 14.2 1 7.1 1 7.1 Integration 4.5 3 13.5 3 13.5 3 13.5 3 13.5 3 13.5 3 13.5 3 13.5 Visualization 7.1 3 21.3 3 21.3 3 21.3 3 21.3 3 21.3 3 21.3 3 21.3 Evaluation - - 285.7 -263.9 -274.2 -274.2 -256.2 -267.1 -267.1 Table 4: Evaluation results The evaluation rating (in descending order) is Elastic Search, Datadog, Dynatrace, Splunk, AppDynamics, New Relic, and Grafana, as shown in Table 4. In addition to the ranking, it is significant to remember that picking a vendor is not a commitment because OpenTelemetry has a neutral stance and no vendor lock-in, making it feasible to switch vendors in the future. With a score of 285.7, Elastic Search stands out as the highest rated provider and the one chosen to display the telemetry data. This vendor is the only one with a score of 3 for the learning curve criterion, which is significant. This is because the creator of this work already had some familiarity with the tool, making her learning effort inferior to all the others. The evaluation of the learning curve is where Datadog or Dynatrace differs most from Elastic Search, both of which obtained a score of 274.2. Despite the fact that Datadog and Dynatrace both received the same grade, the author would choose Datadog over Dynatrace because of its user interface’s excellent intuitiveness. Due to their installation effort, Splunk and AppDynamics are scored lower than the earlier mentioned companies, at 1. According to the author’s experience, integrating both vendors with OpenTelemetry presents a number of difficulties. Because it does not scale as well as the other suppliers, New Relic has a rating of 263.9. The tool exhibits some flaws as the load is increased, based on the author’s experience with it. Because of this, it has a lower scalability score than the other providers. The vendor with the lowest rating is Grafana. According to the author, this vendor suffers from the lack of a unified solution in the research, which also hinders the implementation process because it is difficult to configure logs, metrics, and traces. It is significant to remember that choosing a vendor depends heavily on the pricing. However, this criterion is not taken into account in this study for the reasons described before. Additionally, it’s important to keep in mind that results may vary depending on the cost. The choice of vendors is another crucial issue that has to be raised. As was previously indicated, several of 53 the suppliers were already being investigated by Bosch, and none of the seven vendors taken into consideration in the WDM are open-source in order to meet the specifications established for the observability tool. Although these open-source suppliers were disregarded during the study, this does not imply that an observability pipeline cannot be implemented using just open-source technologies. It is also crucial to remember that the OpenTelemetry Demo can be utilized to test out all of the suppliers under consideration in addition to more. It is possible to duplicate the study (changing the criterion to suit the demands) and choose which observability tool to employ once the desired suppliers have been incorporated. However, it is anticipated that some difficulties will inevitably come up when connecting the suppliers with OpenTelemetry. However, the community supporting OpenTelemetry and the assistance from the suppliers are both available to help. 5.2 OpenTelemetry The display of the telemetry data in Elastic Search is what allows OpenTelemetry to provide its results. To demonstrate that it is possible to see the entire path of a particular request or answer, traces are presented. Additionally, the supplied traces feature both automatic (programmatic) and manual instrumentation, as described in the section on 4.3.5. The manual span produced by the code displayed in Code Snippet 3is shown in Figure 15. As can be seen, the manually generated span allowed for the lifecycle tracing of each operation, which included a few calls to the MongoDB database, a HTTP GET method to an AWS S3 bucket, and Amazon Simple Queue Service (SQS) transactions. Figure 15: Uploaded_file_to_bucket span. In addition, the development team needs information about each operation inside the Uploaded_file_to_bucket period. For instance, the HTTP method GET, as displayed in Figure ”ref”http, contains details about the request 54 method and the response status code. Figure 16: Details about the HTTP method GET. Additionally, as previously explained, programmable instrumentation is crucial to the instrumentation. It enables the approach shown in Figure 1to be utilized to capture the database statement. The query made to the MongoDB database to locate the required information is shown in Figure 17. For reasons of confidentiality, the question had to be obscured. Figure 17: Details about the MongoDB database request find. The SQS transactions also provide significant data. Figure 18 provides an illustration of the information used. For privacy purposes, the cloud.account.id has been blurred. Figure 18: Details about the SQS transactions. Another manually produced span is shown in Figure 19. In this instance, the full span lifecycle consists of a manual span named kognic_import_open_label_file , some calls to the MongoDB database, a HTTP GET method for data retrieval, and a HTTP POST method for authentication. 55 Figure 19: Kognic_import span. The addition of a child span within a parent span, where the parent span is kognic_import_span and the child span is kognic_import_open_label_file , is the key distinction between this span and the span depicted in Figure 15. Sharing context propagation between spans, which entails correlating both spans and connecting them with the trace, allows for this to be accomplished. By sharing the same context, this technique enables the addition of a child span (representing a suboperation) to a parent span (representing the full operation), enabling the span to gain end-to-end visibility over its entire existence. Furthermore, it is simple to identify when a particular transaction inside a trace fails. Figure 20 displays an illustration of a S3.HeadObject operation error. Figure 20: Failure example. As previously indicated, manual metrics collection is available but is not currently in use owing to time restrictions. However, measurements can be gathered automatically. The host metric, which is extracted from the host system, is an illustration of this kind of measure. An illustration of these metrics is shown in Figure 21, where each graph corresponds to a host and the data reveal the proportion of CPU time the process has used since the last event. This value, which varies from 0 to 100%, is normalized by the quantity of CPU cores. 56 Figure 21: CPU metric from hosts. Regarding logs, Figures 22 and 23 demonstrate that it is possible to compile logs from several services inside a single centralized place, despite the fact that OpenTelemetry Logs SDK is not yet stable in Python. Figure 22: Logs example from data_importer service. 57 Figure 23: Logs example from labeling_bridge service. The blurred parts in Figure 22 and Figure 23 are due to confidentiality concerns. OpenTelemetry is used to complete this thesis’ primary objective, which is the implementation of an observability concept. It can be said that the system is dotted with observability after running OpenTelemetry on it and attaining the full scope of observability (traces, metrics, logs). OpenTelemetry is a valid method to observability, taking into account the present and future of the notion, even though it needed some time to study and get comfortable with. As a result of its creative concept and high value, OpenTelemetry is proven to be one of CNCF most promising initiatives. One of its significant advantages, which is supported by this thesis, is that it collects and exports telemetry data in a standardized manner, enabling users to switch suppliers and have the data visualized more quickly and easily. This demonstrates how well-known and well-liked OpenTelemetry is in the DevOps community. When tracing is implemented in the system, it is simple to find and debug the source of errors (Figure 20). Traces are crucial to offer end-to-end visibility of a specific request or response. Traces are crucial for revealing crucial details about each process. Examples of the specifics of each operation are shown in the figures 16,17, and 18. It’s also crucial to keep in mind that you may add more information to the traces by choosing a range and using the set_attributes method, which enables you to add any required information to it. Apart from the fact that the manually created metrics are not used, automatically generated metrics also make it possible to determine whether the system is operating normally and there are no issues interfering with it. An illustration of this kind of statistic is shown in Figure 21. The measurements that were gathered have certain restrictions as well. The metrics are scraped and gathered by the OpenTelemetry Collector, however only the host metrics are shown in Elastic Search. Future research may need to solve this problem. The OpenTelemetry Collector centralizes logs, making it simple to edit them as necessary. This is crucial because decentralized logs are challenging to change. The logs for two distinct services are displayed in Figures 22 and 23, 58 which are both kept in one central location. OpenTelemetry has been integrated, but there are still certain issues that need to be resolved. The white spaces between several operations in tracing are something that the thesis’s author noticed. Figure 19, for instance, shows that there is a space between the conclusion of the HTTP GET method and the start of the MongoDB call. Calculations in mathematics can sometimes be used to determine if something is missing. For instance, the manually created span kognic_import_open_label_file executes in 394ms, but if the operations that make up that span are subtracted—specifically, the HTTP GET method (222ms), the find call (2ms), and the update call (11ms)—it can be inferred that 159ms pass without any operations. This observation could lead one to the logical conclusion that some procedures lack the required instrumentation. Given this situation, it makes sense to rectify these kinds of discrepancies in subsequent work in order to gain a better and more precise understanding of the internal status of the system. The value that the community contributes to OpenTelemetry is one area that deserves attention. As was already said, OpenTelemetry is an open source project, which enables the community to participate in its growth. The creation of packages in a number of programming languages to simplify the instrumentation of the application demonstrates the value the community places on OpenTelemetry. The opentelemetry-instrumentation-pymongo package, and other packages described in the instrumentation section are just a few of the packages that are used in this thesis. Finally, I would advise using the OpenTelemetry Demo before embarking on your implementation adventure. The OpenTelemetry Demo is a very comprehensive system that will instruct developers and aid in their familiarization with the tool, its parts, and how it functions. 59 Chapter 6 Conclusions and future work 6.1 Conclusions Modern systems, especially cloud-native and microservices systems, should incorporate the concept of observability. Observability enables the ability to identify the source of issues and troubleshoot them, which addresses the difficulty in understanding the internal state and the proper behaviour of such modern systems. By developing and implementing an observability concept the primary goal of implementing an observability approach for a microservices architecture is achieved. In addition, the approach includes the usage of OpenTelemetry instead of the vendor-specific agents due to its neutral and open source nature, as well as the avoidance of vendor lock-in. Furthermore, the decision-making process of choosing a product from an observability vendor that satisfies the team’s needs is accomplished by the definition of deterministic requirements to get to know what each vendor is capable or not to do, and the usage of an MCDM method, more specifically a WDM, in which non-deterministic decision criterion are defined, in order to be weighted and then used to assess each observability vendor. At the end of the decision process, Elastic Search was chosen to consume the telemetry data, so that it is possible to visualize it. The current dissertation demonstrates the viability of OpenTelemetry as a method for observability because it takes a neutral approach, allowing for flexibility in vendor selection and the ability to save time and resources if a vendor change is necessary. In addition, OpenTelemetry is a growing and promising project because of its opensource nature, which enables the community to investigate, improve, and support the tool. To sum up, observability is essential in modern distributed and cloud systems, and OpenTelemetry is available to address the issues it raises. Moreover, the lack of documentation related to OpenTelemetry, due to being in its early stages, constitutes a challenge for developers, causing issues like longer development times, longer troubleshooting times, and possible 60