in src/plugin/plugin_pdo.rs [117:141]
fn hook_pdo_methods(
&self, function_name: &str,
) -> (Box<BeforeExecuteHook>, Box<AfterExecuteHook>) {
let function_name = function_name.to_owned();
(
Box::new(move |request_id, execute_data| {
let handle = get_this_mut(execute_data)?.handle();
debug!(handle, function_name, "call PDO method");
let mut span = with_dsn(handle, |dsn| {
create_exit_span_with_dsn(request_id, "PDO", &function_name, dsn)
})?;
if execute_data.num_args() >= 1 {
if let Some(statement) = execute_data.get_parameter(0).as_z_str() {
span.add_tag(TAG_DB_STATEMENT, statement.to_str()?);
}
}
Ok(Box::new(span) as _)
}),
Box::new(after_hook),
)
}