relay_spans/
description.rs1use relay_conventions::attributes::*;
2use relay_conventions::description::description_for_op_and_attributes;
3use relay_event_schema::protocol::Attributes;
4use relay_protocol::Annotated;
5
6pub fn derive_description_for_v2_span(
14 attributes: &Attributes,
15 name: &Annotated<String>,
16) -> Option<String> {
17 let origin = attributes
18 .get_value(SENTRY__ORIGIN)
19 .and_then(|o| o.as_str());
20
21 let name = name.as_str();
22
23 if let Some(name) = name
24 && origin == Some("manual")
25 {
26 return Some(name.to_owned());
27 }
28
29 let op = attributes.get_value(SENTRY__OP)?.as_str()?;
30
31 description_for_op_and_attributes(op, |name| attributes.get_value(name))
32}