diff --git a/trace/Trace/index.html b/trace/Trace/index.html index 9a085ca..621b87f 100644 --- a/trace/Trace/index.html +++ b/trace/Trace/index.html @@ -1,5 +1,5 @@ -Trace (trace.Trace)

Module Trace

Shim that just forwards to Trace_core.

The reason is, Trace is already defined in the compiler libs and can clash with this module inside a toplevel. So it's safer to only depend on Trace_core in libraries that might end up used in a toplevel.

include module type of struct include Trace_core end
type span = Trace_core.span = ..

A span. Its representation is defined by the current collector.

type parent = Trace_core.parent =
  1. | P_unknown
    (*

    Parent is not specified at this point

    *)
  2. | P_none
    (*

    We know the current span has no parent

    *)
  3. | P_some of span
    (*

    We know the parent of the current span

    *)

Information about a span's parent span, if any.

  • since 0.11
type user_data = [
  1. | `Int of int
  2. | `String of string
  3. | `Bool of bool
  4. | `Float of float
  5. | `None
]

User defined data, generally passed as key/value pairs to whatever collector is installed (if any).

type explicit_span = span
  • deprecated use span
type explicit_span_ctx = span
  • deprecated use span
type extension_parameter = Trace_core.extension_parameter = ..

An extension parameter, used to carry information for spans/messages/metrics that can be backend-specific or just not envisioned by trace.

  • since 0.11
type metric = Trace_core.metric = ..

A metric, can be of many types. See Core_ext for some builtin metrics.

  • since 0.11
module Collector = Trace_core.Collector
module Level = Trace_core.Level

Tracing

val enabled : unit -> bool

Is there a collector?

This is fast, so that the traced program can check it before creating any span or message.

val get_default_level : unit -> Level.t

Current default level for spans.

  • since 0.7
val set_default_level : Level.t -> unit

Set level used for spans that do not specify it. The default default value is Level.Trace.

  • since 0.7
val with_span : +Trace (trace.Trace)

Module Trace

Shim that just forwards to Trace_core.

The reason is, Trace is already defined in the compiler libs and can clash with this module inside a toplevel. So it's safer to only depend on Trace_core in libraries that might end up used in a toplevel.

include module type of struct include Trace_core end
type span = Trace_core.span = ..

A span. Its representation is defined by the current collector.

type parent = Trace_core.parent =
  1. | P_unknown
    (*

    Parent is not specified at this point

    *)
  2. | P_none
    (*

    We know the current span has no parent

    *)
  3. | P_some of span
    (*

    We know the parent of the current span

    *)

Information about a span's parent span, if any.

  • since 0.11
type user_data = [
  1. | `Int of int
  2. | `String of string
  3. | `Bool of bool
  4. | `Float of float
  5. | `None
]

User defined data, generally passed as key/value pairs to whatever collector is installed (if any).

type explicit_span = span
  • deprecated use span
type explicit_span_ctx = span
  • deprecated use span
type extension_parameter = Trace_core.extension_parameter = ..

An extension parameter, used to carry information for spans/messages/metrics that can be backend-specific or just not envisioned by trace.

  • since 0.11
type metric = Trace_core.metric = ..

A metric, can be of many types. See Core_ext for some builtin metrics.

  • since 0.11
module Collector = Trace_core.Collector
module Level = Trace_core.Level
module Ambient_span_provider = Trace_core.Ambient_span_provider

Tracing

val enabled : unit -> bool

Is there a collector?

This is fast, so that the traced program can check it before creating any span or message.

val get_default_level : unit -> Level.t

Current default level for spans.

  • since 0.7
val set_default_level : Level.t -> unit

Set level used for spans that do not specify it. The default default value is Level.Trace.

  • since 0.7
val with_span : ?level:Level.t -> ?__FUNCTION__:string -> __FILE__:string -> @@ -49,7 +49,7 @@ ?data:(unit -> (string * user_data) list) -> string -> float -> - unit

Emit a counter of type float via metric. See counter_int for more details.

  • parameter level

    optional level for this span. since 0.7. Default is set via set_default_level.

  • parameter data

    metadata for this metric (since 0.4)

val current_span : unit -> span option

Access the current span from some ambient scope, if supported. This is only supported if a Ambient_span_provider has been set up.

  • since NEXT_RELEASE
val with_current_span_set_to : span -> (span -> 'a) -> 'a

with_current_span_set_to span f sets the span as current span, enters f span, and restores the previous current span (if any).

This is only supported if a Ambient_span_provider has been set up, otherwise it is a no-op.

Automatically called by with_span.

  • since NEXT_RELEASE

Collector

type collector = Collector.t

An event collector. See Collector for more details.

val setup_collector : collector -> unit

setup_collector c installs c as the current collector.

  • raises Invalid_argument

    if there already is an established collector.

val get_current_level : unit -> Level.t

Get current level. This is only meaningful if a collector was set up with setup_collector.

  • since 0.7
val set_current_level : Level.t -> unit

Set the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.

  • since 0.7
val shutdown : unit -> unit

shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.

val with_setup_collector : Collector.t -> (unit -> 'a) -> 'a

with_setup_collector c f installs c, calls f(), and shutdowns c once f() is done.

  • since 0.11

Extensions

type extension_event = ..

Extension event

  • since 0.8
val extension_event : ?level:Level.t -> extension_event -> unit

Trigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.

  • parameter level

    filtering level, since 0.11

  • since 0.8

Core extensions

module Core_ext = Trace_core.Core_ext

Deprecated

val enter_manual_span : + unit

Emit a counter of type float via metric. See counter_int for more details.

  • parameter level

    optional level for this span. since 0.7. Default is set via set_default_level.

  • parameter data

    metadata for this metric (since 0.4)

val current_span : unit -> span option

Access the current span from some ambient scope, if supported. This is only supported if a Ambient_span_provider has been set up.

  • since NEXT_RELEASE
val with_current_span_set_to : span -> (span -> 'a) -> 'a

with_current_span_set_to span f sets the span as current span, enters f span, and restores the previous current span (if any).

This is only supported if a Ambient_span_provider has been set up, otherwise it is a no-op.

Automatically called by with_span.

  • since NEXT_RELEASE

Collector

type collector = Collector.t

An event collector. See Collector for more details.

val setup_collector : collector -> unit

setup_collector c installs c as the current collector.

  • raises Invalid_argument

    if there already is an established collector.

val get_current_level : unit -> Level.t

Get current level. This is only meaningful if a collector was set up with setup_collector.

  • since 0.7
val set_current_level : Level.t -> unit

Set the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.

  • since 0.7
val shutdown : unit -> unit

shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.

val with_setup_collector : Collector.t -> (unit -> 'a) -> 'a

with_setup_collector c f installs c, calls f(), and shutdowns c once f() is done.

  • since 0.11

ambient span provider

val set_ambient_context_provider : Ambient_span_provider.t -> unit

Install a provider for current_span and with_current_span_set_to. The default provider does nothing (ie current_span () is always None).

  • since NEXT_RELEASE

Extensions

type extension_event = ..

Extension event

  • since 0.8
val extension_event : ?level:Level.t -> extension_event -> unit

Trigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.

  • parameter level

    filtering level, since 0.11

  • since 0.8

Core extensions

module Core_ext = Trace_core.Core_ext

Deprecated

val enter_manual_span : parent:explicit_span_ctx option -> ?flavor:[ `Sync | `Async ] -> ?level:Level.t -> diff --git a/trace/Trace_core/Ambient_span_provider/Callbacks/index.html b/trace/Trace_core/Ambient_span_provider/Callbacks/index.html new file mode 100644 index 0000000..e51a43e --- /dev/null +++ b/trace/Trace_core/Ambient_span_provider/Callbacks/index.html @@ -0,0 +1,5 @@ + +Callbacks (trace.Trace_core.Ambient_span_provider.Callbacks)

Module Ambient_span_provider.Callbacks

type 'st t = {
  1. with_current_span_set_to : 'a. 'st -> + Trace_core__.Types.span -> + (Trace_core__.Types.span -> 'a) -> + 'a;
    (*

    with_current_span_set_to span f sets the span as current span, enters f span, and restores the previous current span if any

    *)
  2. get_current_span : 'st -> Trace_core__.Types.span option;
    (*

    Access the current span from some ambient scope. This is only supported for collectors that provide a current_span_wrap field.

    *)
}
diff --git a/trace/Trace_core/Ambient_span_provider/index.html b/trace/Trace_core/Ambient_span_provider/index.html new file mode 100644 index 0000000..b81cd1e --- /dev/null +++ b/trace/Trace_core/Ambient_span_provider/index.html @@ -0,0 +1,2 @@ + +Ambient_span_provider (trace.Trace_core.Ambient_span_provider)

Module Trace_core.Ambient_span_provider

Access/set the current span from some ambient context.

  • since NEXT_RELEASE
module Callbacks : sig ... end
type t =
  1. | ASP_none
  2. | ASP_some : 'st * 'st Callbacks.t -> t
diff --git a/trace/Trace_core/index.html b/trace/Trace_core/index.html index 30a1d42..27da808 100644 --- a/trace/Trace_core/index.html +++ b/trace/Trace_core/index.html @@ -1,5 +1,5 @@ -Trace_core (trace.Trace_core)

Module Trace_core

Main tracing interface.

This interface is intended to be lightweight and usable in both libraries and applications. It has very low overhead if no Collector.t is installed.

type span = ..

A span. Its representation is defined by the current collector.

type parent =
  1. | P_unknown
    (*

    Parent is not specified at this point

    *)
  2. | P_none
    (*

    We know the current span has no parent

    *)
  3. | P_some of span
    (*

    We know the parent of the current span

    *)

Information about a span's parent span, if any.

  • since 0.11
type user_data = [
  1. | `Int of int
  2. | `String of string
  3. | `Bool of bool
  4. | `Float of float
  5. | `None
]

User defined data, generally passed as key/value pairs to whatever collector is installed (if any).

type explicit_span = span
  • deprecated use span
type explicit_span_ctx = span
  • deprecated use span
type extension_parameter = ..

An extension parameter, used to carry information for spans/messages/metrics that can be backend-specific or just not envisioned by trace.

  • since 0.11
type metric = ..

A metric, can be of many types. See Core_ext for some builtin metrics.

  • since 0.11
module Collector : sig ... end

A global collector.

module Level : sig ... end

Tracing levels.

Tracing

val enabled : unit -> bool

Is there a collector?

This is fast, so that the traced program can check it before creating any span or message.

val get_default_level : unit -> Level.t

Current default level for spans.

  • since 0.7
val set_default_level : Level.t -> unit

Set level used for spans that do not specify it. The default default value is Level.Trace.

  • since 0.7
val with_span : +Trace_core (trace.Trace_core)

Module Trace_core

Main tracing interface.

This interface is intended to be lightweight and usable in both libraries and applications. It has very low overhead if no Collector.t is installed.

type span = ..

A span. Its representation is defined by the current collector.

type parent =
  1. | P_unknown
    (*

    Parent is not specified at this point

    *)
  2. | P_none
    (*

    We know the current span has no parent

    *)
  3. | P_some of span
    (*

    We know the parent of the current span

    *)

Information about a span's parent span, if any.

  • since 0.11
type user_data = [
  1. | `Int of int
  2. | `String of string
  3. | `Bool of bool
  4. | `Float of float
  5. | `None
]

User defined data, generally passed as key/value pairs to whatever collector is installed (if any).

type explicit_span = span
  • deprecated use span
type explicit_span_ctx = span
  • deprecated use span
type extension_parameter = ..

An extension parameter, used to carry information for spans/messages/metrics that can be backend-specific or just not envisioned by trace.

  • since 0.11
type metric = ..

A metric, can be of many types. See Core_ext for some builtin metrics.

  • since 0.11
module Collector : sig ... end

A global collector.

module Level : sig ... end

Tracing levels.

module Ambient_span_provider : sig ... end

Access/set the current span from some ambient context.

Tracing

val enabled : unit -> bool

Is there a collector?

This is fast, so that the traced program can check it before creating any span or message.

val get_default_level : unit -> Level.t

Current default level for spans.

  • since 0.7
val set_default_level : Level.t -> unit

Set level used for spans that do not specify it. The default default value is Level.Trace.

  • since 0.7
val with_span : ?level:Level.t -> ?__FUNCTION__:string -> __FILE__:string -> @@ -49,7 +49,7 @@ ?data:(unit -> (string * user_data) list) -> string -> float -> - unit

Emit a counter of type float via metric. See counter_int for more details.

  • parameter level

    optional level for this span. since 0.7. Default is set via set_default_level.

  • parameter data

    metadata for this metric (since 0.4)

val current_span : unit -> span option

Access the current span from some ambient scope, if supported. This is only supported if a Ambient_span_provider has been set up.

  • since NEXT_RELEASE
val with_current_span_set_to : span -> (span -> 'a) -> 'a

with_current_span_set_to span f sets the span as current span, enters f span, and restores the previous current span (if any).

This is only supported if a Ambient_span_provider has been set up, otherwise it is a no-op.

Automatically called by with_span.

  • since NEXT_RELEASE

Collector

type collector = Collector.t

An event collector. See Collector for more details.

val setup_collector : collector -> unit

setup_collector c installs c as the current collector.

  • raises Invalid_argument

    if there already is an established collector.

val get_current_level : unit -> Level.t

Get current level. This is only meaningful if a collector was set up with setup_collector.

  • since 0.7
val set_current_level : Level.t -> unit

Set the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.

  • since 0.7
val shutdown : unit -> unit

shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.

val with_setup_collector : Collector.t -> (unit -> 'a) -> 'a

with_setup_collector c f installs c, calls f(), and shutdowns c once f() is done.

  • since 0.11

Extensions

type extension_event = ..

Extension event

  • since 0.8
val extension_event : ?level:Level.t -> extension_event -> unit

Trigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.

  • parameter level

    filtering level, since 0.11

  • since 0.8

Core extensions

module Core_ext : sig ... end

A few core extensions.

Deprecated

val enter_manual_span : + unit

Emit a counter of type float via metric. See counter_int for more details.

  • parameter level

    optional level for this span. since 0.7. Default is set via set_default_level.

  • parameter data

    metadata for this metric (since 0.4)

val current_span : unit -> span option

Access the current span from some ambient scope, if supported. This is only supported if a Ambient_span_provider has been set up.

  • since NEXT_RELEASE
val with_current_span_set_to : span -> (span -> 'a) -> 'a

with_current_span_set_to span f sets the span as current span, enters f span, and restores the previous current span (if any).

This is only supported if a Ambient_span_provider has been set up, otherwise it is a no-op.

Automatically called by with_span.

  • since NEXT_RELEASE

Collector

type collector = Collector.t

An event collector. See Collector for more details.

val setup_collector : collector -> unit

setup_collector c installs c as the current collector.

  • raises Invalid_argument

    if there already is an established collector.

val get_current_level : unit -> Level.t

Get current level. This is only meaningful if a collector was set up with setup_collector.

  • since 0.7
val set_current_level : Level.t -> unit

Set the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.

  • since 0.7
val shutdown : unit -> unit

shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.

val with_setup_collector : Collector.t -> (unit -> 'a) -> 'a

with_setup_collector c f installs c, calls f(), and shutdowns c once f() is done.

  • since 0.11

ambient span provider

val set_ambient_context_provider : Ambient_span_provider.t -> unit

Install a provider for current_span and with_current_span_set_to. The default provider does nothing (ie current_span () is always None).

  • since NEXT_RELEASE

Extensions

type extension_event = ..

Extension event

  • since 0.8
val extension_event : ?level:Level.t -> extension_event -> unit

Trigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.

  • parameter level

    filtering level, since 0.11

  • since 0.8

Core extensions

module Core_ext : sig ... end

A few core extensions.

Deprecated

val enter_manual_span : parent:explicit_span_ctx option -> ?flavor:[ `Sync | `Async ] -> ?level:Level.t ->