Skip to content

Commit 59f95f1

Browse files
committed
🔧 fix: build error
1 parent b451eb5 commit 59f95f1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,11 @@ export const opentelemetry = ({
671671
headers['x-real-ip'] ??
672672
server?.requestIP(request)
673673

674-
if (ip) attributes['client.address'] = ip.address
674+
if (ip)
675+
attributes['client.address'] =
676+
typeof ip === 'string'
677+
? ip
678+
: (ip.address ?? ip.toString())
675679
}
676680

677681
// ? Elysia Custom attribute

test/abort.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { opentelemetry, getCurrentSpan } from '../src'
33
import { describe, expect, it } from 'bun:test'
44

55
// Test constants
6-
const SLOW_OPERATION_TIMEOUT = 1000
6+
const SLOW_OPERATION_TIMEOUT = 350
77
const ABORT_DELAY = 10
88
const CLEANUP_DELAY = 100
99

@@ -53,7 +53,7 @@ describe('Abort Request Handling', () => {
5353

5454
// Get the last two trace IDs (from the successful requests)
5555
const lastTwoTraceIds = traceIds.slice(-2)
56-
56+
5757
// Each request should have a unique trace ID
5858
expect(lastTwoTraceIds[0]).toBeDefined()
5959
expect(lastTwoTraceIds[1]).toBeDefined()

0 commit comments

Comments
 (0)