Skip to content
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/ffi/exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int main(int argc, char *argv[]) {
}

auto build_result = ddog_prof_Exporter_Request_build(
exporter, encoded_profile, files_to_compress_and_export, files_to_export_unmodified, nullptr,
exporter, encoded_profile, files_to_compress_and_export, files_to_export_unmodified, nullptr, nullptr,
&internal_metadata_example, &info_example);
ddog_prof_EncodedProfile_drop(encoded_profile);

Expand Down
10 changes: 9 additions & 1 deletion libdd-profiling-ffi/src/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ pub unsafe extern "C" fn ddog_prof_Exporter_Request_build(
files_to_compress_and_export: Slice<File>,
files_to_export_unmodified: Slice<File>,
optional_additional_tags: Option<&libdd_common_ffi::Vec<Tag>>,
optional_process_tags: Option<&libdd_common_ffi::Vec<Tag>>,
optional_internal_metadata_json: Option<&CharSlice>,
optional_info_json: Option<&CharSlice>,
) -> Result<Handle<Request>> {
Expand All @@ -229,7 +230,7 @@ pub unsafe extern "C" fn ddog_prof_Exporter_Request_build(
let files_to_compress_and_export = into_vec_files(files_to_compress_and_export);
let files_to_export_unmodified = into_vec_files(files_to_export_unmodified);
let tags = optional_additional_tags.map(|tags| tags.iter().cloned().collect());

let process_tags = optional_process_tags.map(|tags| tags.iter().cloned().collect());
let internal_metadata = parse_json("internal_metadata", optional_internal_metadata_json)?;
let info = parse_json("info", optional_info_json)?;

Expand All @@ -238,6 +239,7 @@ pub unsafe extern "C" fn ddog_prof_Exporter_Request_build(
files_to_compress_and_export.as_slice(),
files_to_export_unmodified.as_slice(),
tags.as_ref(),
process_tags.as_ref(),
internal_metadata,
info,
)?;
Expand Down Expand Up @@ -486,6 +488,7 @@ mod tests {
None,
None,
None,
None,
)
};

Expand Down Expand Up @@ -571,6 +574,7 @@ mod tests {
Slice::empty(),
Slice::empty(),
None,
None,
Some(&raw_internal_metadata),
None,
)
Expand Down Expand Up @@ -620,6 +624,7 @@ mod tests {
Slice::empty(),
Slice::empty(),
None,
None,
Some(&raw_internal_metadata),
None,
)
Expand Down Expand Up @@ -693,6 +698,7 @@ mod tests {
Slice::empty(),
None,
None,
None,
Some(&raw_info),
)
};
Expand Down Expand Up @@ -763,6 +769,7 @@ mod tests {
Slice::empty(),
None,
None,
None,
Some(&raw_info),
)
};
Expand All @@ -786,6 +793,7 @@ mod tests {
None,
None,
None,
None,
)
};

Expand Down
12 changes: 12 additions & 0 deletions libdd-profiling/src/exporter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ impl ProfileExporter {
files_to_compress_and_export: &[File],
files_to_export_unmodified: &[File],
additional_tags: Option<&Vec<Tag>>,
process_tags: Option<&Vec<Tag>>,
internal_metadata: Option<serde_json::Value>,
info: Option<serde_json::Value>,
) -> anyhow::Result<Request> {
Expand All @@ -200,6 +201,16 @@ impl ProfileExporter {
tags_profiler.push(',');
}

let tags_process = if let Some(process_tags) = process_tags {
process_tags
.iter()
.map(|tag| tag.as_ref())
.collect::<Vec<_>>()
.join(",")
} else {
String::new()
};

if let Some(aas_metadata) = &*azure_app_services::AAS_METADATA {
let aas_tags = [
("aas.resource.id", aas_metadata.get_resource_id()),
Expand Down Expand Up @@ -253,6 +264,7 @@ impl ProfileExporter {
let event = json!({
"attachments": attachments,
"tags_profiler": tags_profiler,
"process_tags": tags_process,
"start": DateTime::<Utc>::from(profile.start).format("%Y-%m-%dT%H:%M:%S%.9fZ").to_string(),
"end": DateTime::<Utc>::from(profile.end).format("%Y-%m-%dT%H:%M:%S%.9fZ").to_string(),
"family": self.family.as_ref(),
Expand Down
1 change: 1 addition & 0 deletions libdd-profiling/tests/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fn multipart(
files_to_compress_and_export,
files_to_export_unmodified,
None,
None,
internal_metadata,
info,
)
Expand Down
Loading