File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -168,23 +168,29 @@ async def _inner(*args: Any, **kwargs: Any) -> T:
168168 name = "connect" ,
169169 origin = AsyncPGIntegration .origin ,
170170 ) as span :
171- span .set_data (SPANDATA .DB_SYSTEM , "postgresql" )
171+ span_data = {
172+ SPANDATA .DB_SYSTEM : "postgresql" ,
173+ SPANDATA .DB_NAME : database ,
174+ SPANDATA .DB_USER : user ,
175+ }
172176 addr = kwargs .get ("addr" )
173177 if addr :
174178 try :
175- span . set_data ( SPANDATA .SERVER_ADDRESS , addr [0 ])
176- span . set_data ( SPANDATA .SERVER_PORT , addr [1 ])
179+ span_data [ SPANDATA .SERVER_ADDRESS ] = addr [0 ]
180+ span_data [ SPANDATA .SERVER_PORT ] = addr [1 ]
177181 except IndexError :
178182 pass
179- span .set_data (SPANDATA .DB_NAME , database )
180- span .set_data (SPANDATA .DB_USER , user )
183+
184+ for k , v in span_data .items ():
185+ span .set_data (k , v )
181186
182187 with capture_internal_exceptions ():
183188 sentry_sdk .add_breadcrumb (
184- message = "connect" ,
185- category = "query" ,
186- data = span . _data ,
189+ message = "connect" ,
190+ category = "query" ,
191+ data = span_data ,
187192 )
193+
188194 res = await f (* args , ** kwargs )
189195
190196 return res
You can’t perform that action at this time.
0 commit comments