From fa85dfe7e082e38c67f1ea9b8b6643bcf5e5ee55 Mon Sep 17 00:00:00 2001 From: Arthur Aliiev Date: Thu, 7 Mar 2024 15:35:18 +0100 Subject: [PATCH] some links add. --- src/spootnik/reporter/impl.clj | 8 +++++--- src/spootnik/reporter/sentry.clj | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/spootnik/reporter/impl.clj b/src/spootnik/reporter/impl.clj index 38f0055..c46d284 100644 --- a/src/spootnik/reporter/impl.clj +++ b/src/spootnik/reporter/impl.clj @@ -371,9 +371,11 @@ (defn parse-pggrouping-keys [grouping-keys] (into {} (for [[k v] grouping-keys] [(csk/->snake_case_string k) v]))) -;; "sentry" is a configuration map sent to sentry.io on initialisation -;; https://github.com/getsentry/sentry-clj/tree/master?tab=readme-ov-file#additional-initialisation-options -(defrecord Reporter [rclient raven-options reporters registry sentry metrics riemann prevent-capture? prometheus +;; Reporter configuration specs: +;; https://github.com/exoscale/reporter/blob/master/src/spootnik/reporter/specs.clj + +(defrecord Reporter [rclient raven-options reporters registry sentry + metrics riemann prevent-capture? prometheus started? pushgateway] c/Lifecycle (start [this] diff --git a/src/spootnik/reporter/sentry.clj b/src/spootnik/reporter/sentry.clj index c729beb..ae98b5b 100644 --- a/src/spootnik/reporter/sentry.clj +++ b/src/spootnik/reporter/sentry.clj @@ -54,7 +54,13 @@ :query-string (-> payload :query-string) :headers (-> payload :headers)}) -(defn e->sentry-event [e options tags] +(defn e->sentry-event + " + Supported event keys: + https://github.com/getsentry/sentry-clj/tree/master?tab=readme-ov-file#supported-event-keys + " + + [e options tags] (let [{:keys [message extra throwable]} e message (or message (ex-message e)) user (some-> extra :org/uuid str) @@ -92,7 +98,13 @@ (swap! http-requests-payload-stub conj event)))) -(defn init! [{:keys [dsn] :as sentry}] +(defn init! + " + Additional options can be found here: + https://github.com/getsentry/sentry-clj/tree/master?tab=readme-ov-file#additional-initialisation-options + " + + [{:keys [dsn] :as sentry}] (if-not (in-memory? dsn) (sentry-io/init! dsn sentry) (reset! http-requests-payload-stub [])))