(
request_id: Option<i64>, class_name: &str, function_name: &str, dsn: &Dsn,
)
| 272 | } |
| 273 | |
| 274 | fn create_exit_span_with_dsn( |
| 275 | request_id: Option<i64>, class_name: &str, function_name: &str, dsn: &Dsn, |
| 276 | ) -> anyhow::Result<Span> { |
| 277 | RequestContext::try_with_global_ctx(request_id, |ctx| { |
| 278 | let mut span = |
| 279 | ctx.create_exit_span(&format!("{}->{}", class_name, function_name), &dsn.peer); |
| 280 | |
| 281 | let span_object = span.span_object_mut(); |
| 282 | span_object.set_span_layer(SpanLayer::Database); |
| 283 | span_object.component_id = COMPONENT_PHP_PDO_ID; |
| 284 | span_object.add_tag(TAG_DB_TYPE, &dsn.db_type); |
| 285 | span_object.add_tag("db.data_source", &dsn.data_source); |
| 286 | |
| 287 | Ok(span) |
| 288 | }) |
| 289 | } |
| 290 | |
| 291 | fn with_dsn<T>(handle: u32, f: impl FnOnce(&Dsn) -> anyhow::Result<T>) -> anyhow::Result<T> { |
| 292 | DSN_MAP |
no test coverage detected