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

Add support for activity tracing #603

Merged
merged 19 commits into from
Nov 9, 2020
Merged

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Nov 3, 2020

This adds traceparent and tracestate properties to JSON-RPC request messages to carry an activity across the wire for end-to-end activity tracing.

This allows a set of structured log files to be aggregated with a viewer like Microsoft's Service Trace Viewer to produce a cross process/machine view like this (where the green boxes are from the RPC client and the yellow boxes are from the RPC server):

image

There are a variety of other views this tool offers. The ActivityTracing_IntegrationTest test produces the log files that led to the above screenshot.

Closes #470

@AArnott AArnott added this to the v2.7 milestone Nov 3, 2020
@AArnott AArnott self-assigned this Nov 3, 2020
@codecov-io
Copy link

codecov-io commented Nov 4, 2020

Codecov Report

Merging #603 (d31f49f) into master (46701b9) will increase coverage by 0.32%.
The diff coverage is 96.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #603      +/-   ##
==========================================
+ Coverage   89.89%   90.22%   +0.32%     
==========================================
  Files          55       59       +4     
  Lines        4630     4868     +238     
==========================================
+ Hits         4162     4392     +230     
- Misses        468      476       +8     
Impacted Files Coverage Δ
src/StreamJsonRpc/MessagePackFormatter.cs 91.61% <91.39%> (-0.11%) ⬇️
src/StreamJsonRpc/Protocol/TraceParent.cs 97.87% <97.87%> (ø)
src/StreamJsonRpc/ActivityTracingStrategy.cs 100.00% <100.00%> (ø)
...StreamJsonRpc/CorrelationManagerTracingStrategy.cs 100.00% <100.00%> (ø)
src/StreamJsonRpc/Hex.cs 100.00% <100.00%> (ø)
src/StreamJsonRpc/JsonMessageFormatter.cs 91.42% <100.00%> (+0.03%) ⬆️
src/StreamJsonRpc/JsonRpc.cs 93.24% <100.00%> (+0.06%) ⬆️
src/StreamJsonRpc/Protocol/JsonRpcRequest.cs 85.71% <100.00%> (+0.60%) ⬆️
... and 3 more

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 46701b9...d31f49f. Read the comment docs.

@AArnott AArnott marked this pull request as ready for review November 5, 2020 00:17
Copy link

@kelltrick kelltrick left a comment

Choose a reason for hiding this comment

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

It all looks good, I left a few nits. The only thing I feel strongly about is that we should allow uppercase inbound hex simply because A. the standard says implementers must accept upper case hex and B. the reverse hex decoding array you have defined already to accommodates uppercase letters.

doc/tracecontext.md Outdated Show resolved Hide resolved
src/StreamJsonRpc/IActivityTracingStrategy.cs Show resolved Hide resolved
src/StreamJsonRpc/ActivityTracingStrategy.cs Show resolved Hide resolved
src/StreamJsonRpc/Hex.cs Show resolved Hide resolved
src/StreamJsonRpc/MessagePackFormatter.cs Show resolved Hide resolved
@AArnott AArnott requested a review from ankitvarmait November 7, 2020 15:34
@AArnott AArnott merged commit 9bae418 into microsoft:master Nov 9, 2020
@AArnott AArnott deleted the trace-context branch November 9, 2020 16:29
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.

Adding support for end-to-end activity tracing
4 participants