Skip to content

Commit

Permalink
Fix serde
Browse files Browse the repository at this point in the history
Make compatible with Collector serde shape
  • Loading branch information
hwrdtm committed Jun 3, 2024
1 parent 54b807f commit a6a4e5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct AnyValue {
/// The value is one of the listed fields. It is valid for all values to be unspecified
/// in which case this AnyValue is considered to be "empty".
#[prost(oneof = "any_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
#[cfg_attr(feature = "with-serde", serde(flatten))]
pub value: ::core::option::Option<any_value::Value>,
}
/// Nested message and enum types in `AnyValue`.
Expand Down Expand Up @@ -80,13 +81,6 @@ pub struct KeyValue {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
#[cfg_attr(
feature = "with-serde",
serde(
serialize_with = "crate::proto::serializers::serialize_to_value",
deserialize_with = "crate::proto::serializers::deserialize_from_value"
)
)]
pub value: ::core::option::Option<AnyValue>,
}
/// InstrumentationScope is a message representing the instrumentation scope information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pub struct Metric {
/// reported value type for the data points, as well as the relatationship to
/// the time interval over which they are reported.
#[prost(oneof = "metric::Data", tags = "5, 7, 9, 10, 11")]
#[cfg_attr(feature = "with-serde", serde(flatten))]
pub data: ::core::option::Option<metric::Data>,
}
/// Nested message and enum types in `Metric`.
Expand Down Expand Up @@ -325,6 +326,7 @@ pub struct NumberDataPoint {
/// The value itself. A point is considered invalid when one of the recognized
/// value fields is not present inside this oneof.
#[prost(oneof = "number_data_point::Value", tags = "4, 6")]
#[cfg_attr(feature = "with-serde", serde(flatten))]
pub value: ::core::option::Option<number_data_point::Value>,
}
/// Nested message and enum types in `NumberDataPoint`.
Expand Down Expand Up @@ -674,6 +676,7 @@ pub struct Exemplar {
/// considered invalid when one of the recognized value fields is not present
/// inside this oneof.
#[prost(oneof = "exemplar::Value", tags = "3, 6")]
#[cfg_attr(feature = "with-serde", serde(flatten))]
pub value: ::core::option::Option<exemplar::Value>,
}
/// Nested message and enum types in `Exemplar`.
Expand Down

0 comments on commit a6a4e5c

Please sign in to comment.