Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions libdd-trace-utils/src/trace_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,21 +532,20 @@ pub fn enrich_span_with_google_cloud_function_metadata(
todo!()
};

#[allow(clippy::unwrap_used)]
if function.is_some() && !region.is_empty() && !project.is_empty() {
let resource_name = format!(
"projects/{}/locations/{}/functions/{}",
project,
region,
function.unwrap()
);
if let Some(function) = function {
if !region.is_empty() && !project.is_empty() {
let resource_name = format!(
"projects/{}/locations/{}/functions/{}",
project, region, function
);

span.meta
.insert("gcrfx.location".to_string(), region.to_string());
span.meta
.insert("gcrfx.project_id".to_string(), project.to_string());
span.meta
.insert("gcrfx.resource_name".to_string(), resource_name.to_string());
span.meta
.insert("gcrfx.location".to_string(), region.to_string());
span.meta
.insert("gcrfx.project_id".to_string(), project.to_string());
span.meta
.insert("gcrfx.resource_name".to_string(), resource_name.to_string());
}
}
}

Expand Down
Loading