From 5aa5c5ed0a5f771d533b4aa9be088c145d3ad5a5 Mon Sep 17 00:00:00 2001 From: Corentin Leruth Date: Thu, 24 Oct 2024 09:18:39 +0200 Subject: [PATCH] expose Span_status types --- src/core/opentelemetry.ml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/core/opentelemetry.ml b/src/core/opentelemetry.ml index 8a0ce9d..0b303f7 100644 --- a/src/core/opentelemetry.ml +++ b/src/core/opentelemetry.ml @@ -807,17 +807,29 @@ end module Span_status : sig open Proto.Trace - type t = status + type t = status = { + message: string; + code: status_status_code; + } - type code = status_status_code + type code = status_status_code = + | Status_code_unset + | Status_code_ok + | Status_code_error val make : message:string -> code:code -> t end = struct open Proto.Trace - type t = status + type t = status = { + message: string; + code: status_status_code; + } - type code = status_status_code + type code = status_status_code = + | Status_code_unset + | Status_code_ok + | Status_code_error let make ~message ~code = { message; code } end @@ -993,9 +1005,8 @@ end = struct scope.items (links ()) let set_status (scope : t) (status : Span_status.t) : unit = - if Collector.has_backend () then ( + if Collector.has_backend () then scope.items <- Span_status (status, scope.items) - ) let ambient_scope_key : t Ambient_context.key = Ambient_context.create_key ()