From f6cdd9f9a6e4041850c1cab4472d5738f9693d93 Mon Sep 17 00:00:00 2001 From: vianney Date: Wed, 6 Nov 2024 15:58:36 +0100 Subject: [PATCH] Rename version to app_version --- data-pipeline-ffi/src/trace_exporter.rs | 2 +- data-pipeline/src/stats_exporter.rs | 4 ++-- data-pipeline/src/trace_exporter.rs | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/data-pipeline-ffi/src/trace_exporter.rs b/data-pipeline-ffi/src/trace_exporter.rs index b4dbbf81c..b3cdbe365 100644 --- a/data-pipeline-ffi/src/trace_exporter.rs +++ b/data-pipeline-ffi/src/trace_exporter.rs @@ -60,7 +60,7 @@ pub unsafe extern "C" fn ddog_trace_exporter_new( .set_language_interpreter(language_interpreter.to_utf8_lossy().as_ref()) .set_hostname(hostname.to_utf8_lossy().as_ref()) .set_env(env.to_utf8_lossy().as_ref()) - .set_version(version.to_utf8_lossy().as_ref()) + .set_app_version(version.to_utf8_lossy().as_ref()) .set_service(service.to_utf8_lossy().as_ref()) .set_input_format(input_format) .set_output_format(output_format) diff --git a/data-pipeline/src/stats_exporter.rs b/data-pipeline/src/stats_exporter.rs index 820af6376..7a7f74c68 100644 --- a/data-pipeline/src/stats_exporter.rs +++ b/data-pipeline/src/stats_exporter.rs @@ -160,7 +160,7 @@ fn encode_stats_payload( hostname: meta.hostname.clone(), env: meta.env.clone(), lang: meta.language.clone(), - version: meta.version.clone(), + version: meta.app_version.clone(), runtime_id: meta.runtime_id.clone(), tracer_version: meta.tracer_version.clone(), service: meta.service.clone(), @@ -209,7 +209,7 @@ mod tests { TracerMetadata { hostname: "libdatadog-test".into(), env: "test".into(), - version: "0.0.0".into(), + app_version: "0.0.0".into(), language: "rust".into(), tracer_version: "0.0.0".into(), runtime_id: "e39d6d12-0752-489f-b488-cf80006c0378".into(), diff --git a/data-pipeline/src/trace_exporter.rs b/data-pipeline/src/trace_exporter.rs index 2e0d57730..ff535a1b6 100644 --- a/data-pipeline/src/trace_exporter.rs +++ b/data-pipeline/src/trace_exporter.rs @@ -157,7 +157,7 @@ fn drop_chunks(traces: &mut Vec>) -> DroppedP0Counts { pub struct TracerMetadata { pub hostname: String, pub env: String, - pub version: String, + pub app_version: String, pub runtime_id: String, pub service: String, pub tracer_version: String, @@ -672,7 +672,7 @@ pub struct TraceExporterBuilder { url: Option, hostname: String, env: String, - version: String, + app_version: String, service: String, tracer_version: String, language: String, @@ -723,8 +723,9 @@ impl TraceExporterBuilder { } /// Set the app version which corresponds to the `version` meta tag - pub fn set_version(mut self, version: &str) -> Self { - version.clone_into(&mut self.version); + /// Only used when client-side stats is enabled + pub fn set_app_version(mut self, app_version: &str) -> Self { + app_version.clone_into(&mut self.app_version); self } @@ -872,7 +873,7 @@ impl TraceExporterBuilder { client_computed_top_level: self.client_computed_top_level, hostname: self.hostname, env: self.env, - version: self.version, + app_version: self.app_version, runtime_id: uuid::Uuid::new_v4().to_string(), service: self.service, },