A thin wrapper around the official Java library for Sentry.
A thin wrapper around the official Java library for Sentry.
(init! dsn)
(init! dsn config)
Initialize Sentry with the mandatory dsn
Other options include:
key | description | default |
---|---|---|
:environment | Set the environment on which Sentry events will be logged, e.g., "production" | production |
:debug | Enable SDK logging at the debug level | false |
:release | All events are assigned to a particular release | |
:shutdown-timeout | Wait up to X milliseconds before shutdown if there are events to send | 2000ms |
:in-app-excludes | A seqable collection (vector for example) containing package names to ignore when sending events | |
:enable-uncaught-exception-handler | Enables the uncaught exception handler | true |
:before-send-fn | A function (taking an event and a hint) | |
The body of the function must not be lazy (i.e., don't use filter on its own!) and must return an event or nil | ||
If a nil is returned, the event will not be sent to Sentry | ||
More Information | ||
:before-breadcrumb-fn | A function (taking a breadcrumb and a hint) | |
The body of the function must not be lazy (i.e., don't use filter on its own!) and must return a breadcrumb or nil | ||
If a nil is returned, the breadcrumb will not be sent to Sentry | ||
More Information | ||
:contexts | A map of key/value pairs to attach to every Event that is sent. | |
[More Information)(https://docs.sentry.io/platforms/java/enriching-events/context/) |
Some examples:
(init! "http://abcdefg@localhost:19000/2")
(init! "http://abcdefg@localhost:19000/2" {:environment "production" :debug true :release "foo.bar@1.0.0" :in-app-excludes ["foo.bar"])
(init! "http://abcdefg@localhost:19000/2" {:before-send-fn (fn [event _] (when-not (= (.. event getMessage getMessage "foo")) event))})
(init! "http://abcdefg@localhost:19000/2" {:before-send-fn (fn [event _] (.setServerName event "fred") event)})
(init! "http://abcdefg@localhost:19000/2" {:contexts {:foo "bar" :baz "wibble"}})
Initialize Sentry with the mandatory `dsn` Other options include: | key | description | default | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------- | `:environment` | Set the environment on which Sentry events will be logged, e.g., "production" | production | `:debug` | Enable SDK logging at the debug level | false | `:release` | All events are assigned to a particular release | | `:shutdown-timeout` | Wait up to X milliseconds before shutdown if there are events to send | 2000ms | `:in-app-excludes` | A seqable collection (vector for example) containing package names to ignore when sending events | | `:enable-uncaught-exception-handler` | Enables the uncaught exception handler | true | `:before-send-fn` | A function (taking an event and a hint) | | | The body of the function must not be lazy (i.e., don't use filter on its own!) and must return an event or nil | | | If a nil is returned, the event will not be sent to Sentry | | | [More Information](https://docs.sentry.io/platforms/java/data-management/sensitive-data/) | | `:before-breadcrumb-fn` | A function (taking a breadcrumb and a hint) | | | The body of the function must not be lazy (i.e., don't use filter on its own!) and must return a breadcrumb or nil | | | If a nil is returned, the breadcrumb will not be sent to Sentry | | | [More Information](https://docs.sentry.io/platforms/java/enriching-events/breadcrumbs/) | | `:contexts` | A map of key/value pairs to attach to every Event that is sent. | | | [More Information)(https://docs.sentry.io/platforms/java/enriching-events/context/) | Some examples: ```clojure (init! "http://abcdefg@localhost:19000/2") ``` ```clojure (init! "http://abcdefg@localhost:19000/2" {:environment "production" :debug true :release "foo.bar@1.0.0" :in-app-excludes ["foo.bar"]) ``` ```clojure (init! "http://abcdefg@localhost:19000/2" {:before-send-fn (fn [event _] (when-not (= (.. event getMessage getMessage "foo")) event))}) ``` ```clojure (init! "http://abcdefg@localhost:19000/2" {:before-send-fn (fn [event _] (.setServerName event "fred") event)}) ``` ```clojure (init! "http://abcdefg@localhost:19000/2" {:contexts {:foo "bar" :baz "wibble"}}) ```
(send-event event)
Sends the given event to Sentry, returning the event's id
Supports sending throwables:
(sentry/send-event {:message "oh no",
:throwable (RuntimeException. "foo bar"})
Sends the given event to Sentry, returning the event's id Supports sending throwables: ``` (sentry/send-event {:message "oh no", :throwable (RuntimeException. "foo bar"}) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close