Skip to content
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

Merged
merged 5 commits into from
Jan 31, 2020

Conversation

flycash
Copy link
Member

@flycash flycash commented Jan 30, 2020

What this PR does:
We can transfer the tracing context end to end now

@flycash flycash requested a review from fangyincheng January 30, 2020 11:44
@codecov-io
Copy link

codecov-io commented Jan 30, 2020

Codecov Report

Merging #344 into develop will increase coverage by 0.01%.
The diff coverage is 88.23%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
protocol/dubbo/listener.go 63.24% <100%> (+1.66%) ⬆️
protocol/dubbo/dubbo_invoker.go 89.36% <75%> (-2.95%) ⬇️
cluster/cluster_impl/failback_cluster_invoker.go 78.49% <0%> (-2.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4de49ef...0e57187. Read the comment docs.

@@ -78,6 +78,7 @@ const (

const (
DUBBOGO_CTX_KEY = "dubbogo-ctx"
CONTEXT_KEY = "context"
Copy link
Member

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

Copy link
Member Author

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.

@@ -327,6 +331,22 @@ func (h *RpcServerHandler) OnCron(session getty.Session) {
}
}

// rebuild the context by attachment.
Copy link
Contributor

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.

func rebuildCtx(inv *invocation.RPCInvocation) context.Context {
ctx := context.Background()

// actually, if user do not use any opentracing framework, it will always be error.
Copy link
Contributor

@AlexStocks AlexStocks Jan 31, 2020

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.

// 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()))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this blank line.

@AlexStocks
Copy link
Contributor

LGTM

@AlexStocks AlexStocks merged commit c291d2c into apache:develop Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants