Skip to content

Commit

Permalink
makes samptypeProb private and movs to model spans
Browse files Browse the repository at this point in the history
Signed-off-by: afzal442 <[email protected]>
  • Loading branch information
afzal442 committed Aug 19, 2023
1 parent 457bb94 commit 84ce41e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions model/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ const (
// FirehoseFlag is the bit in Flags in order to define a span as a firehose span
FirehoseFlag = Flags(8)

samplerType = "sampler.type"
keySpanKind = "span.kind"
samplerTypeUnknown = "unknown"
samplerType = "sampler.type"
keySpanKind = "span.kind"
samplerTypeUnknown = "unknown"
samplerTypeProbabilistic = "probabilistic"
)

// Flags is a bit map of flags for a span
Expand Down Expand Up @@ -82,6 +83,8 @@ func (s *Span) GetSamplerType() string {
if tag, ok := KeyValues(s.Tags).FindByKey(samplerType); ok {
if tag.VStr == "" {
return samplerTypeUnknown
} else if tag.VStr == "probabilistic" {
return samplerTypeProbabilistic

Check warning on line 87 in model/span.go

View check run for this annotation

Codecov / codecov/patch

model/span.go#L87

Added line #L87 was not covered by tests
}
return tag.VStr
}
Expand Down

0 comments on commit 84ce41e

Please sign in to comment.