From e40c999b0639e4563165c17a472b8cef14c56546 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 6 Sep 2023 23:35:15 -0400 Subject: [PATCH] update generated code --- Makefile | 2 +- src/dune | 18 +++++++++--------- src/logs_pb.ml | 8 ++++---- src/logs_pp.ml | 4 ++-- src/logs_types.ml | 6 +++--- src/logs_types.mli | 4 ++-- src/metrics_pb.ml | 18 ++++++++++++++---- src/metrics_pp.ml | 5 +++-- src/metrics_types.ml | 9 ++++++--- src/metrics_types.mli | 6 ++++-- src/opentelemetry.ml | 4 ++-- 11 files changed, 50 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 811e33c0..fdb7b173 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -OPTS=--profile=release +OPTS="--profile=release --ignore-promoted-rules" all: @dune build @all $(OPTS) diff --git a/src/dune b/src/dune index ea4b4070..268cf4cb 100644 --- a/src/dune +++ b/src/dune @@ -9,7 +9,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets status_types.ml status_types.mli status_pb.ml status_pb.mli status_pp.ml status_pp.mli) (deps @@ -20,7 +20,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets common_types.ml common_types.mli common_pb.ml common_pb.mli common_pp.ml common_pp.mli) (deps @@ -33,7 +33,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets resource_types.ml resource_types.mli resource_pb.ml resource_pb.mli resource_pp.ml resource_pp.mli) (deps @@ -46,7 +46,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets trace_types.ml trace_types.mli trace_pb.ml trace_pb.mli trace_pp.ml trace_pp.mli) (deps @@ -59,7 +59,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets metrics_types.ml metrics_types.mli metrics_pb.ml metrics_pb.mli metrics_pp.ml metrics_pp.mli) (deps @@ -72,7 +72,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets logs_types.ml logs_types.mli logs_pb.ml logs_pb.mli logs_pp.ml logs_pp.mli) (deps @@ -85,7 +85,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets metrics_service_types.ml metrics_service_types.mli metrics_service_pp.ml metrics_service_pp.mli metrics_service_pb.ml metrics_service_pb.mli) @@ -99,7 +99,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets trace_service_types.ml trace_service_types.mli trace_service_pp.ml trace_service_pp.mli trace_service_pb.ml trace_service_pb.mli) (deps @@ -112,7 +112,7 @@ (rule (alias lint) - (mode fallback) + (mode promote) (targets logs_service_types.ml logs_service_types.mli logs_service_pp.ml logs_service_pp.mli logs_service_pb.ml logs_service_pb.mli) (deps diff --git a/src/logs_pb.ml b/src/logs_pb.ml index b604b0d9..2ad391c5 100644 --- a/src/logs_pb.ml +++ b/src/logs_pb.ml @@ -244,8 +244,8 @@ let rec decode_logs_data d = let rec decode_log_record_flags d = match Pbrt.Decoder.int_as_varint d with - | 0 -> (Logs_types.Log_record_flag_unspecified:Logs_types.log_record_flags) - | 255 -> (Logs_types.Log_record_flag_trace_flags_mask:Logs_types.log_record_flags) + | 0 -> (Logs_types.Log_record_flags_do_not_use:Logs_types.log_record_flags) + | 255 -> (Logs_types.Log_record_flags_trace_flags_mask:Logs_types.log_record_flags) | _ -> Pbrt.Decoder.malformed_variant "log_record_flags" let rec encode_severity_number (v:Logs_types.severity_number) encoder = @@ -344,5 +344,5 @@ let rec encode_logs_data (v:Logs_types.logs_data) encoder = let rec encode_log_record_flags (v:Logs_types.log_record_flags) encoder = match v with - | Logs_types.Log_record_flag_unspecified -> Pbrt.Encoder.int_as_varint (0) encoder - | Logs_types.Log_record_flag_trace_flags_mask -> Pbrt.Encoder.int_as_varint 255 encoder + | Logs_types.Log_record_flags_do_not_use -> Pbrt.Encoder.int_as_varint (0) encoder + | Logs_types.Log_record_flags_trace_flags_mask -> Pbrt.Encoder.int_as_varint 255 encoder diff --git a/src/logs_pp.ml b/src/logs_pp.ml index 99a084a3..408f01d9 100644 --- a/src/logs_pp.ml +++ b/src/logs_pp.ml @@ -67,5 +67,5 @@ let rec pp_logs_data fmt (v:Logs_types.logs_data) = let rec pp_log_record_flags fmt (v:Logs_types.log_record_flags) = match v with - | Logs_types.Log_record_flag_unspecified -> Format.fprintf fmt "Log_record_flag_unspecified" - | Logs_types.Log_record_flag_trace_flags_mask -> Format.fprintf fmt "Log_record_flag_trace_flags_mask" + | Logs_types.Log_record_flags_do_not_use -> Format.fprintf fmt "Log_record_flags_do_not_use" + | Logs_types.Log_record_flags_trace_flags_mask -> Format.fprintf fmt "Log_record_flags_trace_flags_mask" diff --git a/src/logs_types.ml b/src/logs_types.ml index 49c11502..4a383ff7 100644 --- a/src/logs_types.ml +++ b/src/logs_types.ml @@ -58,8 +58,8 @@ type logs_data = { } type log_record_flags = - | Log_record_flag_unspecified - | Log_record_flag_trace_flags_mask + | Log_record_flags_do_not_use + | Log_record_flags_trace_flags_mask let rec default_severity_number () = (Severity_number_unspecified:severity_number) @@ -113,4 +113,4 @@ let rec default_logs_data resource_logs; } -let rec default_log_record_flags () = (Log_record_flag_unspecified:log_record_flags) +let rec default_log_record_flags () = (Log_record_flags_do_not_use:log_record_flags) diff --git a/src/logs_types.mli b/src/logs_types.mli index ab599f1c..7a9cc1a3 100644 --- a/src/logs_types.mli +++ b/src/logs_types.mli @@ -61,8 +61,8 @@ type logs_data = { } type log_record_flags = - | Log_record_flag_unspecified - | Log_record_flag_trace_flags_mask + | Log_record_flags_do_not_use + | Log_record_flags_trace_flags_mask (** {2 Default values} *) diff --git a/src/metrics_pb.ml b/src/metrics_pb.ml index 56362ba7..d85e1e72 100644 --- a/src/metrics_pb.ml +++ b/src/metrics_pb.ml @@ -116,6 +116,7 @@ type exponential_histogram_data_point_mutable = { mutable exemplars : Metrics_types.exemplar list; mutable min : float option; mutable max : float option; + mutable zero_threshold : float; } let default_exponential_histogram_data_point_mutable () : exponential_histogram_data_point_mutable = { @@ -132,6 +133,7 @@ let default_exponential_histogram_data_point_mutable () : exponential_histogram_ exemplars = []; min = None; max = None; + zero_threshold = 0.; } type exponential_histogram_mutable = { @@ -625,6 +627,11 @@ let rec decode_exponential_histogram_data_point d = end | Some (13, pk) -> Pbrt.Decoder.unexpected_payload "Message(exponential_histogram_data_point), field(13)" pk + | Some (14, Pbrt.Bits64) -> begin + v.zero_threshold <- Pbrt.Decoder.float_as_bits64 d; + end + | Some (14, pk) -> + Pbrt.Decoder.unexpected_payload "Message(exponential_histogram_data_point), field(14)" pk | Some (_, payload_kind) -> Pbrt.Decoder.skip d payload_kind done; ({ @@ -641,6 +648,7 @@ let rec decode_exponential_histogram_data_point d = Metrics_types.exemplars = v.exemplars; Metrics_types.min = v.min; Metrics_types.max = v.max; + Metrics_types.zero_threshold = v.zero_threshold; } : Metrics_types.exponential_histogram_data_point) let rec decode_exponential_histogram d = @@ -924,8 +932,8 @@ let rec decode_metrics_data d = let rec decode_data_point_flags d = match Pbrt.Decoder.int_as_varint d with - | 0 -> (Metrics_types.Flag_none:Metrics_types.data_point_flags) - | 1 -> (Metrics_types.Flag_no_recorded_value:Metrics_types.data_point_flags) + | 0 -> (Metrics_types.Data_point_flags_do_not_use:Metrics_types.data_point_flags) + | 1 -> (Metrics_types.Data_point_flags_no_recorded_value_mask:Metrics_types.data_point_flags) | _ -> Pbrt.Decoder.malformed_variant "data_point_flags" let rec encode_exemplar_value (v:Metrics_types.exemplar_value) encoder = @@ -1138,6 +1146,8 @@ let rec encode_exponential_histogram_data_point (v:Metrics_types.exponential_his Pbrt.Encoder.float_as_bits64 x encoder; | None -> (); end; + Pbrt.Encoder.key (14, Pbrt.Bits64) encoder; + Pbrt.Encoder.float_as_bits64 v.Metrics_types.zero_threshold encoder; () let rec encode_exponential_histogram (v:Metrics_types.exponential_histogram) encoder = @@ -1268,5 +1278,5 @@ let rec encode_metrics_data (v:Metrics_types.metrics_data) encoder = let rec encode_data_point_flags (v:Metrics_types.data_point_flags) encoder = match v with - | Metrics_types.Flag_none -> Pbrt.Encoder.int_as_varint (0) encoder - | Metrics_types.Flag_no_recorded_value -> Pbrt.Encoder.int_as_varint 1 encoder + | Metrics_types.Data_point_flags_do_not_use -> Pbrt.Encoder.int_as_varint (0) encoder + | Metrics_types.Data_point_flags_no_recorded_value_mask -> Pbrt.Encoder.int_as_varint 1 encoder diff --git a/src/metrics_pp.ml b/src/metrics_pp.ml index b0bf4a25..838343ff 100644 --- a/src/metrics_pp.ml +++ b/src/metrics_pp.ml @@ -96,6 +96,7 @@ let rec pp_exponential_histogram_data_point fmt (v:Metrics_types.exponential_his Pbrt.Pp.pp_record_field ~first:false "exemplars" (Pbrt.Pp.pp_list pp_exemplar) fmt v.Metrics_types.exemplars; Pbrt.Pp.pp_record_field ~first:false "min" (Pbrt.Pp.pp_option Pbrt.Pp.pp_float) fmt v.Metrics_types.min; Pbrt.Pp.pp_record_field ~first:false "max" (Pbrt.Pp.pp_option Pbrt.Pp.pp_float) fmt v.Metrics_types.max; + Pbrt.Pp.pp_record_field ~first:false "zero_threshold" Pbrt.Pp.pp_float fmt v.Metrics_types.zero_threshold; in Pbrt.Pp.pp_brk pp_i fmt () @@ -172,5 +173,5 @@ let rec pp_metrics_data fmt (v:Metrics_types.metrics_data) = let rec pp_data_point_flags fmt (v:Metrics_types.data_point_flags) = match v with - | Metrics_types.Flag_none -> Format.fprintf fmt "Flag_none" - | Metrics_types.Flag_no_recorded_value -> Format.fprintf fmt "Flag_no_recorded_value" + | Metrics_types.Data_point_flags_do_not_use -> Format.fprintf fmt "Data_point_flags_do_not_use" + | Metrics_types.Data_point_flags_no_recorded_value_mask -> Format.fprintf fmt "Data_point_flags_no_recorded_value_mask" diff --git a/src/metrics_types.ml b/src/metrics_types.ml index bc923ef4..4cd9c09e 100644 --- a/src/metrics_types.ml +++ b/src/metrics_types.ml @@ -79,6 +79,7 @@ type exponential_histogram_data_point = { exemplars : exemplar list; min : float option; max : float option; + zero_threshold : float; } type exponential_histogram = { @@ -136,8 +137,8 @@ type metrics_data = { } type data_point_flags = - | Flag_none - | Flag_no_recorded_value + | Data_point_flags_do_not_use + | Data_point_flags_no_recorded_value_mask let rec default_exemplar_value () : exemplar_value = As_double (0.) @@ -247,6 +248,7 @@ let rec default_exponential_histogram_data_point ?exemplars:((exemplars:exemplar list) = []) ?min:((min:float option) = None) ?max:((max:float option) = None) + ?zero_threshold:((zero_threshold:float) = 0.) () : exponential_histogram_data_point = { attributes; start_time_unix_nano; @@ -261,6 +263,7 @@ let rec default_exponential_histogram_data_point exemplars; min; max; + zero_threshold; } let rec default_exponential_histogram @@ -343,4 +346,4 @@ let rec default_metrics_data resource_metrics; } -let rec default_data_point_flags () = (Flag_none:data_point_flags) +let rec default_data_point_flags () = (Data_point_flags_do_not_use:data_point_flags) diff --git a/src/metrics_types.mli b/src/metrics_types.mli index 5e045f98..8cf43dbf 100644 --- a/src/metrics_types.mli +++ b/src/metrics_types.mli @@ -82,6 +82,7 @@ type exponential_histogram_data_point = { exemplars : exemplar list; min : float option; max : float option; + zero_threshold : float; } type exponential_histogram = { @@ -139,8 +140,8 @@ type metrics_data = { } type data_point_flags = - | Flag_none - | Flag_no_recorded_value + | Data_point_flags_do_not_use + | Data_point_flags_no_recorded_value_mask (** {2 Default values} *) @@ -233,6 +234,7 @@ val default_exponential_histogram_data_point : ?exemplars:exemplar list -> ?min:float option -> ?max:float option -> + ?zero_threshold:float -> unit -> exponential_histogram_data_point (** [default_exponential_histogram_data_point ()] is the default value for type [exponential_histogram_data_point] *) diff --git a/src/opentelemetry.ml b/src/opentelemetry.ml index 9f5690f7..481746e9 100644 --- a/src/opentelemetry.ml +++ b/src/opentelemetry.ml @@ -925,8 +925,8 @@ module Logs = struct let pp_severity = Logs_pp.pp_severity_number type flags = Logs_types.log_record_flags = - | Log_record_flag_unspecified - | Log_record_flag_trace_flags_mask + | Log_record_flags_do_not_use + | Log_record_flags_trace_flags_mask let pp_flags = Logs_pp.pp_log_record_flags