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

Function create_exit_span

src/plugin/plugin_memcache.rs:246–272  ·  view source on GitHub ↗
(
    style: ApiStyle, request_id: Option<i64>, class_name: Option<&str>, function_name: &str,
    remote_peer: &str, tag_info: &TagInfo<'_>, key: Option<&str>,
)

Source from the content-addressed store, hash-verified

244}
245
246fn create_exit_span(
247 style: ApiStyle, request_id: Option<i64>, class_name: Option<&str>, function_name: &str,
248 remote_peer: &str, tag_info: &TagInfo<'_>, key: Option<&str>,
249) -> anyhow::Result<Span> {
250 RequestContext::try_with_global_ctx(request_id, |ctx| {
251 let mut span = ctx.create_exit_span(
252 &style.generate_operation_name(class_name, function_name),
253 remote_peer,
254 );
255
256 let span_object = span.span_object_mut();
257 span_object.set_span_layer(SpanLayer::Cache);
258 span_object.component_id = COMPONENT_PHP_MEMCACHED_ID;
259 span_object.add_tag(TAG_CACHE_TYPE, "memcache");
260 if let Some(cmd) = tag_info.cmd {
261 span_object.add_tag(TAG_CACHE_CMD, cmd);
262 }
263 if let Some(op) = &tag_info.op {
264 span_object.add_tag(TAG_CACHE_OP, op.to_string());
265 };
266 if let Some(key) = key {
267 span_object.add_tag(TAG_CACHE_KEY, key)
268 }
269
270 Ok(span)
271 })
272}
273
274fn get_peer(this: &mut ZObj) -> String {
275 let handle = this.handle();

Callers 5

hook_curl_execMethod · 0.70
hook_curl_multi_execMethod · 0.70

Calls 2

create_exit_spanMethod · 0.45

Tested by

no test coverage detected