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
|
(ocaml
|
||||||
(>= "4.08"))
|
(>= "4.08"))
|
||||||
ptime
|
ptime
|
||||||
|
hmap
|
||||||
ambient-context
|
ambient-context
|
||||||
(odoc :with-doc)
|
(odoc :with-doc)
|
||||||
(alcotest :with-test)
|
(alcotest :with-test)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ depends: [
|
||||||
"dune" {>= "2.9"}
|
"dune" {>= "2.9"}
|
||||||
"ocaml" {>= "4.08"}
|
"ocaml" {>= "4.08"}
|
||||||
"ptime"
|
"ptime"
|
||||||
|
"hmap"
|
||||||
"ambient-context"
|
"ambient-context"
|
||||||
"odoc" {with-doc}
|
"odoc" {with-doc}
|
||||||
"alcotest" {with-test}
|
"alcotest" {with-test}
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@
|
||||||
(synopsis "API for opentelemetry instrumentation")
|
(synopsis "API for opentelemetry instrumentation")
|
||||||
(flags :standard -warn-error -a+8)
|
(flags :standard -warn-error -a+8)
|
||||||
(libraries opentelemetry.proto ambient-context ptime ptime.clock.os pbrt threads
|
(libraries opentelemetry.proto ambient-context ptime ptime.clock.os pbrt threads
|
||||||
opentelemetry.atomic)
|
opentelemetry.atomic hmap)
|
||||||
(public_name opentelemetry))
|
(public_name opentelemetry))
|
||||||
|
|
|
||||||
|
|
@ -326,6 +326,11 @@ end = struct
|
||||||
let pp fmt t = Format.fprintf fmt "%s" (to_hex t)
|
let pp fmt t = Format.fprintf fmt "%s" (to_hex t)
|
||||||
end
|
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. *)
|
(** Unique ID of a span. *)
|
||||||
module Span_id : sig
|
module Span_id : sig
|
||||||
type t
|
type t
|
||||||
|
|
@ -479,6 +484,11 @@ end = struct
|
||||||
| Error msg -> invalid_arg @@ spf "invalid w3c trace context: %s" msg
|
| Error msg -> invalid_arg @@ spf "invalid w3c trace context: %s" msg
|
||||||
end
|
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} *)
|
(** {2 Attributes and conventions} *)
|
||||||
|
|
||||||
module Conventions = struct
|
module Conventions = struct
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue