Closed githubsands closed 2 years ago
Merging #39 into master will increase coverage by
8.67%
. The diff coverage is71.12%
.
@@ Coverage Diff @@
## master #39 +/- ##
==========================================
+ Coverage 67.95% 76.62% +8.67%
==========================================
Files 4 7 +3
Lines 181 338 +157
==========================================
+ Hits 123 259 +136
- Misses 55 67 +12
- Partials 3 12 +9
Impacted Files | Coverage Δ | |
---|---|---|
span.go | 92.85% <100%> (+1.36%) |
:arrow_up: |
trace.go | 96.07% <33.33%> (-3.93%) |
:arrow_down: |
httpspannerprocesses.go | 60% <60%> (ø) |
|
httpspanneroptions.go | 64.1% <64.1%> (ø) |
|
http.go | 65.62% <65.62%> (ø) |
|
tracker.go | 69.89% <72.15%> (+64.12%) |
:arrow_up: |
httpspanner.go | 76.19% <76.19%> (ø) |
|
... and 2 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 1b3ac61...9ca03cd. Read the comment docs.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
[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
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: