package sentry

  1. Overview
  2. Docs

A context is a set of tags and breadcrumbs attached to an event https://docs.sentry.io/clientdev/context/

Note that contexts are mutable to make it easier to add tags and breadcrumbs.

type t = {
  1. mutable environment : string option;
  2. mutable release : string option;
  3. mutable server_name : string option;
  4. tags : string Core_kernel.String.Table.t;
  5. extra : Yojson.Basic.json Core_kernel.String.Table.t;
  6. modules : string Core_kernel.String.Table.t;
  7. breadcrumbs : Breadcrumb.t Core_kernel.Queue.t;
}
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val default : ?max_breadcrumbs:int -> unit -> t

Returns a new context with default data from the environment and system calls.

val empty : ?max_breadcrumbs:int -> unit -> t

Returns a new context with no tags or breadcrumbs. You probably want to use default () or copying the parent context in most cases.

val copy : t -> t

Copy a context so you can add / clear data without affecting the original

val merge_tags : (string * string) list -> t -> unit

merge_tags tags t merges the given tags into t

val merge_extra : (string * Yojson.Basic.json) list -> t -> unit

merge_extra extra t merges the given extra data into t

val merge_modules : (string * string) list -> t -> unit

merge_modules modules t merges the given module info into t

val add_breadcrumb : Breadcrumb.t -> t -> unit

Add a breadcrumb to the context and remove older breadcrumbs

OCaml

Innovation. Community. Security.