From b75d66caee000749336425a9ceee479d2defe10c Mon Sep 17 00:00:00 2001 From: c-cube Date: Wed, 11 Feb 2026 01:45:18 +0000 Subject: [PATCH] deploy: 627164afd00a992d070d077897d43189ee7e7515 --- trace/Trace/index.html | 14 +++++++------- trace/Trace_core/Collector/index.html | 2 +- trace/Trace_core/Core_ext/index.html | 2 +- trace/Trace_core/index.html | 14 +++++++------- trace/Trace_simple/Simple_span/index.html | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/trace/Trace/index.html b/trace/Trace/index.html index 91893ca..997b2b5 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 NEXT_RELEASE
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 NEXT_RELEASE
type metric = Trace_core.metric = ..

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

  • since NEXT_RELEASE
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

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 -> @@ -9,7 +9,7 @@ ?data:(unit -> (string * user_data) list) -> string -> (span -> 'a) -> - 'a

with_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.

This is the recommended way to instrument most code.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since NEXT_RELEASE.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since NEXT_RELEASE.

Depending on the collector, this might clash with some forms of cooperative concurrency in which with_span (fun span -> …) might contain a yield point. Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, a safer alternative can be enter_span.

val enter_span : + 'a

with_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.

This is the recommended way to instrument most code.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since 0.11.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since 0.11.

Depending on the collector, this might clash with some forms of cooperative concurrency in which with_span (fun span -> …) might contain a yield point. Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, a safer alternative can be enter_span.

val enter_span : ?level:Level.t -> ?__FUNCTION__:string -> __FILE__:string -> @@ -19,25 +19,25 @@ ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> string -> - span

Enter a span manually. This means the caller is responsible for exiting the span exactly once on every path that exits the current scope. The context must be passed to the exit function as is.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since NEXT_RELEASE.

val exit_span : span -> unit

Exit a span manually. Spans must be nested correctly (ie form a stack or tree).

For some collectors, enter_span and exit_span must run on the same thread (e.g. Tracy). For some others, it doesn't matter.

val add_data_to_span : span -> (string * user_data) list -> unit

Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.

  • since 0.4
val message : + span

Enter a span manually. This means the caller is responsible for exiting the span exactly once on every path that exits the current scope. The context must be passed to the exit function as is.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since 0.11.

val exit_span : span -> unit

Exit a span manually. Spans must be nested correctly (ie form a stack or tree).

For some collectors, enter_span and exit_span must run on the same thread (e.g. Tracy). For some others, it doesn't matter.

val add_data_to_span : span -> (string * user_data) list -> unit

Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.

  • since 0.4
val message : ?level:Level.t -> ?span:span -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> string -> - unit

message msg logs a message msg (if a collector is installed). Additional metadata can be provided.

  • parameter level

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

  • parameter span

    the surrounding span, if any. This might be ignored by the collector.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since NEXT_RELEASE.

val messagef : + unit

message msg logs a message msg (if a collector is installed). Additional metadata can be provided.

  • parameter level

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

  • parameter span

    the surrounding span, if any. This might be ignored by the collector.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since 0.11.

val messagef : ?level:Level.t -> ?span:span -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> ((('a, Stdlib.Format.formatter, unit, unit) format4 -> 'a) -> unit) -> - unit

messagef (fun k->k"hello %s %d!" "world" 42) is like message "hello world 42!" but only computes the string formatting if a collector is installed.

See message for a description of the other arguments.

val set_thread_name : string -> unit

Give a name to the current thread. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_thread_name since NEXT_RELEASE

val set_process_name : string -> unit

Give a name to the current process. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_process_name since NEXT_RELEASE

val metric : + unit

messagef (fun k->k"hello %s %d!" "world" 42) is like message "hello world 42!" but only computes the string formatting if a collector is installed.

See message for a description of the other arguments.

val set_thread_name : string -> unit

Give a name to the current thread. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_thread_name since 0.11

val set_process_name : string -> unit

Give a name to the current process. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_process_name since 0.11

val metric : ?level:Level.t -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> string -> metric -> - unit

Emit a metric. Metrics are an extensible type, each collector might support a different subset.

  • since NEXT_RELEASE
val counter_int : + unit

Emit a metric. Metrics are an extensible type, each collector might support a different subset.

  • since 0.11
val counter_int : ?level:Level.t -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> @@ -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)

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 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 NEXT_RELEASE

  • 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)

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 : parent:explicit_span_ctx option -> ?flavor:[ `Sync | `Async ] -> ?level:Level.t -> diff --git a/trace/Trace_core/Collector/index.html b/trace/Trace_core/Collector/index.html index 109c0ef..15cb01f 100644 --- a/trace/Trace_core/Collector/index.html +++ b/trace/Trace_core/Collector/index.html @@ -1,2 +1,2 @@ -Collector (trace.Trace_core.Collector)

Module Trace_core.Collector

A global collector.

The collector, if present, is responsible for collecting messages and spans, and storing them, recording them, forward them, or offering them to other services and processes.

type Trace_core__.Types.span +=
  1. | Span_dummy
val dummy_span : Trace_core__.Types.span

A fake span that never emits data. All collectors should handle this span by doing nothing.

module Callbacks : sig ... end
type t =
  1. | C_none
    (*

    No collector.

    *)
  2. | C_some : 'st * 'st Callbacks.t -> t
    (*

    Collector with a state and some callbacks.

    *)

Definition of a collector.

This is only relevant to implementors of tracing backends; to instrument your code you only need to look at the Trace module.

The definition changed since NEXT_RELEASE to a record of callbacks + a state

val is_some : t -> bool
+Collector (trace.Trace_core.Collector)

Module Trace_core.Collector

A global collector.

The collector, if present, is responsible for collecting messages and spans, and storing them, recording them, forward them, or offering them to other services and processes.

type Trace_core__.Types.span +=
  1. | Span_dummy
val dummy_span : Trace_core__.Types.span

A fake span that never emits data. All collectors should handle this span by doing nothing.

module Callbacks : sig ... end
type t =
  1. | C_none
    (*

    No collector.

    *)
  2. | C_some : 'st * 'st Callbacks.t -> t
    (*

    Collector with a state and some callbacks.

    *)

Definition of a collector.

This is only relevant to implementors of tracing backends; to instrument your code you only need to look at the Trace module.

The definition changed since 0.11 to a record of callbacks + a state

val is_some : t -> bool
diff --git a/trace/Trace_core/Core_ext/index.html b/trace/Trace_core/Core_ext/index.html index 6f2663e..40a1483 100644 --- a/trace/Trace_core/Core_ext/index.html +++ b/trace/Trace_core/Core_ext/index.html @@ -1,2 +1,2 @@ -Core_ext (trace.Trace_core.Core_ext)

Module Trace_core.Core_ext

A few core extensions.

  • since NEXT_RELEASE
type Trace_core__.Types.extension_event +=
  1. | Extension_set_thread_name of string
  2. | Extension_set_process_name of string

Additional extensions

type Trace_core__.Types.extension_parameter +=
  1. | Extension_span_flavor of [ `Async | `Sync ]
    (*

    Tell the backend if this is a sync or async span

    *)

Specialized parameters

type Trace_core__.Types.metric +=
  1. | Metric_int of int
    (*

    Int counter or gauge, supported by tracy, TEF, etc

    *)
  2. | Metric_float of float
    (*

    Float counter or gauge, supported by tracy, TEF, etc

    *)
+Core_ext (trace.Trace_core.Core_ext)

Module Trace_core.Core_ext

A few core extensions.

  • since 0.11
type Trace_core__.Types.extension_event +=
  1. | Extension_set_thread_name of string
  2. | Extension_set_process_name of string

Additional extensions

type Trace_core__.Types.extension_parameter +=
  1. | Extension_span_flavor of [ `Async | `Sync ]
    (*

    Tell the backend if this is a sync or async span

    *)

Specialized parameters

type Trace_core__.Types.metric +=
  1. | Metric_int of int
    (*

    Int counter or gauge, supported by tracy, TEF, etc

    *)
  2. | Metric_float of float
    (*

    Float counter or gauge, supported by tracy, TEF, etc

    *)
diff --git a/trace/Trace_core/index.html b/trace/Trace_core/index.html index 936e543..4d39835 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 NEXT_RELEASE
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 NEXT_RELEASE
type metric = ..

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

  • since NEXT_RELEASE
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.

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 -> @@ -9,7 +9,7 @@ ?data:(unit -> (string * user_data) list) -> string -> (span -> 'a) -> - 'a

with_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.

This is the recommended way to instrument most code.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since NEXT_RELEASE.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since NEXT_RELEASE.

Depending on the collector, this might clash with some forms of cooperative concurrency in which with_span (fun span -> …) might contain a yield point. Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, a safer alternative can be enter_span.

val enter_span : + 'a

with_span ~__FILE__ ~__LINE__ name f enters a new span sp, and calls f sp. sp might be a dummy span if no collector is installed. When f sp returns or raises, the span sp is exited.

This is the recommended way to instrument most code.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since 0.11.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since 0.11.

Depending on the collector, this might clash with some forms of cooperative concurrency in which with_span (fun span -> …) might contain a yield point. Effect-based fibers, etc. might not play well with this style of spans on some or all backends. If you use cooperative concurrency, a safer alternative can be enter_span.

val enter_span : ?level:Level.t -> ?__FUNCTION__:string -> __FILE__:string -> @@ -19,25 +19,25 @@ ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> string -> - span

Enter a span manually. This means the caller is responsible for exiting the span exactly once on every path that exits the current scope. The context must be passed to the exit function as is.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since NEXT_RELEASE.

val exit_span : span -> unit

Exit a span manually. Spans must be nested correctly (ie form a stack or tree).

For some collectors, enter_span and exit_span must run on the same thread (e.g. Tracy). For some others, it doesn't matter.

val add_data_to_span : span -> (string * user_data) list -> unit

Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.

  • since 0.4
val message : + span

Enter a span manually. This means the caller is responsible for exiting the span exactly once on every path that exits the current scope. The context must be passed to the exit function as is.

  • parameter level

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

  • parameter parent

    the span's parent, if any. since 0.11.

val exit_span : span -> unit

Exit a span manually. Spans must be nested correctly (ie form a stack or tree).

For some collectors, enter_span and exit_span must run on the same thread (e.g. Tracy). For some others, it doesn't matter.

val add_data_to_span : span -> (string * user_data) list -> unit

Add structured data to the given active span (see with_span). Behavior is not specified if the span has been exited.

  • since 0.4
val message : ?level:Level.t -> ?span:span -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> string -> - unit

message msg logs a message msg (if a collector is installed). Additional metadata can be provided.

  • parameter level

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

  • parameter span

    the surrounding span, if any. This might be ignored by the collector.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since NEXT_RELEASE.

val messagef : + unit

message msg logs a message msg (if a collector is installed). Additional metadata can be provided.

  • parameter level

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

  • parameter span

    the surrounding span, if any. This might be ignored by the collector.

  • parameter params

    extension parameters, used to communicate additional information to the collector. It might be collector-specific. since 0.11.

val messagef : ?level:Level.t -> ?span:span -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> ((('a, Stdlib.Format.formatter, unit, unit) format4 -> 'a) -> unit) -> - unit

messagef (fun k->k"hello %s %d!" "world" 42) is like message "hello world 42!" but only computes the string formatting if a collector is installed.

See message for a description of the other arguments.

val set_thread_name : string -> unit

Give a name to the current thread. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_thread_name since NEXT_RELEASE

val set_process_name : string -> unit

Give a name to the current process. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_process_name since NEXT_RELEASE

val metric : + unit

messagef (fun k->k"hello %s %d!" "world" 42) is like message "hello world 42!" but only computes the string formatting if a collector is installed.

See message for a description of the other arguments.

val set_thread_name : string -> unit

Give a name to the current thread. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_thread_name since 0.11

val set_process_name : string -> unit

Give a name to the current process. This might be used by the collector to display traces in a more informative way.

Uses Core_ext.Extension_set_process_name since 0.11

val metric : ?level:Level.t -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> string -> metric -> - unit

Emit a metric. Metrics are an extensible type, each collector might support a different subset.

  • since NEXT_RELEASE
val counter_int : + unit

Emit a metric. Metrics are an extensible type, each collector might support a different subset.

  • since 0.11
val counter_int : ?level:Level.t -> ?params:extension_parameter list -> ?data:(unit -> (string * user_data) list) -> @@ -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)

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 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 NEXT_RELEASE

  • 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)

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 : parent:explicit_span_ctx option -> ?flavor:[ `Sync | `Async ] -> ?level:Level.t -> diff --git a/trace/Trace_simple/Simple_span/index.html b/trace/Trace_simple/Simple_span/index.html index 09798be..7f1ad4c 100644 --- a/trace/Trace_simple/Simple_span/index.html +++ b/trace/Trace_simple/Simple_span/index.html @@ -1,2 +1,2 @@ -Simple_span (trace.Trace_simple.Simple_span)

Module Trace_simple.Simple_span

A simple span.

This is a concrete representation of spans that is convenient to manipulate.

  • since NEXT_RELEASE
type span_flavor = [
  1. | `Sync
  2. | `Async
]
type t = {
  1. name : string;
  2. __FUNCTION__ : string option;
  3. __FILE__ : string;
  4. __LINE__ : int;
  5. time_ns : int64;
    (*

    Time the span was entered.

    *)
  6. mutable time_exit_ns : int64;
    (*

    Time the span was exited. Set at exit, Int64.max_int otherwise

    *)
  7. tid : int;
    (*

    Thread in which span was created

    *)
  8. trace_id : int64;
    (*

    For async spans

    *)
  9. parent : Trace_core.parent;
  10. flavor : span_flavor;
  11. params : Trace_core.extension_parameter list;
  12. mutable data : (string * Trace_core.user_data) list;
    (*

    Modified by add_data_to_span

    *)
}

The type of spans used by all subscribers.

type Trace_core.span +=
  1. | Span_simple of t
    (*

    How to turn a Simple_span.t into a span.

    *)
+Simple_span (trace.Trace_simple.Simple_span)

Module Trace_simple.Simple_span

A simple span.

This is a concrete representation of spans that is convenient to manipulate.

  • since 0.11
type span_flavor = [
  1. | `Sync
  2. | `Async
]
type t = {
  1. name : string;
  2. __FUNCTION__ : string option;
  3. __FILE__ : string;
  4. __LINE__ : int;
  5. time_ns : int64;
    (*

    Time the span was entered.

    *)
  6. mutable time_exit_ns : int64;
    (*

    Time the span was exited. Set at exit, Int64.max_int otherwise

    *)
  7. tid : int;
    (*

    Thread in which span was created

    *)
  8. trace_id : int64;
    (*

    For async spans

    *)
  9. parent : Trace_core.parent;
  10. flavor : span_flavor;
  11. params : Trace_core.extension_parameter list;
  12. mutable data : (string * Trace_core.user_data) list;
    (*

    Modified by add_data_to_span

    *)
}

The type of spans used by all subscribers.

type Trace_core.span +=
  1. | Span_simple of t
    (*

    How to turn a Simple_span.t into a span.

    *)