lisp-sentry
0.2.1A full-featured Common Lisp client library for Sentry application monitoring software.
System Information
Definition Index
-
LISP-SENTRY
NOTE: this software is of alpha quality, and the API is subject to change.
lisp-sentryis a full-featured Common Lisp client library for Sentry, specifically designed to properly function in dumped Lisp images.Sentry is application monitoring software which helps developers diagnose, fix, and optimize the performance of their code.
The key entrypoint of this library is
WITH-SENTRYmacro, which initializes library settings and runs given body of code withinHANDLER-BINDwhich catches unhandled conditions and sends information on those to Sentry; this is called capturing in Sentry argot.You can also initialize settings by calling
INIT!and handle conditions manually, setting*EXCEPTION-HANDLED*and capturing them withMAYBE-CAPTURE-CONDITION.There's also lower-level API that allows to manually create event envelope by
MAKE-ENVELOPE, add the event withMAKE-CONDITION-EVENTor evenMAKE-MESSAGE-EVENTand capture it by callingCAPTURE.Another extension point of the library is
*PROCESS-BEFORE-SEND*callback where you can modify the envelope to be sent, by e.g. adding file attachments viaMAKE-ATTACHMENTor user comments viaMAKE-USER-REPORT.The most important setting is
*DSN*, which controls the Sentry instance that'll receive the reports sent by the library. If not set in code, theWITH-SENTRYmacro will try to useSENTRY_DSNenvironment variable. If DSN is unset, the library will silently discard the captured data.By default, the library does not capture conditions from interactive sessions. To do so, set
*CAPTURE-CONDITIONS-OUTSIDE-DUMPED-IMAGE*toT.-
EXTERNAL SPECIAL-VARIABLE *APP-BUILD*
Default internal build identifier, as it appears on the platform.
-
EXTERNAL SPECIAL-VARIABLE *APP-NAME*
Default human readable application name, as it appears on the platform.
-
EXTERNAL SPECIAL-VARIABLE *APP-VERSION*
Default human readable application version, as it appears on the platform.
-
EXTERNAL SPECIAL-VARIABLE *BUILD-TYPE*
Default string identifying the kind of build. For example,
testflight. -
EXTERNAL SPECIAL-VARIABLE *CAPTURE-CONDITIONS-OUTSIDE-DUMPED-IMAGE*
-
EXTERNAL SPECIAL-VARIABLE *DIST*
The distribution of the application. Distributions are used to disambiguate build or deployment variants of the same release of an application. For example, the dist can be the build number of an Xcode build or the version code of an Android build. Defaults to
NIL. -
EXTERNAL SPECIAL-VARIABLE *DSN*
Sentry DSN string. If that variable is unset, the SDK will just not send any events.
-
EXTERNAL SPECIAL-VARIABLE *ENVIRONMENT*
The environment name, such as
productionorstaging. Defaults toproduction. -
EXTERNAL SPECIAL-VARIABLE *EXCEPTION-HANDLED*
A global boolean flag indicating whether the currently processed condition was handled. Defaults to
NIL. -
EXTERNAL SPECIAL-VARIABLE *PROCESS-BEFORE-SEND*
-
EXTERNAL SPECIAL-VARIABLE *PROJECT-PACKAGE*
Name of the project package. Used to determine whether the stack frame is related to the app. Defaults to
NIL. -
EXTERNAL SPECIAL-VARIABLE *PROJECT-ROOT*
Absolute path to the project directory. Defaults to
NIL. -
EXTERNAL SPECIAL-VARIABLE *RELEASE*
The release version of the application. Release versions must be unique across all projects in your organization. This value can be the git SHA for the given project, or a product identifier with a semantic version (suggested format
my-project-name@1.0.0). Defaults toNIL. -
EXTERNAL SPECIAL-VARIABLE *SERVER-NAME*
Name of the device, typically a hostname. Defaults to
NIL. -
EXTERNAL SPECIAL-VARIABLE *SOURCES*
To display source code in Sentry stack traces, the source code should be saved somewhere, since the dumped Lisp image most probably wouldn't run on the same machine it was built on. This variable holds source files saved on build time.
-
EXTERNAL SPECIAL-VARIABLE *STARTUP-TIME*
Timestamp when the user started the application.
-
EXTERNAL SPECIAL-VARIABLE *VARIABLE-ELISION-LENGTH*
If set to non-
NIL, limits the length of variable values displayed in Sentry stack traces. Emacs Sly's default is 200 which is reasonable value. Defaults toNIL. -
EXTERNAL STRUCTURE APP-CONTEXT
App context describes the application. As opposed to the runtime, this is the actual application that was running and carries metadata about the current session.
See
MAKE-APP-CONTEXT -
EXTERNAL STRUCTURE ATTACHMENT
Attachment Item contains a raw payload of an attachment file. It is always associated to an event or transaction.
See
MAKE-ATTACHMENT -
EXTERNAL STRUCTURE BREADCRUMB
Sentry uses breadcrumbs to create a trail of events that happened prior to an issue. These events are very similar to traditional logs but can record more rich structured data.
-
EXTERNAL STRUCTURE BREADCRUMBS-INTERFACE
Breadcrumbs event interface.
-
EXTERNAL STRUCTURE CONTEXTS-INTERFACE
The Contexts Interface provides additional context data. Typically, this is data related to the current user and the environment. For example, the device or application version.
See
MAKE-CONTEXTS-INTERFACE,ADD-CONTEXT,ADD-CONTEXTS,MAKE-DEFAULT-CONTEXTS -
EXTERNAL STRUCTURE DEBUG-META-IMAGE
Debug image is dynamic library loaded into process.
-
EXTERNAL STRUCTURE DEBUG-META-INTERFACE
The debug meta interface carries debug information for processing errors and crash reports.
-
EXTERNAL STRUCTURE DEVICE-CONTEXT
Device context describes the device that caused the event.
-
EXTERNAL STRUCTURE ENVELOPE
Envelopes are a data format similar to HTTP form data, comprising common Headers and a set of Items with their own headers and payloads. Envelopes are optimized for fast parsing and human readability. They support a combination of multiple Items in a single payload, such as:
- Submit events with large binary attachments.
- Enable communication between hops, for instance, between different SDKs (Native and Mobile, ReactNative and Android) and between Relays.
- Allow batching of certain Items into a single submission.
- Offline storage for deferred sending after connection issues.
See
MAKE-ENVELOPE -
EXTERNAL STRUCTURE EVENT
Events are the fundamental data that clients, often through the use of an SDK, send to the Sentry server.
Events are packed into
ENVELOPEs.See
MAKE-EVENT -
EXTERNAL STRUCTURE EXCEPTION-INTERFACE
The Exception Interface specifies an exception or error that occurred in a program.
-
EXTERNAL STRUCTURE EXCEPTION-MECHANISM
The exception mechanism is an optional field residing in the
EXCEPTION-INTERFACE. It carries additional information about the way the exception was created on the target system. This includes general exception values obtained from the operating system or runtime APIs, as well as mechanism-specific values. -
EXTERNAL STRUCTURE FEATURE-FLAG-CONTEXT
The feature flag context contains information about the flags evaluated prior to an error occurring. It is populated with
*FEATURES*by default. -
EXTERNAL STRUCTURE GPU-CONTEXT
GPU context describes the GPU of the device.
See
MAKE-GPU-CONTEXT -
EXTERNAL STRUCTURE MESSAGE-INTERFACE
The Message Interface carries a log message that describes an event or error.
-
EXTERNAL STRUCTURE OS-CONTEXT
OS context describes the operating system on which the crash happened/the event was created.
See
MAKE-OS-CONTEXT -
EXTERNAL STRUCTURE REQUEST-INTERFACE
The Request interface contains information on a HTTP request related to the event.
-
EXTERNAL STRUCTURE RUNTIME-CONTEXT
Runtime context describes a runtime in more detail.
-
EXTERNAL STRUCTURE SDK-INTERFACE
The SDK Interface describes the Sentry SDK and its configuration used to capture and transmit an event.
-
EXTERNAL STRUCTURE STACK-TRACE-FRAME
A stack trace contains a list of frames, each with various bits (most optional) describing the context of that frame.
-
EXTERNAL STRUCTURE THREAD
An object containing information on thread within
THREADS-INTERFACE. -
EXTERNAL STRUCTURE THREADS-INTERFACE
The Threads Interface specifies threads that were running at the time an event happened. These threads can also contain stack traces.
-
EXTERNAL STRUCTURE USER-INTERFACE
User Interface is an interface describing the authenticated User for a request.
-
EXTERNAL STRUCTURE USER-REPORT
User Report item works by associating user information and comments with an event. If both the item and its associated event are accepted, we convert it to a user feedback.
Constraints:
- This Item may occur once per Envelope.
- User Reports can be ingested separately from their events. However, we recommend sending them in the same Envelope.
- You may not associate multiple User Reports to the same event.
- The event can not be more than 30 minutes old.
- If the event does not exist in the same project or was never ingested, the report is discarded and never converted to feedback.
See
MAKE-USER-REPORT -
EXTERNAL FUNCTION ADD-BREADCRUMBS
- EVENT
Adds all breadcrumbs previously created with
MAKE-BREADCRUMBto theEVENT.NOTE that breadcrumbs are automatically added by
MAKE-MESSAGE-EVENTandMAKE-CONDITION-EVENT. -
EXTERNAL FUNCTION ADD-CONTEXT
- EVENT
- CONTEXT
Appends given
CONTEXTto a list ofEVENTcontexts. -
EXTERNAL FUNCTION ADD-CONTEXTS
- EVENT
- &REST
- CONTEXTS
Sets context list of given
EVENTto givenCONTEXTS. -
EXTERNAL FUNCTION ADD-DEBUG-META
- EVENT
- &KEY
- LIBRARIES
Adds
DEBUG-META-INTERFACEwith givenLIBRARIRESlist (defaulting to the results ofCFFI:LIST-FOREIGN-LIBRARIEScall) to the givenEVENT. -
EXTERNAL FUNCTION ADD-EXCEPTION
- EVENT
- EXCEPTION
- STACK-TRACE
- THREAD
Adds
EXCEPTION-INTERFACEwith info on givenEXCEPTIONhappened inTHREADwithSTACK-TRACEto givenEVENT.See
GET-STACK-TRACE -
EXTERNAL FUNCTION ADD-EXTRA
- EVENT
- &REST
- EXTRA
- &KEY
- &ALLOW-OTHER-KEYS
Appends arbitrary keyword arguments as extra data on given
EVENT. -
EXTERNAL FUNCTION ADD-MESSAGE
- EVENT
- CONTROL
- &REST
- ARGS
Adds
MESSAGE-INTERFACEto givenEVENTusingFORMATon givenCONTROLandARGS. -
EXTERNAL FUNCTION ADD-REQUEST
- EVENT
- &KEY
- METHOD
- URL
- DATA
- COOKIES
- HEADERS
- ENV
Adds
REQUEST-INTERFACEwith givenMETHOD,URL,DATA,COOKIES,HEADERSandENVto the givenEVENT. -
EXTERNAL FUNCTION ADD-SDK
- EVENT
Adds
SDK-INTERFACEto the givenEVENT. -
EXTERNAL FUNCTION ADD-TAGS
- EVENT
- &REST
- TAGS
- &KEY
- &ALLOW-OTHER-KEYS
Appends arbitrary keyword arguments as tags on given
EVENT. -
EXTERNAL FUNCTION ADD-THREADS
- EVENT
- &KEY
- CRASHED
Adds
THREADS-INTERFACEto the givenEVENT.CRASHEDis the crashed thread, defaulting to the current thread. -
EXTERNAL FUNCTION ADD-USER
- EVENT
- &KEY
- ID
- NAME
- IP-ADDRESS
Adds
USER-INTERFACEwith givenID,NAME,EMAILandIP-ADDRESS(defaulting to "{{auto}}") to the givenEVENT.You should provide at least one of
ID,NAME,EMAIL,IP-ADDRESSfor Sentry to be able to tell you how many users are affected by one issue, for example. Sending a user that has none of these attributes and only custom attributes is valid, but not as useful. -
EXTERNAL FUNCTION ENVELOPE-EVENT
- ENVELOPE
-
EXTERNAL FUNCTION GET-MODULES
- &OPTIONAL
- LIST
Returns plist of already loaded ASDF systems and their versions.
If
LISTargument is given, the function returns those systems instead. -
EXTERNAL FUNCTION GET-STACK-TRACE
Returns a list of
STACK-TRACE-FRAMEobjects corresponding to current stack trace, sorted from oldest to newest. -
EXTERNAL FUNCTION GET-THREADS
- CRASHED
Gets the list of
THREADobjects corresponding to the list of all threads returned by(BT2:ALL-THREADS).CRASHEDis the thread that has crashed, orNIL. -
EXTERNAL FUNCTION INIT!
- &KEY
- DSN
- CAPTURE-CONDITIONS-OUTSIDE-DUMPED-IMAGE
- VARIABLE-ELISION-LENGTH
- PROJECT-ROOT
- PROJECT-PACKAGE
- ENVIRONMENT
- SERVER-NAME
- RELEASE
- DIST
- BUILD-TYPE
- APP-NAME
- APP-VERSION
- APP-BUILD
- STARTUP-TIME
- PROCESS-BEFORE-SEND
- SOURCES
Initializes library settings in a manner similar to
WITH-SENTRYmacro. -
EXTERNAL FUNCTION MAKE-APP-CONTEXT
- &KEY
- APP-START-TIME
- BUILD-TYPE
- APP-IDENTIFIER
- APP-NAME
- APP-VERSION
- APP-BUILD
- VIEW-NAMES
- APP-MEMORY
Creates
APP-CONTEXT.APP-START-TIMEis optional timestamp when the user started the application. See*STARTUP-TIME*.BUILD-TYPEis optional string identifying the kind of build. See*BUILD-TYPE*.APP-IDENTIFIERis optional version-independent application identifier. Calculated automatically usingUIOP:ARGV0APP-NAMEis optional human readable appication name, as it appears on the platform. See*APP-NAME*.APP-VERSIONis optional human readable application version, as it appears on the platform. See*APP-VERSION*.APP-BUILDis optional internal build identifier, as it appears on the platform. See*APP-BUILD*.VIEW-NAMESis optional list of visible UI screens at the current point in time.APP-MEMORYis optional amount of memory used by the application in bytes. Calculated automatically usingROOM.
-
EXTERNAL FUNCTION MAKE-ATTACHMENT
- &KEY
- ENVELOPE
- FILENAME
- TYPE
- CONTENT-TYPE
Creates
ATTACHMENTitem in the givenENVELOPE.FILENAMEis the name of the uploaded file.TYPEis the special type of this attachment. Defaults toevent.attachment.CONTENT-TYPEis the content type of the attachment payload. Any MIME type may be used; defaults to the content type deduced fromFILENAME.
-
EXTERNAL FUNCTION MAKE-BREADCRUMB
- &KEY
- TYPE
- CATEGORY
- MESSAGE
- DATA
- LEVEL
- ORIGIN
- TIMESTAMP
Creates a
BREADCRUMB.TYPEis the type of breadcrumb. By default, all breadcrumbs are recorded asdefault, which makes them appear as a Debug entry, but Sentry provides other types that influence how the breadcrumbs are rendered. For more information, see the description of recognized breadcrumb types.CATEGORYis an optional dotted string indicating what the crumb is or from where it comes. Typically it is a module name or a descriptive string. For instance,ui.clickcould be used to indicate that a click happened in the UI orflaskcould be used to indicate that the event originated in the Flask framework.MESSAGEis optional human-readable message for the breadcrumb.DATAis optional arbitrary data associated with this breadcrumb. SeeMAKE-BREADCRUMB-DATA.LEVELis optional severity level of the breadcrumb. Allowed values are, from highest to lowest::FATAL,:ERROR,:WARNING,:INFO, and:DEBUG. Levels are used in the UI to emphasize and deemphasize the crumb. The default is:INFO.ORIGINis a string representing the origin of the breadcrumb. This is typically used to identify the source of the breadcrumb. For example hybrid SDKs can identify native breadcrumbs from JS or Flutter.TIMESTAMPis a timestamp representing when the breadcrumb occurred. Breadcrumbs are most useful when they include a timestamp, as it creates a timeline leading up to an event "exception"/"error". This defaults to current time.
See
ADD-BREADCRUMBS -
EXTERNAL FUNCTION MAKE-BREADCRUMB-DATA
- &REST
- DATA
- &KEY
- &ALLOW-OTHER-KEYS
Prepares the arbitrary keyword arguments to be used as the
DATAforMAKE-BREADCRUMB. -
EXTERNAL FUNCTION MAKE-BREADCRUMBS-INTERFACE
- &KEY
- VALUES
Creates
BREADCRUMBS-INTERFACE.VALUESis a list ofBREADCRUMBobjects.
-
EXTERNAL FUNCTION MAKE-CONDITION-EVENT
- CONDITION
- &OPTIONAL
- STACK-TRACE
- THREAD
Creates an
EVENTwithEXCEPTION-INTERFACEcontaining information onCONDITION.See
GET-STACK-TRACE -
EXTERNAL FUNCTION MAKE-CONTEXTS-INTERFACE
- &KEY
- CONTEXTS
Creates
CONTEXTS-INTERFACE.CONTEXTSis a list of context objects.
-
EXTERNAL FUNCTION MAKE-DEBUG-META-IMAGE
- LIBRARY
Creates
DEBUG-META-IMAGEfrom given CFFILIBRARY. -
EXTERNAL FUNCTION MAKE-DEBUG-META-INTERFACE
- &KEY
- IMAGES
Creates
DEBUG-META-INTERFACE.IMAGESis a list of dynamic libraries loaded into the process.
-
EXTERNAL FUNCTION MAKE-DEFAULT-CONTEXTS
- &KEY
- STORAGE-PATH
- VIEW-NAMES
Creates list of applicable contexts and populates them with relevant data.
STORAGE-PATHis the pathname within a storage which capacity would be reported inDEVICE-CONTEXT. It defaults to*DEFAULT-PATHNAME-DEFAULTS*.VIEW-NAMESis the optional list of strings representing visible UI screens at the current point in time, to be reported inAPP-CONTEXT. -
EXTERNAL FUNCTION MAKE-DEVICE-CONTEXT
- &KEY
- NAME
- FAMILY
- ARCH
- BATTERY-LEVEL
- MANUFACTURER
- BRAND
- SCREEN-WIDTH-PIXELS
- SCREEN-HEIGHT-PIXELS
- SCREEN-RESOLUTION
- CHARGING
- MEMORY-SIZE
- FREE-MEMORY
- STORAGE-SIZE
- FREE-STORAGE
- BOOT-TIME
- PROCESSOR-COUNT
- CPU-DESCRIPTION
- BATTERY-STATUS
- DEVICE-TYPE
Creates
DEVICE-CONTEXT.NAMEis optional name of the device. This is typically a hostname. See*SERVER-NAME*.FAMILYis optional family of the device. This is usually the common part of model names across generations. For instance,iPhonewould be a reasonable family, so would beSamsung Galaxy.ARCHis optional CPU architecture.BATTERY-LEVELis optional floating point value defining the battery level (in the range 0-100), if the device has a battery.MANUFACTURERis optional manufacturer of the device.BRANDis optional brand of the device.SCREEN-WIDTH-PIXELSis optional width of the screen.SCREEN-HEIGHT-PIXELSis optional height of the screen.SCREEN-RESOLUTIONis optional screen resolution (e.g.: 800x600, 3040x1444).CHARGINGis boolean flag indicating whether the device was charging or not.MEMORY-SIZEis total system memory available in bytes.FREE-MEMORYis free system memory in bytes.STORAGE-SIZEis optional total device storage in bytes.FREE-STORAGEis optional free device storage in bytes.BOOT-TIMEis optional timestamp when the system was booted.PROCESSOR-COUNTis number of "logical processors". For example, 8.CPU-DESCRIPTIONis optional CPU description. For example,Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz.BATTERY-STATUSis optional status of the device's battery. For example,Unknown,Charging,Discharging,NotCharging,Full.DEVICE-TYPEis kind of device the application is running on. For example,Unknown,Handheld,Console,Desktop.
-
EXTERNAL FUNCTION MAKE-ENVELOPE
- &KEY
- ITEMS
- PROCESSED
- DSN
- EVENT-ID
- SENT-AT
Creates
ENVELOPE.ITEMSis the list of envelope items.PROCESSEDis a boolean flag indicating whether this envelope was processed by*PROCESS-BEFORE-SEND*callback.DSNis Sentry DSN string. Defaults to the value of*DSN*.EVENT-IDis an event ID. Autogenerated.SENT-ATis the timestamp when the event was sent from the client as string in RFC 3339 format. Used for clock drift correction of the event timestamp. The time zone must be UTC. Automatically set when the envelope is sent to Sentry.
-
EXTERNAL FUNCTION MAKE-EVENT
- &KEY
- ENVELOPE
- TIMESTAMP
- PLATFORM
- LEVEL
- LOGGER
- TRANSACTION
- SERVER-NAME
- RELEASE
- DIST
- TAGS
- ENVIRONMENT
- MODULES
- EXTRA
- FINGERPRINT
Creates
EVENTitem in the givenENVELOPE.TIMESTAMPindicates when the event was created. The format is a string as defined in RFC 3339. Defaults to current time.PLATFORMis a string representing the platform the client is submitting from. This will be used by the Sentry interface to customize various components in the interface. Defaults toother.LEVELis an optional record severity. Acceptable values are:FATAL,:ERROR,:WARNING,:INFOand:DEBUG. Defaults to:ERROR.LOGGERis the optional name of the logger which created the record.TRANSACTIONis the name of the transaction which caused this exception. For example, in a web app, this might be the route name.SERVER-NAMEidentifies the host from which the event was recorded. Defaults to the value of*SERVER-NAME*.RELEASEis the optional release version of the application. Defaults to the value of*RELEASE*.DISTis the optional distribution of the application. Defaults to the value of*DIST*.TAGSis an optional plist of tags for this event. Each tag must be less than 200 characters. SeeMAKE-TAGS.ENVIRONMENTis the environment name, such asproductionorstaging. Defaults to the value of*ENVIRONMENT*.MODULESis an optional plist of modules and their versions. Defaults to the result of call toGET-MODULES.EXTRAis an arbitrary mapping of additional metadata to store with the event in form of plist. NOTE that plist values should be printed with~Ato valid JSON string. SeeMAKE-EXTRA.FINGERPRINTis an optional list of strings used to dictate the deduplication of this event.
-
EXTERNAL FUNCTION MAKE-EXCEPTION-INTERFACE
- &KEY
- TYPE
- VALUE
- MODULE
- THREAD-ID
- MECHANISM
- STACKTRACE
Creates
EXCEPTION-INTERFACE.TYPEis the type of exception.VALUEis the value of exception (a string).MODULEis the optional module, or package which the exception type lives in.THREAD-IDis an optional value which refers to a thread in theTHREADS-INTERFACE.MECHANISMis optional object describing the mechanism that created this exception. SeeEXCEPTION-MECHANISM.STACKTRACEis an optional stack trace object, a list ofSTACK-TRACE-FRAMEobjects.
-
EXTERNAL FUNCTION MAKE-EXCEPTION-MECHANISM
- &KEY
- TYPE
- DESCRIPTION
- HELP-LINK
- SYNTHETIC
- EXCEPTION-ID
- PARENT-ID
- IS-EXCEPTION-GROUP
- META
- DATA
- HANDLED
Creates
EXCEPTION-MECHANISM.TYPEis unique identifier of this mechanism determining rendering and processing of the mechanism data. Defaults to "condition".DESCRIPTIONis optional human-readable description of the error mechanism and a possible hint on how to solve this error.HELP-LINKis optional fully qualified URL to an online help resource, possibly interpolated with error parameters.SYNTHETICis an optional flag indicating that this error is synthetic. Synthetic errors are errors that carry little meaning by themselves. This may be because they are created at a central place (like a crash handler), and are all called the same:Error,Segfaultetc. When the flag is set, Sentry will then try to use other information (top in-app frame function) rather than the exception type and value in the UI for the primary event display. Furthermore, if this flag is set, Sentry will ignore the exception type when grouping the exception into issues. This flag should be set for all "segfaults" for instance as every single error group would look very similar otherwise. Also, errors the client creates to add a stack trace to events that don't have one themselves should be marked assynthetic(This happens, for example, when users setattachStackTrace: trueand capture a string message viacaptureExceptionorcaptureMessage).EXCEPTION-IDis optional numeric value providing an ID for the exception relative to this specific event.PARENT-IDis optional numeric value pointing at theexception-idthat is the parent of this exception.IS-EXCEPTION-GROUPis flag indicating that this exception is part of an exception group type specific to the platform or language.METAis optional information from the operating system or runtime on the exception mechanism (see meta information). NOTE that this should be printed with~Ato valid JSON string.DATAis optional arbitrary extra data that might help the user understand the error thrown by this mechanism. NOTE that this should be printed with~Ato valid JSON string.HANDLEDis flag indicating whether the user has handled the exception (for example, viaHANDLER-CASE). Defaults to*EXCEPTION-HANDLED*.
-
EXTERNAL FUNCTION MAKE-EXTRA
- &REST
- EXTRA
- &KEY
- &ALLOW-OTHER-KEYS
Prepares the arbitrary keyword arguments to be used as the
EXTRAforMAKE-EVENT. NOTE that values should be printed with~Ato valid JSON string, that means that e.g. string values should be quoted. -
EXTERNAL FUNCTION MAKE-FEATURE-FLAG-CONTEXT
- &KEY
- VALUES
Creates
FEATURE-FLAG-CONTEXT.VALUESis the list of string designators corresponding to enabled feature flags. Defaults to*FEATURES*.
-
EXTERNAL FUNCTION MAKE-GPU-CONTEXT
Creates
GPU-CONTEXT.NOTE: this works in a meaningful way only when
:LISP-SENTRY-GPUwas present in*FEATURES*when the system was compiled and there is active OpenGL context in current thread. -
EXTERNAL FUNCTION MAKE-MESSAGE-EVENT
- LEVEL
- CONTROL
- &REST
- ARGS
-
EXTERNAL FUNCTION MAKE-MESSAGE-INTERFACE
- &KEY
- FORMATTED
Creates
MESSAGE-INTERFACE.FORMATTEDis the fully formatted message.
-
EXTERNAL FUNCTION MAKE-OS-CONTEXT
- &KEY
- DISTRIBUTION-NAME
- DISTRIBUTION-VERSION
- DISTRIBUTION-PRETTY-NAME
- NAME
- VERSION
Creates
OS-CONTEXT.DISTRIBUTION-NAMEis optional stable name for each distribution. This maps to ID in/etc/os-release(examples:ubuntu,rhel,alpine; a full list of tested identifiers is available in the Native SDK repository).DISTRIBUTION-VERSIONis optional identifier of at least the major release version number. This maps toVERSION_IDin/etc/os-release. Distributions with rolling releases only, will not provide a version.DISTRIBUTION-PRETTY-NAMEis optional full name, full version, and release alias. This maps toPRETTY_NAMEin/etc/os-release(examples:Ubuntu 22.04.4 LTS,Raspian GNU/Linux 10 (buster)).NAMEis the name of the operating system.VERSIONis the version of the operating system.
-
EXTERNAL FUNCTION MAKE-REQUEST-INTERFACE
- &KEY
- METHOD
- URL
- DATA
- COOKIES
- ENV
- HEADERS
Creates
REQUEST-INTERFACE.METHODis the HTTP method of the request.URLis the URL of the request if available.DATAis optional submitted data in a format that makes the most sense. Can be given as string or structural data of any format. NOTE that this should be printed with~Ato valid JSON string.COOKIESis optional cookie values. Should be given as plist with string keys and string values.ENVis optional dictionary containing environment information passed from the server. This is where information such as Clackup env go that are not HTTP headers. Should be given as plist with keyword keys.HEADERSis dictionary of submitted headers. If a header appears multiple times it, needs to be merged according to the HTTP standard for header merging. Header names are treated case-insensitively by Sentry. Should be given as plist with keyword or string keys and string values.
-
EXTERNAL FUNCTION MAKE-RUNTIME-CONTEXT
- &KEY
- NAME
- VERSION
Creates
RUNTIME-CONTEXT.NAMEis the name of the runtime. Defaults toLISP-IMPLEMENTATION-TYPE.VERSIONis the version identifier of the runtime. Defaults toLISP-IMPLEMENTATION-VERSION
-
EXTERNAL FUNCTION MAKE-SDK-INTERFACE
- &KEY
- NAME
- VERSION
- PACKAGES
Creates
SDK-INTERFACE.NAMEis the name of the SDK.VERSIONis the version of the SDK.PACKAGESis a list of packages that were installed as part of this SDK or the activated integrations. Each package consists of a name in the formatsource:identifierandversion.
-
EXTERNAL FUNCTION MAKE-STACK-TRACE-FRAME
- &KEY
- FILENAME
- LINENO
- COLNO
- ABS-PATH
- CONTEXT-LINE
- PRE-CONTEXT
- POST-CONTEXT
- SOURCE-LINK
- IN-APP
- VARS
- INSTRUCTION-ADDR
- PACKAGE
- FUNCTION
Creates
STACK-TRACE-FRAME.FILENAMEis optional path to the source file relative to the project root directory (see*PROJECT-ROOT*).LINENOis optional line number of the call, starting at 1.COLNOis optional column number of the call, starting at 1.ABS-PATHis optional absolute path to the source file.CONTEXT-LINEis optional source code in filename atLINENO.PRE-CONTEXTis optional list of source code lines beforeCONTEXT-LINE(in order).POST-CONTEXTis optional list of source code lines afterCONTEXT-LINE(in order).SOURCE-LINKis optional URL representing the source code, e.g. commit-specific GitHub raw source link.IN-APPis the flag indicating whether this frame is related to the execution of the relevant code in this stack trace. For example, the frames that might power the framework’s web server of your app are probably not relevant. However, calls to the framework’s library once you start handling code likely are relevant.VARSis optional mapping of variables which were available within this frame (usually context-locals).INSTRUCTION-ADDRis instruction address for symbolication.PACKAGEis optional "package" the frame was contained in.FUNCTIONis the name of the function being called.
-
EXTERNAL FUNCTION MAKE-TAGS
- &REST
- TAGS
- &KEY
- &ALLOW-OTHER-KEYS
Prepares the arbitrary keyword arguments to be used as the
TAGSforMAKE-EVENT. -
EXTERNAL FUNCTION MAKE-THREAD
- &KEY
- ID
- CRASHED
- CURRENT
- STACKTRACE
- NAME
Creates
THREAD.IDis the ID of the thread. Typically a number or numeric string. Needs to be unique among the threads. An exception can set theTHREAD-IDattribute to cross-reference this thread.CRASHEDis a flag indicating whether the thread was the cause for the event being sent, e.g. due to a crash. Defaults toNIL.CURRENTis a flag indicating whether the thread was in the foreground. A thread is in foreground when it's executing. Defaults toNIL.STACKTRACEis optional stack trace. List ofSTACK-TRACE-FRAMEobjects.NAMEis the thread name.
-
EXTERNAL FUNCTION MAKE-THREADS-INTERFACE
- &KEY
- VALUES
Creates
THREADS-INTERFACE. -
EXTERNAL FUNCTION MAKE-USER-INTERFACE
- &KEY
- ID
- USERNAME
- IP-ADDRESS
Creates
USER-INTERFACE.IDis optional application-specific internal identifier for the user.USERNAMEis optional username. Typically used as a better label than the internal id.EMAILis optional alternative, or addition, to the username. Sentry is aware of email addresses and can display things such as Gravatars and unlock messaging capabilities.IP-ADDRESSis the user's IP address. If the user is unauthenticated, Sentry uses the IP address as a unique identifier for the user. Set to "{{auto}}" to let Sentry infer the IP address from the connection.
-
EXTERNAL FUNCTION MAKE-USER-REPORT
- &KEY
- ENVELOPE
- NAME
- COMMENTS
Creates
USER-REPORTitem in the givenENVELOPE.EMAILis the email of the user.NAMEis the name of the user.COMMENTSis the comments of the user about what happened. The max length is 4096 characters.
-
EXTERNAL FUNCTION MAKE-USER-REPORT-EVENT
- COMMENTS
- &KEY
- NAME
Creates an envelope with dummy
EVENTitem andUSER-REPORTitem. Returns the event. -
EXTERNAL FUNCTION MAYBE-CAPTURE-CONDITION
- CONDITION
- &REST
- REST
Captures a condition according to settings.
-
EXTERNAL GENERIC-FUNCTION CAPTURE
- OBJECT
The reporting of an event is called capturing. When an event is captured, it’s sent to Sentry.
OBJECTshould beENVELOPEobject or one of envelope items (currently supported items areATTACHMENT,EVENTandUSER-REPORT), in which case the envelope where the item belongs is captured. -
EXTERNAL MACRO MAKE-SAVED-SOURCES
- &KEY
- SYSTEM
- EXTRA
Specifies the set of source files to be saved for display in stack traces in Sentry. To be used as
:SOURCESargument toWITH-SENTRYandINIT!.SYSTEMspecifies whether to save sources of Lisp runtime. Defaults toNILsince it may significantly blow the size of the dumped Lisp image and those sources are not very interesting usually. Consider using Lisp image compression when setting this toT.EXTRAis arbitrary list of directory pathnames to recursively scan for*.lispfiles to be saved. -
EXTERNAL MACRO WITH-SENTRY
- &KEY
- DSN
- CAPTURE-CONDITIONS-OUTSIDE-DUMPED-IMAGE
- CAPTURE-WARNINGS
- HANDLED
- VARIABLE-ELISION-LENGTH
- PROJECT-ROOT
- PROJECT-PACKAGE
- ENVIRONMENT
- SERVER-NAME
- RELEASE
- DIST
- BUILD-TYPE
- APP-NAME
- APP-VERSION
- APP-BUILD
- STARTUP-TIME
- PROCESS-BEFORE-SEND
- SOURCES
- &BODY
- BODY
Initializes library settings as described below and runs
BODYwrapped inHANDLER-BINDthatCAPTUREs conditions popping up. Rule of thumb for placing this macro in your code — call it as early as possible, but be sure to still be able to catch all conditions you're interested in.DSNsets*DSN*, a Sentry Data Source Name. Defaults to the value ofSENTRY_DSNenvironment variable. If unset, the SDK will just not send any events.CAPTURE-CONDITIONS-OUTSIDE-DUMPED-IMAGEsets*CAPTURE-CONDITIONS-OUTSIDE-DUMPED-IMAGE*which controls whether toCAPTUREconditions outside of circumstances of dumped Lisp image.CAPTURE-WARNINGScontrols whetherWARNINGconditions areCAPTUREd.HANDLEDis form that is evaluated each time the condition isCAPTUREd to determine the value of*EXCEPTION-HANDLED*which indicates whether the condition was handled or not.VARIABLE-ELISION-LENGTHsets*VARIABLE-ELISION-LENGTH*which controls maximum length of variable values displayed in stack traces.PROJECT-ROOTsets*PROJECT-ROOT*which is absolute path to the project directory.PROJECT-PACKAGEsets*PROJECT-PACKAGE*which is name of the project package.ENVIRONMENTsets*ENVIRONMENT*which is the environment name, such asproductionorstaging.SERVER-NAMEsets*SERVER-NAME*which is the name of the device, typically a hostname.RELEASEsets*RELEASE*which is the release version of the application.DISTsets*DIST*which is the distribution of the application.BUILD-TYPEsets*BUILD-TYPE*which is string identifying the kind of build.APP-NAMEsets*APP-NAME*which is human readable application name, as it appears on the platform.APP-VERSIONsets*APP-VERSION*which is human readable application version, as it appears on the platform.APP-BUILDsets*APP-BUILD*which is internal build identifier, as it appears on the platform.STARTUP-TIMEis form that is evaluated to set the value of*STARTUP-TIME*which is the timestamp when the user started the application. If set toNIL,*STARTUP-TIME*is not set. Defaults to(LOCAL-TIME:NOW).PROCESS-BEFORE-SENDsets*PROCESS-BEFORE-SEND*which is the designator of function of one argument that processes or cancels theENVELOPEright beforeCAPTUREsends it to Sentry.SOURCESis form that is evaluated to set the value of*SOURCES*with the source code the Lisp image was built of to display in Sentry stack traces. Set toNILto prevent source saving whatsoever. Defaults to the call toMAKE-SAVED-SOURCES.
See
INIT!
-