[Feature] Propagate Trace Headers into Root Span for OpenTelemetry Cross-Service Context#10808
Conversation
Summary of ChangesHello @zhanghaotong, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the tracing capabilities by implementing OpenTelemetry cross-service context propagation. It modifies the request handling pipeline to capture and utilize trace headers from incoming HTTP requests, ensuring that distributed tracing information is correctly maintained and linked across different services. This change is fundamental for better observability and debugging in a microservices architecture. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements the propagation of OpenTelemetry trace headers from incoming requests to the engine's root span, which is crucial for enabling cross-service context propagation. The changes are well-structured, adding a new field to GenerateReqInput and modifying the trace initialization logic accordingly. I have a couple of suggestions to improve performance and code clarity. Specifically, I recommend making _get_trace_headers a synchronous method and instantiating TraceContextTextMapPropagator only once at the module level to avoid unnecessary overhead on each request.
This comment was marked as outdated.
This comment was marked as outdated.
7463f29 to
d5ea9d0
Compare
c9b94c0 to
85c4f9b
Compare
|
I've implemented support for trace part2; Could you please help review this PR? @sufeng-buaa |
ok, let me take a look. |
|
@stmatengss Hi ~ Could you please help review this PR? |
Signed-off-by: zhanghaotong <zhanghaotong.zht@antgroup.com>
Signed-off-by: zhanghaotong <zhanghaotong.zht@antgroup.com>
Signed-off-by: zhanghaotong <zhanghaotong.zht@antgroup.com>
Signed-off-by: zhanghaotong <zhanghaotong.zht@antgroup.com>
ae3de59 to
99f658c
Compare
Signed-off-by: zhanghaotong <zhanghaotong.zht@antgroup.com>
d0cd27a to
7b329fd
Compare
|
LGTM. I have verified it in my machine. @ShangmingCai Could you take a look? |
|
Could you take a look at the PR when you have a moment? Thanks! @ShangmingCai |
Motivation
Propagate trace headers from upstream requests into the engine trace’s root span to enable OpenTelemetry cross-service context propagation.
Modifications
Extract traceparent and tracestate from HTTP request headers, construct a trace_headers dict, and pass it as the context when starting the request’s root span.
Checklist