mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 04:17:56 -04:00
expose Span_status types
This commit is contained in:
parent
9813ec6afc
commit
5aa5c5ed0a
1 changed files with 17 additions and 6 deletions
|
|
@ -807,17 +807,29 @@ end
|
||||||
module Span_status : sig
|
module Span_status : sig
|
||||||
open Proto.Trace
|
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
|
val make : message:string -> code:code -> t
|
||||||
end = struct
|
end = struct
|
||||||
open Proto.Trace
|
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 }
|
let make ~message ~code = { message; code }
|
||||||
end
|
end
|
||||||
|
|
@ -993,9 +1005,8 @@ end = struct
|
||||||
scope.items (links ())
|
scope.items (links ())
|
||||||
|
|
||||||
let set_status (scope : t) (status : Span_status.t) : unit =
|
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)
|
scope.items <- Span_status (status, scope.items)
|
||||||
)
|
|
||||||
|
|
||||||
let ambient_scope_key : t Ambient_context.key = Ambient_context.create_key ()
|
let ambient_scope_key : t Ambient_context.key = Ambient_context.create_key ()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue