Closed githubsands closed 6 years ago
I'll make sure to size commits down in the future.
Merging #38 into master will not change coverage. The diff coverage is
52.38%
.
@@ Coverage Diff @@
## master #38 +/- ##
=======================================
Coverage 67.95% 67.95%
=======================================
Files 4 4
Lines 181 181
=======================================
Hits 123 123
Misses 55 55
Partials 3 3
Impacted Files | Coverage Δ | |
---|---|---|
tracker.go | 5.76% <0%> (ø) |
:arrow_up: |
trace.go | 100% <100%> (ø) |
:arrow_up: |
spanner.go | 84.84% <100%> (ø) |
:arrow_up: |
span.go | 91.48% <94.44%> (ø) |
:arrow_up: |
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 1b3ac61...a9cd933. Read the comment docs.
[WIP] Overall Refactor, some general changes and additions for a working distributed tracing library that are revolve around two main components. A client side transactor for making out bound requests and a server side alice style decorator for handling inbound request. A go routine is used to communicate http trackers to transactor types for outbound request.
As of now the alice style decorator has four main states that are chosen through options.
(1) Starter: To be used on edge servers. This injects a tracker and starts the spanning graph (2) Subtracer: To be used on non edge servers. Creates a new child span id from an extracted tracker and continues the spanning graph.
(3) Ender: To be used on servers that do not need to inject trackers into requests. (4) Default/Off
Changes:
spanner.go
Decoupled
Spanner
fromHTTPTracker
by injecting aSpanDecoder
into aHTTPTracker
usingfunc StartHTTPTracker
. This opened the doors to unit testHTTPTracker
individually.Changed the
Spanner
interface is to be populated with aSubTrace
andStarter
Removed all
spanner.go
details intohttpspanner.go
httpspanner.go
Many spanner components are migrated here so they can be easily differed between the spanner interface and httpspanner objects and methods.
New
func StartHTTPTracker
tracker.go
Changed:
MoneyHeader
toMoneyTraceHeader = X-Money-Trace
MoneySpansHeader
=X-Money-Span
NOTE: this is to abide by http.Set, the function does not keep capital letters. I know this may not be the same as how RDK sends X-money headers. Please comment if change needed.Removes pointer from
HTTPTracker’s
mutex.Added error handling for tracker and http functions.
NewHTTPTracker
was created to decouple a tracker creation from a Spanner’sStart
. This opened the door to individually unit test tracker methods.Changes
func Start
tofunc SubTrace
to more closely defines what this function does.func HTTPTracker
returns a httpTracker.Changes
func Spans
tofunc SpansList
so there is no confusion whether this functions purpose is spanmap objects or span strings.Changs
Lists
toSpanLists
func Map
andfunc SpansMaps
to make use ofspanMaps
.Includes
func InjectTracker
insidefunc DecorateTransactor
so trackers can be injected to outbound request.trace.go
func Result
turns aResult
object into a concatenated string of a span’s fields.Renames
SubTrace
todoSubTrace
.httpspanneroptions.go
A place where spanner options are defined.
httpspanner.go
Moves all old spanner objects here but the spanner interface.
httpspannercontainers.go
Httpspanner containers are objects that are needed to fulfill a specific httpspanner option.
httpspannerprocesses.go
Where processes are defined for each option. This was made to specifically manage the decorator's size as it grows. Each option has a container that holds its process.
http.go
func ExtractTracker
whose purpose is to quickly extract a tracker from a request.func InjectTracker
to quickly inject a tracker into a requestmigrates
simpleResponseWriter
as well as header constants.func WriteMoneySpansHeader
: writes a Span’s Result to a header.func checkHeaderForMoneyTrace
: checks if a header has aMoneyHeader
returns a bool.func checkHeaderForMoneySpan
: checks if a header has aMoneySpan
returns a bool.transactionoptions.go
Migrates
spanfowardingoptions
here. This is where future options should be placed.Other:
test coverage includes
run_test.sh
+ travis update. documentationTo do: