Skip to content

Commit

Permalink
Fix vendor header name (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
VianneyRuhlmann authored Oct 25, 2024
1 parent a4d6b05 commit 085a91a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
15 changes: 12 additions & 3 deletions trace-utils/src/send_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,10 @@ mod tests {
header_tags.lang_interpreter,
)
.header("datadog-meta-lang-version", header_tags.lang_version)
.header("datadog-meta-lang-vendor", header_tags.lang_vendor)
.header(
"datadog-meta-lang-interpreter-vendor",
header_tags.lang_vendor,
)
.header("datadog-meta-tracer-version", header_tags.tracer_version)
.header("datadog-container-id", header_tags.container_id)
.path("/");
Expand Down Expand Up @@ -810,7 +813,10 @@ mod tests {
header_tags.lang_interpreter,
)
.header("datadog-meta-lang-version", header_tags.lang_version)
.header("datadog-meta-lang-vendor", header_tags.lang_vendor)
.header(
"datadog-meta-lang-interpreter-vendor",
header_tags.lang_vendor,
)
.header("datadog-meta-tracer-version", header_tags.tracer_version)
.header("datadog-container-id", header_tags.container_id)
.path("/");
Expand Down Expand Up @@ -995,7 +1001,10 @@ mod tests {
header_tags.lang_interpreter,
)
.header("datadog-meta-lang-version", header_tags.lang_version)
.header("datadog-meta-lang-vendor", header_tags.lang_vendor)
.header(
"datadog-meta-lang-interpreter-vendor",
header_tags.lang_vendor,
)
.header("datadog-meta-tracer-version", header_tags.tracer_version)
.header("datadog-container-id", header_tags.container_id)
.path("/");
Expand Down
22 changes: 17 additions & 5 deletions trace-utils/src/tracer_header_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ impl<'a> From<TracerHeaderTags<'a>> for HashMap<&'static str, String> {
"datadog-meta-lang-interpreter",
tags.lang_interpreter.to_string(),
),
("datadog-meta-lang-vendor", tags.lang_vendor.to_string()),
(
"datadog-meta-lang-interpreter-vendor",
tags.lang_vendor.to_string(),
),
(
"datadog-meta-tracer-version",
tags.tracer_version.to_string(),
Expand Down Expand Up @@ -83,7 +86,7 @@ impl<'a> From<&'a HeaderMap<HeaderValue>> for TracerHeaderTags<'a> {
"datadog-meta-lang" => tags.lang,
"datadog-meta-lang-version" => tags.lang_version,
"datadog-meta-lang-interpreter" => tags.lang_interpreter,
"datadog-meta-lang-vendor" => tags.lang_vendor,
"datadog-meta-lang-interpreter-vendor" => tags.lang_vendor,
"datadog-meta-tracer-version" => tags.tracer_version,
"datadog-container-id" => tags.container_id,
}
Expand Down Expand Up @@ -125,7 +128,10 @@ mod tests {
map.get("datadog-meta-lang-interpreter").unwrap(),
"interpreter"
);
assert_eq!(map.get("datadog-meta-lang-vendor").unwrap(), "vendor");
assert_eq!(
map.get("datadog-meta-lang-interpreter-vendor").unwrap(),
"vendor"
);
assert_eq!(map.get("datadog-meta-tracer-version").unwrap(), "1.0");
assert_eq!(map.get("datadog-container-id").unwrap(), "id");
assert_eq!(
Expand Down Expand Up @@ -156,7 +162,10 @@ mod tests {
map.get("datadog-meta-lang-interpreter").unwrap(),
"interpreter"
);
assert_eq!(map.get("datadog-meta-lang-vendor").unwrap(), "vendor");
assert_eq!(
map.get("datadog-meta-lang-interpreter-vendor").unwrap(),
"vendor"
);
assert_eq!(map.get("datadog-meta-tracer-version").unwrap(), "1.0");
assert_eq!(map.get("datadog-container-id"), None);
assert_eq!(map.get("datadog-client-computed-top-level"), None);
Expand All @@ -173,7 +182,10 @@ mod tests {
"datadog-meta-lang-interpreter",
"interpreter".parse().unwrap(),
);
header_map.insert("datadog-meta-lang-vendor", "vendor".parse().unwrap());
header_map.insert(
"datadog-meta-lang-interpreter-vendor",
"vendor".parse().unwrap(),
);
header_map.insert("datadog-meta-tracer-version", "1.0".parse().unwrap());
header_map.insert("datadog-container-id", "id".parse().unwrap());
header_map.insert("datadog-client-computed-stats", "true".parse().unwrap());
Expand Down

0 comments on commit 085a91a

Please sign in to comment.