-
Notifications
You must be signed in to change notification settings - Fork 288
All spans of a trace share sampling state #443
Conversation
Signed-off-by: Prithvi Raj <p.r@uber.com>
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
==========================================
+ Coverage 84.68% 84.69% +0.01%
==========================================
Files 33 33
Lines 1502 1503 +1
==========================================
+ Hits 1272 1273 +1
Misses 168 168
Partials 62 62
Continue to review full report at Codecov.
|
Signed-off-by: Prithvi Raj <p.r@uber.com>
context.go
Outdated
s.setFlag(flagFirehose) | ||
} | ||
|
||
func (s *samplingState) resetFlags() { |
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.
func (*samplingState).resetFlags
is unused (from unused
)
Signed-off-by: Prithvi Raj <p.r@uber.com>
Signed-off-by: Prithvi Raj <p.r@uber.com>
context.go
Outdated
flagSampled = byte(1) | ||
flagDebug = byte(2) | ||
flagFirehose = byte(8) | ||
flagUnsampled = 0 |
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.
flagUnsampled
is unused (from varcheck
)
Signed-off-by: Prithvi Raj <p.r@uber.com>
context.go
Outdated
flagSampled = byte(1) | ||
flagDebug = byte(2) | ||
flagFirehose = byte(8) | ||
flagUnsampled = 0 |
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.
flagUnsampled
is unused (from deadcode
)
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.
lgtm. Looks like backwards compatible too.
context.go
Outdated
} | ||
|
||
type samplingState struct { | ||
_flags atomic.Int32 // Only lower 8 bits are used. We use an int32 instead of a byte to use CAS operations |
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.
we never use underscores for field names, what's the reason to start now?
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.
I used it to avoid a conflict with flags()
, but we can rename to ctxFlags
or sth else
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.
oic. Usually collisions are avoided by making methods public, like Flags.
Let's keep the underscore.
Signed-off-by: Prithvi Raj <p.r@uber.com>
Signed-off-by: Prithvi Raj <p.r@uber.com>
I used per-span sampling decisions to dynamically skip unimportant sub-spans (ie too short to be interesting).
"Backward compatibility" is great, yeah... |
Initial stab at sharing span state. Part of #449.
Signed-off-by: Prithvi Raj p.r@uber.com
Which problem is this PR solving?
Short description of the changes