-
Notifications
You must be signed in to change notification settings - Fork 369
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
chore: Add 'grpc.client.deadline' tag to track gRPC client's deadline value #2200
chore: Add 'grpc.client.deadline' tag to track gRPC client's deadline value #2200
Conversation
7e27dc6
to
08e664e
Compare
Hi @nvh0412 , Thanks for the contribution! Could you provide a positive example from spec which verify the Also please rebase the branch to the latest master to avoid failing spec in old Rubies. 😄 |
9c08280
to
f9c23a4
Compare
Thank you @TonyCTHsu , addressed. |
I was wondering whether information is accurate enough to diagnose the What would a good general default value for I am asking because when |
Fair enough, the Time object's serialised value might also affect the Datadog query in our Dashboard. Milliseconds would be better, thanks for suggesting me @TonyCTHsu, addressing. |
Please help me review this PR again, thank you. |
Codecov Report
@@ Coverage Diff @@
## master #2200 +/- ##
=======================================
Coverage 97.48% 97.48%
=======================================
Files 1043 1043
Lines 54429 54438 +9
=======================================
+ Hits 53058 53068 +10
+ Misses 1371 1370 -1
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
@@ -44,6 +44,9 @@ def annotate!(trace, span, metadata, call) | |||
host, _port = find_host_port(call) | |||
span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, host) if host | |||
|
|||
deadline = find_deadline(call) | |||
span.set_tag(Ext::TAG_CLIENT_DEADLINE, (deadline.to_time.to_f * 1000).to_i) if deadline |
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.
👋 @nvh0412, could you move the time conversion logic of deadline (from object to number) to the find_deadline
method?
I think it looks cleaner if the caller here only has to set the deadline, like so:
span.set_tag(Ext::TAG_CLIENT_DEADLINE, (deadline.to_time.to_f * 1000).to_i) if deadline | |
span.set_tag(Ext::TAG_CLIENT_DEADLINE, deadline) if deadline |
spec/datadog/tracing/contrib/grpc/datadog_interceptor/client_spec.rb
Outdated
Show resolved
Hide resolved
f7499de
to
39823d8
Compare
Hi @TonyCTHsu @marcotc I addressed your feedbacks, also squashed all commit to one, that's why I have to do a push force. Please help me review this PR again, thank you |
👋 @nvh0412
I took a deeper dive into When I tried to write test examples for For
This this would provide a human readable and interchangable format, which string comparison should also work for dashboard query. if |
I don't think So I do believe we can come up with that we don't need to handle As for the serialized value of |
If I believe I could approve the change after iso8601 format serialization 😄 . |
Addressed @TonyCTHsu , there are also some flaky tests on the master branch https://app.circleci.com/pipelines/github/DataDog/dd-trace-rb?branch=master. |
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.
@nvh0412 Thanks for the great work! 😘
What does this PR do?
resolve #2199
Motivation
I'm using Datadog tracing to methodically trace data from the whole of our internal system (Web server, gRPC, ...). As I use multi-threaded servers to run our gRPC server, hence I'm facing many DeadlineExceed exceptions from the gRPC client ruby because the thread took so long to finish its job, and the timeout setting isn't enough.
Despite talking about the solution, I want to know the value of client timeout when it sends the request to the gRPC server. In this way, I would know how many redundant thread executions are while its client call is terminated because of timeout.
So I'm adding
grpc.client.deadline
tag to track gRPC client's deadline value