diff --git a/src/client/signal.ml b/src/client/signal.ml index ebb3e460..c4c3fa11 100644 --- a/src/client/signal.ml +++ b/src/client/signal.ml @@ -5,6 +5,13 @@ module Span = Opentelemetry.Span let ( let@ ) = ( @@ ) +module Proto = Opentelemetry.Proto + +type t = + | Traces of Proto.Trace.resource_spans list + | Metrics of Proto.Metrics.resource_metrics list + | Logs of Proto.Logs.resource_logs list + module Encode = struct let resource_to_string ~encoder ~ctor ~enc resource = let encoder = @@ -63,8 +70,6 @@ module Decode = struct end module Pp = struct - module Proto = Opentelemetry.Proto - let logs = Format.pp_print_list Proto.Logs.pp_resource_logs let metrics = Format.pp_print_list Proto.Metrics.pp_resource_metrics diff --git a/src/client/signal.mli b/src/client/signal.mli index a5c25a27..7c8f7779 100644 --- a/src/client/signal.mli +++ b/src/client/signal.mli @@ -1,6 +1,16 @@ (** Constructing and managing OTel {{:https://opentelemetry.io/docs/concepts/signals/} signals} *) +(** The type of signals + + This is not the principle type of signals from the perspective of what gets + encoded and sent via protocl buffers, but it is the principle type that + collector clients needs to reason about. *) +type t = + | Traces of Opentelemetry_proto.Trace.resource_spans list + | Metrics of Opentelemetry_proto.Metrics.resource_metrics list + | Logs of Opentelemetry_proto.Logs.resource_logs list + (** Encode signals to protobuf encoded strings, ready to be sent over the wire *) module Encode : sig