Skip to content

Commit 85c5c4f

Browse files
authored
fix tracer flare log (#5143)
1 parent c4f2921 commit 85c5c4f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/dd-trace/src/flare/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ const flare = {
9292
function recordLog (msg) {
9393
if (tracerLogs.length > MAX_LOG_SIZE) return
9494

95+
if (msg && typeof msg === 'object') {
96+
msg = JSON.stringify(msg)
97+
}
9598
tracerLogs.write(`${msg}\n`) // TODO: gzip
9699
}
97100

packages/dd-trace/test/flare.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe('Flare', () => {
142142

143143
const content = file.buffer.toString()
144144

145-
expect(content).to.equal('foo\nbar\n')
145+
expect(content).to.equal('foo\nbar\n{"foo":"bar"}\n')
146146

147147
done()
148148
} catch (e) {
@@ -155,6 +155,7 @@ describe('Flare', () => {
155155

156156
debugChannel.publish('foo')
157157
debugChannel.publish('bar')
158+
debugChannel.publish({ foo: 'bar' })
158159

159160
flare.send(task)
160161
})

0 commit comments

Comments
 (0)