Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Add a flag for firehose mode #419

Merged
merged 3 commits into from
Aug 21, 2019

Conversation

vprithvi
Copy link
Contributor

Add 0b100 as a constant for Firehose mode and allow setting and checking
this on the span context.

fixes #417
ref jaegertracing/jaeger#1731

Signed-off-by: Prithvi Raj p.r@uber.com

Add 0b100 as a constant for Firehose mode and allow setting and checking
this on the span context.

fixes jaegertracing#417
ref #1731

Signed-off-by: Prithvi Raj <p.r@uber.com>
@vprithvi vprithvi self-assigned this Aug 21, 2019
@vprithvi vprithvi requested a review from yurishkuro August 21, 2019 19:28
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

lgtm, with a couple minor things

context.go Outdated
flagDebug = byte(2)
flagSampled = byte(1)
flagDebug = byte(2)
flagFirehose = byte(4)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could define is as the 4th bit (byte(8)), not the 3rd. Zipkin supports "undecided" sampling decision, which we might need to implement in the future (for edge proxy use cases), and it's nicer to group sampling bits together.

Copy link
Member

Choose a reason for hiding this comment

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

Also, should we add a bit of docs here to what firehose means?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can use the fourth bit.

I think we should add docs on a centralized place like the website would be better, or we would be repeating the semantic meaning in every client. (I don't think we have docs for debug flag in the clients either).

span.go Outdated
@@ -318,3 +318,8 @@ func setSamplingPriority(s *Span, value interface{}) bool {
}
return false
}

// SetFirehose sets the firehose tag on the span context
func SetFirehose(s *Span) {
Copy link
Member

Choose a reason for hiding this comment

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

EnableFirehose might be better name, as set() usually implies a value argument

span_test.go Outdated
@@ -126,6 +126,19 @@ func TestSetTag_SamplingPriority(t *testing.T) {
assert.False(t, sp1.context.IsDebug(), "debug should not be allowed by the throttler")
}

func TestSetFirehoseMode(t *testing.T) {
tracer, closer := NewTracer("DOOP", NewConstSampler(true), NewNullReporter(),
TracerOptions.DebugThrottler(throttler.DefaultThrottler{}))
Copy link
Member

Choose a reason for hiding this comment

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

throttler seems redundant here

Signed-off-by: Prithvi Raj <p.r@uber.com>
span.go Outdated
@@ -318,3 +318,8 @@ func setSamplingPriority(s *Span, value interface{}) bool {
}
return false
}

// EnableFirehose sets the firehose tag on the span context
Copy link
Member

Choose a reason for hiding this comment

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

// EnableFirehose enables firehose mode on the span context

Signed-off-by: Prithvi Raj <p.r@uber.com>
@codecov
Copy link

codecov bot commented Aug 21, 2019

Codecov Report

Merging #419 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
+ Coverage   88.44%   88.46%   +0.01%     
==========================================
  Files          55       55              
  Lines        3107     3111       +4     
==========================================
+ Hits         2748     2752       +4     
  Misses        255      255              
  Partials      104      104
Impacted Files Coverage Δ
span.go 100% <100%> (ø) ⬆️
context.go 100% <100%> (ø) ⬆️

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 e8ef996...b8197b0. Read the comment docs.

@vprithvi vprithvi merged commit 30e6256 into jaegertracing:master Aug 21, 2019
@vprithvi vprithvi deleted the add-firehose-mode branch August 21, 2019 21:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a firehose flag
2 participants