package sentry

  1. Overview
  2. Docs

Module Sentry.ContextSource

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.

Sourcetype 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;
}
Sourceval sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
Sourceval default : ?max_breadcrumbs:int -> unit -> t

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

Sourceval 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.

Sourceval copy : t -> t

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

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

merge_tags tags t merges the given tags into t

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

merge_extra extra t merges the given extra data into t

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

merge_modules modules t merges the given module info into t

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

Add a breadcrumb to the context and remove older breadcrumbs

OCaml

Innovation. Community. Security.