@@ -5,6 +5,7 @@ use spin_world::v1::mysql as v1;
55use spin_world:: v2:: mysql:: { self as v2, Connection } ;
66use spin_world:: v2:: rdbms_types as v2_types;
77use spin_world:: v2:: rdbms_types:: ParameterValue ;
8+ use tracing:: field:: Empty ;
89use tracing:: { instrument, Level } ;
910
1011use crate :: client:: Client ;
@@ -38,8 +39,10 @@ impl<C: Client> v2::Host for InstanceState<C> {}
3839
3940#[ async_trait]
4041impl < C : Client > v2:: HostConnection for InstanceState < C > {
41- #[ instrument( name = "spin_outbound_mysql.open_connection " , skip( self ) , err( level = Level :: INFO ) , fields( otel. kind = "client" , db. system = "mysql" ) ) ]
42+ #[ instrument( name = "spin_outbound_mysql.open " , skip( self , address ) , err( level = Level :: INFO ) , fields( otel. kind = "client" , db. system = "mysql" , db . address = Empty , server . port = Empty , db . namespace = Empty ) ) ]
4243 async fn open ( & mut self , address : String ) -> Result < Resource < Connection > , v2:: Error > {
44+ spin_factor_outbound_networking:: record_address_fields ( & address) ;
45+
4346 if !self
4447 . is_address_allowed ( & address)
4548 . await
@@ -52,7 +55,7 @@ impl<C: Client> v2::HostConnection for InstanceState<C> {
5255 self . open_connection ( & address) . await
5356 }
5457
55- #[ instrument( name = "spin_outbound_mysql.execute" , skip( self , connection) , err( level = Level :: INFO ) , fields( otel. kind = "client" , db. system = "mysql" , otel. name = statement) ) ]
58+ #[ instrument( name = "spin_outbound_mysql.execute" , skip( self , connection, params ) , err( level = Level :: INFO ) , fields( otel. kind = "client" , db. system = "mysql" , otel. name = statement) ) ]
5659 async fn execute (
5760 & mut self ,
5861 connection : Resource < Connection > ,
@@ -66,7 +69,7 @@ impl<C: Client> v2::HostConnection for InstanceState<C> {
6669 . await ?)
6770 }
6871
69- #[ instrument( name = "spin_outbound_mysql.query" , skip( self , connection) , err( level = Level :: INFO ) , fields( otel. kind = "client" , db. system = "mysql" , otel. name = statement) ) ]
72+ #[ instrument( name = "spin_outbound_mysql.query" , skip( self , connection, params ) , err( level = Level :: INFO ) , fields( otel. kind = "client" , db. system = "mysql" , otel. name = statement) ) ]
7073 async fn query (
7174 & mut self ,
7275 connection : Resource < Connection > ,
0 commit comments