@@ -5,6 +5,7 @@ use spin_world::v1::mysql as v1;
5
5
use spin_world:: v2:: mysql:: { self as v2, Connection } ;
6
6
use spin_world:: v2:: rdbms_types as v2_types;
7
7
use spin_world:: v2:: rdbms_types:: ParameterValue ;
8
+ use tracing:: field:: Empty ;
8
9
use tracing:: { instrument, Level } ;
9
10
10
11
use crate :: client:: Client ;
@@ -38,8 +39,10 @@ impl<C: Client> v2::Host for InstanceState<C> {}
38
39
39
40
#[ async_trait]
40
41
impl < 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 ) ) ]
42
43
async fn open ( & mut self , address : String ) -> Result < Resource < Connection > , v2:: Error > {
44
+ spin_factor_outbound_networking:: record_address_fields ( & address) ;
45
+
43
46
if !self
44
47
. is_address_allowed ( & address)
45
48
. await
@@ -52,7 +55,7 @@ impl<C: Client> v2::HostConnection for InstanceState<C> {
52
55
self . open_connection ( & address) . await
53
56
}
54
57
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) ) ]
56
59
async fn execute (
57
60
& mut self ,
58
61
connection : Resource < Connection > ,
@@ -66,7 +69,7 @@ impl<C: Client> v2::HostConnection for InstanceState<C> {
66
69
. await ?)
67
70
}
68
71
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) ) ]
70
73
async fn query (
71
74
& mut self ,
72
75
connection : Resource < Connection > ,
0 commit comments