MCPcopy Create free account
hub / github.com/apache/skywalking-php / create_exit_span_with_dsn

Function create_exit_span_with_dsn

src/plugin/plugin_pdo.rs:274–289  ·  view source on GitHub ↗
(
    request_id: Option<i64>, class_name: &str, function_name: &str, dsn: &Dsn,
)

Source from the content-addressed store, hash-verified

272}
273
274fn 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
291fn with_dsn<T>(handle: u32, f: impl FnOnce(&Dsn) -> anyhow::Result<T>) -> anyhow::Result<T> {
292 DSN_MAP

Callers 3

hook_pdo_constructMethod · 0.85
hook_pdo_methodsMethod · 0.85

Calls 1

create_exit_spanMethod · 0.45

Tested by

no test coverage detected