mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
Add pretty printer utils
These combinators seem tiny, but they simpflify code where they are used quite a lot.
This commit is contained in:
parent
33104f231e
commit
00840e0b88
2 changed files with 23 additions and 0 deletions
|
|
@ -61,3 +61,13 @@ module Decode = struct
|
|||
~dec:Trace_service.decode_pb_export_trace_service_request data)
|
||||
.resource_spans
|
||||
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
|
||||
|
||||
let traces = Format.pp_print_list Proto.Trace.pp_resource_spans
|
||||
end
|
||||
|
|
|
|||
|
|
@ -45,3 +45,16 @@ module Decode : sig
|
|||
|
||||
@param encoder provide an encoder state to reuse *)
|
||||
end
|
||||
|
||||
module Pp : sig
|
||||
val logs :
|
||||
Format.formatter -> Opentelemetry_proto.Logs.resource_logs list -> unit
|
||||
|
||||
val metrics :
|
||||
Format.formatter ->
|
||||
Opentelemetry_proto.Metrics.resource_metrics list ->
|
||||
unit
|
||||
|
||||
val traces :
|
||||
Format.formatter -> Opentelemetry_proto.Trace.resource_spans list -> unit
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue