From a3e0d18247d972e36a386785e50ca78b2ceec234 Mon Sep 17 00:00:00 2001 From: Hartigan Date: Mon, 18 Dec 2023 22:03:16 +0100 Subject: [PATCH] Move GIT_META_TAGS_COUNT to top of file --- opentelemetry-datadog/src/exporter/model/v05.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-datadog/src/exporter/model/v05.rs b/opentelemetry-datadog/src/exporter/model/v05.rs index 1a0dce4a..01c29483 100644 --- a/opentelemetry-datadog/src/exporter/model/v05.rs +++ b/opentelemetry-datadog/src/exporter/model/v05.rs @@ -8,6 +8,7 @@ use std::time::SystemTime; use super::unified_tags::{UnifiedTagField, UnifiedTags}; const SPAN_NUM_ELEMENTS: u32 = 12; +const GIT_META_TAGS_COUNT: u32 = if matches!((option_env!("DD_GIT_REPOSITORY_URL"), option_env!("DD_GIT_COMMIT_SHA")), (Some(_), Some(_))) { 2 } else { 0 }; // Protocol documentation sourced from https://github.com/DataDog/datadog-agent/blob/c076ea9a1ffbde4c76d35343dbc32aecbbf99cb9/pkg/trace/api/version.go // @@ -189,7 +190,6 @@ where }, )?; - const GIT_META_TAGS_COUNT: u32 = if matches!((option_env!("DD_GIT_REPOSITORY_URL"), option_env!("DD_GIT_COMMIT_SHA")), (Some(_), Some(_))) { 2 } else { 0 }; rmp::encode::write_map_len( &mut encoded, (span.attributes.len() + span.resource.len()) as u32