Skip to content

Commit

Permalink
feat(outbound-mysql): Trace outbound-mysql host component
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Schoepp <[email protected]>
  • Loading branch information
calebschoepp committed Apr 8, 2024
1 parent 7303f3a commit e1da5c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/outbound-mysql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ impl v2::Host for OutboundMysql {}

#[async_trait]
impl v2::HostConnection for OutboundMysql {
#[instrument(name = "spin_outbound_mysql.open_connection", skip(self), err(level = Level::INFO), fields(otel.kind = "client", db.system = "mysql"))]
async fn open(&mut self, address: String) -> Result<Result<Resource<Connection>, v2::Error>> {
if !self.is_address_allowed(&address) {
return Ok(Err(v2::Error::ConnectionFailed(format!(
Expand All @@ -94,6 +95,7 @@ impl v2::HostConnection for OutboundMysql {
Ok(self.open_connection(&address).await)
}

#[instrument(name = "spin_outbound_mysql.execute", skip(self, connection), err(level = Level::INFO), fields(otel.kind = "client", db.system = "mysql", otel.name = statement))]
async fn execute(
&mut self,
connection: Resource<Connection>,
Expand All @@ -115,6 +117,7 @@ impl v2::HostConnection for OutboundMysql {
.await)
}

#[instrument(name = "spin_outbound_mysql.query", skip(self, connection), err(level = Level::INFO), fields(otel.kind = "client", db.system = "mysql", otel.name = statement))]
async fn query(
&mut self,
connection: Resource<Connection>,
Expand Down

0 comments on commit e1da5c6

Please sign in to comment.