From 528823ff26eb4bd27eb3c82b9fd76e61d47a20ae Mon Sep 17 00:00:00 2001 From: Miguel Ping <59603303+mping-exo@users.noreply.github.com> Date: Thu, 21 Mar 2024 09:55:06 +0100 Subject: [PATCH] Allow enabling external configuration (#65) --- README.md | 3 ++- src/sentry_clj/core.clj | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ff5d44..5d7e9b5 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,8 @@ If you want an interpolated message, you need to provide the full map, i.e., ## Additional Initialisation Options | key | description | default -| ------------------------------------ |-------------------------------------------------------------------------------------------------------------------------------| ------- +|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------| ------- +| `:enable-external-configuration` | Enable loading configuration from the properties file, system properties or environment variables | | `: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 | diff --git a/src/sentry_clj/core.clj b/src/sentry_clj/core.clj index d67e311..e042e1c 100644 --- a/src/sentry_clj/core.clj +++ b/src/sentry_clj/core.clj @@ -170,7 +170,8 @@ ^SentryOptions ([dsn] (sentry-options dsn {})) ([dsn config] - (let [{:keys [environment + (let [{:keys [enable-external-configuration + environment debug logger diagnostic-level @@ -195,6 +196,8 @@ (.setDsn sentry-options dsn) + (when enable-external-configuration + (.setEnableExternalConfiguration sentry-options enable-external-configuration)) (when environment (.setEnvironment sentry-options environment)) ;; @@ -272,6 +275,7 @@ | key | description | default | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------- + | `:enable-external-configuration` | Enable loading configuration from the properties file, system properties or environment variables | | `:environment` | Set the environment on which Sentry events will be logged, e.g., \"production\" | production | `:enabled` | Enable or disable sentry. | true | `:debug` | Enable SDK logging at the debug level | false