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

Function create_mysqli_exit_span

src/plugin/plugin_mysqli.rs:184–201  ·  view source on GitHub ↗
(
    request_id: Option<i64>, class_name: Option<&str>, function_name: &str, peer: &str,
    style: ApiStyle,
)

Source from the content-addressed store, hash-verified

182}
183
184fn create_mysqli_exit_span(
185 request_id: Option<i64>, class_name: Option<&str>, function_name: &str, peer: &str,
186 style: ApiStyle,
187) -> anyhow::Result<Span> {
188 RequestContext::try_with_global_ctx(request_id, |ctx| {
189 let mut span = ctx.create_exit_span(
190 &style.generate_operation_name(class_name, function_name),
191 peer,
192 );
193
194 let span_object = span.span_object_mut();
195 span_object.set_span_layer(SpanLayer::Database);
196 span_object.component_id = COMPONENT_PHP_MYSQLI_ID;
197 span_object.add_tag("db.type", "mysql");
198
199 Ok(span)
200 })
201}
202
203fn get_peer_by_this(this: &mut ZObj) -> Option<String> {
204 let handle = this.handle();

Callers 2

hook_mysqli_connectMethod · 0.85
hook_mysqli_methodsMethod · 0.85

Calls 2

create_exit_spanMethod · 0.45

Tested by

no test coverage detected