mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-05-05 08:54:27 -04:00
feat: add dep on hmap, add standard keys
This commit is contained in:
parent
5b0bc6162e
commit
1cb53c3406
4 changed files with 13 additions and 1 deletions
|
|
@ -27,6 +27,7 @@
|
|||
(ocaml
|
||||
(>= "4.08"))
|
||||
ptime
|
||||
hmap
|
||||
ambient-context
|
||||
(odoc :with-doc)
|
||||
(alcotest :with-test)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ depends: [
|
|||
"dune" {>= "2.9"}
|
||||
"ocaml" {>= "4.08"}
|
||||
"ptime"
|
||||
"hmap"
|
||||
"ambient-context"
|
||||
"odoc" {with-doc}
|
||||
"alcotest" {with-test}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
(synopsis "API for opentelemetry instrumentation")
|
||||
(flags :standard -warn-error -a+8)
|
||||
(libraries opentelemetry.proto ambient-context ptime ptime.clock.os pbrt threads
|
||||
opentelemetry.atomic)
|
||||
opentelemetry.atomic hmap)
|
||||
(public_name opentelemetry))
|
||||
|
|
|
|||
|
|
@ -326,6 +326,11 @@ end = struct
|
|||
let pp fmt t = Format.fprintf fmt "%s" (to_hex t)
|
||||
end
|
||||
|
||||
(** Hmap key to carry around a {!Trace_id.t}, to remember what the current
|
||||
trace is.
|
||||
@since NEXT_RELEASE *)
|
||||
let k_trace_id : Trace_id.t Hmap.key = Hmap.Key.create ()
|
||||
|
||||
(** Unique ID of a span. *)
|
||||
module Span_id : sig
|
||||
type t
|
||||
|
|
@ -479,6 +484,11 @@ end = struct
|
|||
| Error msg -> invalid_arg @@ spf "invalid w3c trace context: %s" msg
|
||||
end
|
||||
|
||||
(** Hmap key to carry around a {!Span_ctx.t}, e.g. to remember what the current
|
||||
parent span is.
|
||||
@since NEXT_RELEASE *)
|
||||
let k_span_ctx : Span_ctx.t Hmap.key = Hmap.Key.create ()
|
||||
|
||||
(** {2 Attributes and conventions} *)
|
||||
|
||||
module Conventions = struct
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue