Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only set send reason to span limit if it's configured #1290

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion collect/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ func (i *InMemCollector) sendExpiredTracesInCache(now time.Time) {
if t.RootSpan != nil {
i.send(t, TraceSendGotRoot)
} else {
if t.SpanCount() > spanLimit {
if spanLimit > 0 && t.SpanCount() > spanLimit {
i.send(t, TraceSendSpanLimit)
} else {
i.send(t, TraceSendExpired)
Expand Down
3 changes: 0 additions & 3 deletions collect/collect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,6 @@ func TestDrainTracesOnShutdown(t *testing.T) {

sentTraceChan := make(chan sentRecord, 1)
forwardTraceChan := make(chan *types.Span, 1)
expiredTraceChan := make(chan *types.Span, 1)

// test 1
// the trace in cache already has decision made
Expand All @@ -1793,7 +1792,6 @@ func TestDrainTracesOnShutdown(t *testing.T) {
coll.distributeSpansOnShutdown(sentTraceChan, forwardTraceChan, span1)
require.Len(t, sentTraceChan, 1)
require.Len(t, forwardTraceChan, 0)
require.Len(t, expiredTraceChan, 0)

ctx1, cancel1 := context.WithCancel(context.Background())
go coll.sendSpansOnShutdown(ctx1, sentTraceChan, forwardTraceChan)
Expand Down Expand Up @@ -1822,7 +1820,6 @@ func TestDrainTracesOnShutdown(t *testing.T) {
coll.distributeSpansOnShutdown(sentTraceChan, forwardTraceChan, span2)
require.Len(t, sentTraceChan, 0)
require.Len(t, forwardTraceChan, 1)
require.Len(t, expiredTraceChan, 0)

ctx2, cancel2 := context.WithCancel(context.Background())
go coll.sendSpansOnShutdown(ctx2, sentTraceChan, forwardTraceChan)
Expand Down
Loading