Observability is important, and there is a relatively good OpenTelemetry
standard available. Various third-party components and vendors following this standard library will make exposing and integrating observability data much simpler. Today, we will talk about link tracing, a crucial metric of observability.
The GoFrame
framework is highly forward-looking. It began to continuously focus on the OpenTelemetry
standard during its draft phase and started supporting it when the OTEL
standard released an alpha
version. Currently, the Golang
implementation of OTEL
is stable. GoFrame
is among the best frameworks supporting the OTEL
standard and its implementation, implicitly providing link tracing features. Observability is also a key focus of the framework's future developments.
I. Pain Points in Project Practices
In project practices, implementing link tracing often encounters the following common pain points.
1. Components do not strictly follow the standard
Even though there is an OTEL
standard, third-party components may not adhere to it strictly. For instance, the logging and ORM
components might not strictly enforce the passing of ctx
context variables.
2. Unorganized Third-party Components
Numerous third-party components are pieced together in business projects, some of which do not support link tracing, let alone the OTEL
standard. For example, common components such as command management, configuration management, cache management, data validation, scheduling tasks, etc., do not provide the ctx
context variable transmission. Link information is lost when components used do not support link transmission.
3. Business Logic Easily Loses Links
In business projects, link tracing lacks detection mechanisms, which means it can easily be lost unintentionally during operation, such as by creating a new ctx
or passing a nil
ctx
. When strategic design encounters difficulty in tactical execution, locating issues becomes a significant challenge, especially in toB
businesses with time-sensitive support tickets.
II. Full Link Tracing in Framework
1. Unified Framework
As GoFrame
is a fully-engineered foundational framework providing the general core components needed for projects, it facilitates the unified realization of link tracing standards across foundational components effortlessly.
2. Standard Implementation
Support for the ctx
context variable is increased across the framework's core components, rigorously following the OTEL
standard to ensure smooth standard implementation.
3. Log Support
In engineering practices, logging is a critical component for link tracing. In most business scenarios, tracing and logging contents are required to diagnose and locate specific problems. The logging components of the GoFrame
framework also support and strictly follow the OTEL
standard. Hence, using the framework's logging components will automatically log link-related information.
4. Standard Detection Tool
The framework provides engineering standards detection functionality via development tools, automatically identifying link loss issues in business projects, further promoting the OTEL
standard's implementation and ensuring project quality.
5. Support for Link Transmission
Link transmission also requires unified components. The most common protocols currently are HTTP/GRPC
. Thus, the framework also provides HTTP Client/Server
and GRPC Client/Server
components to ensure link transmission. To enhance usability and ease of integration, complex underlying function details are abstracted, and this link transmission is implicitly implemented at the underlying level, making it completely transparent to the user.