-
Notifications
You must be signed in to change notification settings - Fork 933
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
Ftr/Transfer tracing context for dubbo protocol #344
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #344 +/- ##
===========================================
+ Coverage 66.88% 66.89% +0.01%
===========================================
Files 123 123
Lines 7597 7613 +16
===========================================
+ Hits 5081 5093 +12
- Misses 2024 2026 +2
- Partials 492 494 +2
Continue to review full report at Codecov.
|
common/constant/key.go
Outdated
@@ -78,6 +78,7 @@ const ( | |||
|
|||
const ( | |||
DUBBOGO_CTX_KEY = "dubbogo-ctx" | |||
CONTEXT_KEY = "context" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is that key use for ? it should add some comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not used, so I remove it.
protocol/dubbo/listener.go
Outdated
@@ -327,6 +331,22 @@ func (h *RpcServerHandler) OnCron(session getty.Session) { | |||
} | |||
} | |||
|
|||
// rebuild the context by attachment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as go lint said, the func name should be the first word of its comment.
protocol/dubbo/listener.go
Outdated
func rebuildCtx(inv *invocation.RPCInvocation) context.Context { | ||
ctx := context.Background() | ||
|
||
// actually, if user do not use any opentracing framework, it will always be error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will always be error. --> the error will always be not nil.
protocol/dubbo/listener.go
Outdated
// actually, if user do not use any opentracing framework, it will always be error. | ||
spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap, | ||
opentracing.TextMapCarrier(inv.Attachments())) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this blank line.
LGTM |
What this PR does:
We can transfer the tracing context end to end now