-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
链路追踪 #9
Comments
lc-1010
added a commit
that referenced
this issue
Jul 1, 2023
This commit adds a function comment for the Tracing middleware handler in the Go file internal/middleware/tracer.go. #9
lc-1010
added a commit
that referenced
this issue
Jul 2, 2023
…try' The 'opentracing-go' package has been deprecated, so this commit replaces the import paths from 'github.com/opentracing/opentracing-go' to 'go.opentelemetry.io/otel'. This ensures compatibility with the latest tracing libraries and best practices. and opentracing-go repository has been archived by the owner on May 24, 2023. It is now read-only. opentracing/specification#163 ref #9
TraceId 和SpanId 设计的参考TraceId 来将一个请求在各个服务器上的调用日志串联起来,TraceId 一般由接收请求经过的第一个服务器产生。
SpanId 代表本次调用在整个调用链路树中的位置。假设一个 Web 系统 A 接收了一次用户请求,那么在这个系统的 MVC 日志中,记录下的 SpanId 是 0,代表是整个调用的根节点,如果 A 系统处理这次请求,需要通过 RPC 依次调用 B、C、D 三个系统,那么在 A 系统的 RPC 客户端日志中,SpanId 分别是 0.1,0.2 和 0.3,在 B、C、D 三个系统的 RPC 服务端日志中,SpanId 也分别是 0.1,0.2 和 0.3;如果 C 系统在处理请求的时候又调用了 E,F 两个系统,那么 C 系统中对应的 SOFATracer RPC 客户端日志是 0.2.1 和 0.2.2,E、F 两个系统对应的 SOFATracer RPC 服务端日志也是 0.2.1 和 0.2.2 |
lc-1010
added a commit
that referenced
this issue
Jul 3, 2023
- Add tracing to API requests using a trace plugin - Configure GORM to trace SQL queries - Optimize and improve the code #9
lc-1010
added a commit
that referenced
this issue
Jul 6, 2023
- Update tracing to log request and SQL in the same log This commit adds the 'gorm.io/plugin/opentelemetry/tracing' package to enable context tracing with 'opentelemetry' for SQL queries. It also modifies the tracing implementation to include both the request and SQL in the log. The request information is now included as an attribute in the span, and the query callback function is updated to log the request, SQL, and table information. These changes improve the visibility and traceability of requests and SQL queries, providing a consolidated log for easier debugging and monitoring. #9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: