Skip to content

Commit

Permalink
expose Span_status types
Browse files Browse the repository at this point in the history
  • Loading branch information
tatchi authored and c-cube committed Oct 24, 2024
1 parent 9813ec6 commit 5aa5c5e
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/core/opentelemetry.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ()

Expand Down

0 comments on commit 5aa5c5e

Please sign in to comment.