Skip to content

Commit

Permalink
Set error.type on OpenTelemetry spans
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshMock committed Jun 20, 2024
1 parent 46ceb23 commit e914c47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit/transport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,7 @@ test('OpenTelemetry', t => {
})

t.test('span records error state', async t => {
t.plan(2)
t.plan(3)

const pool = new WeightedConnectionPool({ Connection: MockConnectionTimeout })
pool.addConnection('http://localhost:9200')
Expand All @@ -2384,6 +2384,7 @@ test('OpenTelemetry', t => {

const spans = exporter.getFinishedSpans()

t.equal(spans[0].attributes['error.type'], 'TimeoutError')
t.not(spans[0].status.code, 0)
})

Expand Down

0 comments on commit e914c47

Please sign in to comment.