File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { opentelemetry, getCurrentSpan } from '../src'
33import { describe , expect , it } from 'bun:test'
44
55// Test constants
6- const SLOW_OPERATION_TIMEOUT = 1000
6+ const SLOW_OPERATION_TIMEOUT = 350
77const ABORT_DELAY = 10
88const 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 ( )
You can’t perform that action at this time.
0 commit comments