Bogdan Popa <bogdan@defn.io>
This library provides an interface for capturing and sending errors to either a managed or a self-hosted Sentry instance.
Install the package from the package server with
$ raco pkg install sentry
Call make-sentry to create an instance of the sentry client. Keep a reference to the client around for as long as your application needs to run and you can start sending exceptions by calling sentry-capture-exception! :
Added in version 0.5 of package sentry-lib.
parameter
( current-sentry )→(or/c #fsentry? )
procedure
[ #:samplersampler#:backlogbacklog#:releaserelease#:environmentenvironment#:connect-timeout-msconnect-timeout#:send-timeout-mssend-timeoutdsn:string?
The #:backlog argument controls the size of the error queue. Events are dropped when the queue is full.
When the #:release argument is set, every event is tagged with the given value. Ditto for the #:environment argument.
The reutrned client logs messages to the 'sentry topic.
The #:sampler argument determines what chance an event has to be sent to the server. The default implementation samples 100% of all events.
Changed in version 0.5 of package sentry-lib: Added the #:sampler argument.
procedure
[ client#:levellevel#:timestamptimestamp#:server-nameserver-name#:environmentenvironment#:releaserelease#:requestrequest#:tagstags#:useruser])e:exn?
procedure
( sentry-stop [client])→void?
procedure
( sentry-user? v)→boolean?
v:any/c
parameter
( current-sentry-user )→(or/c #fsentry-user? )
procedure
[ #:usernameusername#:emailemail#:ip-addressip-address
A transaction tracks a set of spans and delivers them to Sentry when the transaction completes. A span measures and records information about a block of code.
procedure
( transaction? v)→boolean?
v:any/c
parameter
( current-transaction )→(or/c #ftransaction? )
procedure
proc[ #:datadata#:originorigin#:sourcesource#:trace-idtrace-id#:parent-idparent-id#:operationoperation#:descriptiondescriptionname:string?
The value passed to the name argument should follow the conventions defined for the value passed to the #:source argument. The supported #:source values can be found in Sentry’s Transaction Annotations documentation.
The #:trace-id and #:parent-id may be used to propagate distributed tracing ids to the new transaction. See Sentry’s documentation on the sentry-trace header for details. If not provided, and the call is nested within another transaction, then the parent transaction’s values are inherited. If there is no parent transaction, then new trace and span ids are generated automatically.
The #:operation should be one of the values listed in Sentry’s Span Operations documentation.
The #:description may be an arbitrary string describing the transaction in detail.
The #:request may be a jsexpr? conforming to the request interface.
Changed in version 0.6 of package sentry-lib: Added the #:origin and #:request arguments.
parameter
( current-span )→(or/c #fspan? )
procedure
[ #:operationoperation#:descriptiondescription#:originorigin
The #:operation should be one of the values listed in Sentry’s Span Operations documentation.
The #:description may be an arbitrary string describing the operation in detail.
procedure
( get-span-id v)→string?
procedure
( get-trace-id v)→string?
procedure
( trace-connectionc)→connection?