Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit bd7285d

Browse files
committed
Fixes spans counters
1 parent 8499a17 commit bd7285d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

agent/recorder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (r *SpanRecorder) sendSpans() (error, bool) {
201201
buf, err := encodePayload(payload)
202202
if err != nil {
203203
atomic.AddInt64(&r.stats.sendSpansKo, 1)
204-
atomic.AddInt64(&r.stats.spansNotSent, int64(len(spans)))
204+
atomic.AddInt64(&r.stats.spansNotSent, int64(len(batch)))
205205
setLastError(err)
206206
return
207207
}
@@ -219,12 +219,12 @@ func (r *SpanRecorder) sendSpans() (error, bool) {
219219
statusCode, err := r.callIngest(buf)
220220
if err != nil {
221221
atomic.AddInt64(&r.stats.sendSpansKo, 1)
222-
atomic.AddInt64(&r.stats.spansNotSent, int64(len(spans)))
222+
atomic.AddInt64(&r.stats.spansNotSent, int64(len(batch)))
223223
atomic.AddInt64(&r.stats.testSpansNotSent, testSpans)
224224
setLastError(err)
225225
} else {
226226
atomic.AddInt64(&r.stats.sendSpansOk, 1)
227-
atomic.AddInt64(&r.stats.spansSent, int64(len(spans)))
227+
atomic.AddInt64(&r.stats.spansSent, int64(len(batch)))
228228
atomic.AddInt64(&r.stats.testSpansSent, testSpans)
229229
}
230230
if statusCode == 401 {

0 commit comments

Comments
 (0)