@@ -431,6 +431,13 @@ pub struct HistogramDataPoint {
431431 /// value must be equal to the sum of the "count" fields in buckets if a
432432 /// histogram is provided.
433433 #[ prost( fixed64, tag = "4" ) ]
434+ #[ cfg_attr(
435+ feature = "with-serde" ,
436+ serde(
437+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
438+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
439+ )
440+ ) ]
434441 pub count : u64 ,
435442 /// sum of the values in the population. If count is zero then this field
436443 /// must be zero.
@@ -450,6 +457,13 @@ pub struct HistogramDataPoint {
450457 /// The number of elements in bucket_counts array must be by one greater than
451458 /// the number of elements in explicit_bounds array.
452459 #[ prost( fixed64, repeated, tag = "6" ) ]
460+ #[ cfg_attr(
461+ feature = "with-serde" ,
462+ serde(
463+ serialize_with = "crate::proto::serializers::serialize_vec_u64_to_strings" ,
464+ deserialize_with = "crate::proto::serializers::deserialize_strings_to_vec_u64"
465+ )
466+ ) ]
453467 pub bucket_counts : :: prost:: alloc:: vec:: Vec < u64 > ,
454468 /// explicit_bounds specifies buckets with explicitly defined bounds for values.
455469 ///
@@ -503,17 +517,38 @@ pub struct ExponentialHistogramDataPoint {
503517 /// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
504518 /// 1970.
505519 #[ prost( fixed64, tag = "2" ) ]
520+ #[ cfg_attr(
521+ feature = "with-serde" ,
522+ serde(
523+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
524+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
525+ )
526+ ) ]
506527 pub start_time_unix_nano : u64 ,
507528 /// TimeUnixNano is required, see the detailed comments above Metric.
508529 ///
509530 /// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
510531 /// 1970.
511532 #[ prost( fixed64, tag = "3" ) ]
533+ #[ cfg_attr(
534+ feature = "with-serde" ,
535+ serde(
536+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
537+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
538+ )
539+ ) ]
512540 pub time_unix_nano : u64 ,
513541 /// count is the number of values in the population. Must be
514542 /// non-negative. This value must be equal to the sum of the "bucket_counts"
515543 /// values in the positive and negative Buckets plus the "zero_count" field.
516544 #[ prost( fixed64, tag = "4" ) ]
545+ #[ cfg_attr(
546+ feature = "with-serde" ,
547+ serde(
548+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
549+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
550+ )
551+ ) ]
517552 pub count : u64 ,
518553 /// sum of the values in the population. If count is zero then this field
519554 /// must be zero.
@@ -551,6 +586,13 @@ pub struct ExponentialHistogramDataPoint {
551586 /// Implementations MAY consider the zero bucket to have probability
552587 /// mass equal to (zero_count / count).
553588 #[ prost( fixed64, tag = "7" ) ]
589+ #[ cfg_attr(
590+ feature = "with-serde" ,
591+ serde(
592+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
593+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
594+ )
595+ ) ]
554596 pub zero_count : u64 ,
555597 /// positive carries the positive range of exponential bucket counts.
556598 #[ prost( message, optional, tag = "8" ) ]
@@ -628,15 +670,36 @@ pub struct SummaryDataPoint {
628670 /// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
629671 /// 1970.
630672 #[ prost( fixed64, tag = "2" ) ]
673+ #[ cfg_attr(
674+ feature = "with-serde" ,
675+ serde(
676+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
677+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
678+ )
679+ ) ]
631680 pub start_time_unix_nano : u64 ,
632681 /// TimeUnixNano is required, see the detailed comments above Metric.
633682 ///
634683 /// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
635684 /// 1970.
636685 #[ prost( fixed64, tag = "3" ) ]
686+ #[ cfg_attr(
687+ feature = "with-serde" ,
688+ serde(
689+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
690+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
691+ )
692+ ) ]
637693 pub time_unix_nano : u64 ,
638694 /// count is the number of values in the population. Must be non-negative.
639695 #[ prost( fixed64, tag = "4" ) ]
696+ #[ cfg_attr(
697+ feature = "with-serde" ,
698+ serde(
699+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
700+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
701+ )
702+ ) ]
640703 pub count : u64 ,
641704 /// sum of the values in the population. If count is zero then this field
642705 /// must be zero.
@@ -704,6 +767,13 @@ pub struct Exemplar {
704767 /// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
705768 /// 1970.
706769 #[ prost( fixed64, tag = "2" ) ]
770+ #[ cfg_attr(
771+ feature = "with-serde" ,
772+ serde(
773+ serialize_with = "crate::proto::serializers::serialize_u64_to_string" ,
774+ deserialize_with = "crate::proto::serializers::deserialize_string_to_u64"
775+ )
776+ ) ]
707777 pub time_unix_nano : u64 ,
708778 /// (Optional) Span ID of the exemplar trace.
709779 /// span_id may be missing if the measurement is not recorded inside a trace
0 commit comments