From af0b7d1a2b3d88c55ebc189b52e0ac00a104014f Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Fri, 8 Nov 2024 15:35:37 -0800 Subject: [PATCH 1/3] add comment --- opentelemetry/src/logs/record.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opentelemetry/src/logs/record.rs b/opentelemetry/src/logs/record.rs index 91fadbf252..94e12481db 100644 --- a/opentelemetry/src/logs/record.rs +++ b/opentelemetry/src/logs/record.rs @@ -61,6 +61,12 @@ pub trait LogRecord { } /// Value types for representing arbitrary values in a log record. +/// Note: The `tracing` and `log` crates only natively support basic types +/// such as `i64`, `f64`, `StringValue`, and `bool`. The boxed types +/// (`Bytes`, `ListAny`, and `Map`) are included to support custom appenders +/// for other logging crates, as required by specifications. +/// These types allow for handling dynamic data structures, so be mindful +/// of the potential performance overhead associated with boxed vectors and maps. #[derive(Debug, Clone, PartialEq)] #[non_exhaustive] pub enum AnyValue { From a2b7a7e5f9d84f5e55053d46b06d16278b28331e Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Fri, 8 Nov 2024 15:41:44 -0800 Subject: [PATCH 2/3] add comment --- opentelemetry/src/logs/record.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/opentelemetry/src/logs/record.rs b/opentelemetry/src/logs/record.rs index 94e12481db..719977926b 100644 --- a/opentelemetry/src/logs/record.rs +++ b/opentelemetry/src/logs/record.rs @@ -61,12 +61,14 @@ pub trait LogRecord { } /// Value types for representing arbitrary values in a log record. -/// Note: The `tracing` and `log` crates only natively support basic types -/// such as `i64`, `f64`, `StringValue`, and `bool`. The boxed types -/// (`Bytes`, `ListAny`, and `Map`) are included to support custom appenders -/// for other logging crates, as required by specifications. -/// These types allow for handling dynamic data structures, so be mindful -/// of the potential performance overhead associated with boxed vectors and maps. +/// Note: The `tracing` and `log` crates only support basic types that can be +/// converted to these core variants: `i64`, `f64`, `StringValue`, and `bool`. +/// Any complex and custom types are suported through their Debug implemetnation, +/// and converted to String. More complex types (`Bytes`, `ListAny`, and `Map`) are +/// included here to meet specification requirements and are available to support +/// custom appenders that may be implemented for other logging crates. +/// These types allow for handling dynamic data structures, so keep in mind the +/// potential performance overhead of using boxed vectors and maps in appenders. #[derive(Debug, Clone, PartialEq)] #[non_exhaustive] pub enum AnyValue { From 3f368b65b8c6533cc9836e1a7e9e77aebd814ada Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Fri, 8 Nov 2024 15:49:23 -0800 Subject: [PATCH 3/3] Update opentelemetry/src/logs/record.rs Co-authored-by: Cijo Thomas --- opentelemetry/src/logs/record.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/src/logs/record.rs b/opentelemetry/src/logs/record.rs index 719977926b..d53caa7cc1 100644 --- a/opentelemetry/src/logs/record.rs +++ b/opentelemetry/src/logs/record.rs @@ -63,7 +63,7 @@ pub trait LogRecord { /// Value types for representing arbitrary values in a log record. /// Note: The `tracing` and `log` crates only support basic types that can be /// converted to these core variants: `i64`, `f64`, `StringValue`, and `bool`. -/// Any complex and custom types are suported through their Debug implemetnation, +/// Any complex and custom types are supported through their Debug implementation, /// and converted to String. More complex types (`Bytes`, `ListAny`, and `Map`) are /// included here to meet specification requirements and are available to support /// custom appenders that may be implemented for other logging crates.