Skip to content

Commit ee14669

Browse files
committed
Update build script
1 parent a6a4e5c commit ee14669

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

opentelemetry-proto/tests/grpc_build.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,22 @@ fn build_tonic() {
9494
}
9595

9696
// add custom serializer and deserializer for AnyValue
97-
for path in ["common.v1.KeyValue.value", "logs.v1.LogRecord.body"] {
97+
for path in ["logs.v1.LogRecord.body"] {
9898
builder = builder
9999
.field_attribute(path, "#[cfg_attr(feature =\"with-serde\", serde(serialize_with = \"crate::proto::serializers::serialize_to_value\", deserialize_with = \"crate::proto::serializers::deserialize_from_value\"))]");
100100
}
101101

102+
// flatten
103+
for path in [
104+
"common.v1.AnyValue.value",
105+
"metrics.v1.Metric.data",
106+
"metrics.v1.NumberDataPoint.value",
107+
"metrics.v1.Exemplar.value",
108+
] {
109+
builder =
110+
builder.field_attribute(path, "#[cfg_attr(feature =\"with-serde\", serde(flatten))]");
111+
}
112+
102113
builder
103114
.out_dir(out_dir.path())
104115
.compile(TONIC_PROTO_FILES, TONIC_INCLUDES)

0 commit comments

Comments
 (0)