Skip to content

Commit

Permalink
Update Sentry Java SDK to 7.2.0
Browse files Browse the repository at this point in the history
Bump dependencies
Clarify that enable-uncaught-exception-handler is not deprecated. Thanks @sjamaan!

-=david=-
  • Loading branch information
dharrigan committed Jan 12, 2024
1 parent 9af93b8 commit 586623d
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 35 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ endeavour to be non-breaking (by moving to new names rather than by
breaking existing names). COMMITS is an ever-increasing counter of
commits since the beginning of this repository.

## [7.2.211]

- Update Sentry Java SDK to 7.2.0
- Bump dependencies
- Clarify that enable-uncaught-exception-handler is not deprecated. Thanks @sjamaan!

## [6.33.209]

- Update Sentry Java SDK to 6.33.1
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ If you want an interpolated message, you need to provide the full map, i.e.,
| `:in-app-includes` | A seqable collection (vector for example) containing package names to include when sending events |
| `:in-app-excludes` | A seqable collection (vector for example) containing package names to ignore when sending events |
| `:ignored-exceptions-for-type` | Set exceptions that will be filtered out before sending to Sentry (a set of Classnames as Strings) |
| `:enable-uncaught-exception-handler` | (deprecated, use :uncaught-handler-enabled instead) Enables the uncaught exception handler | true
| `:uncaught-handler-enabled` | Enables the uncaught exception handler | true
| `: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 |
Expand All @@ -83,9 +82,9 @@ If you want an interpolated message, you need to provide the full map, i.e.,
| `:traces-sample-rate` | Set a uniform sample rate(a number of between 0.0 and 1.0) for all transactions for tracing |
| `:traces-sample-fn` | A function (taking a custom sample context and a transaction context) enables you to control trace transactions |
| `:serialization-max-depth` | Set to a lower number, i.e., 2, if you experience circular reference errors when sending events | 5
| `:trace-options-requests` | Set to enable or disable tracing of options requests. | true
| `:trace-options-requests` | Set to enable or disable tracing of options requests. |true
| `:instrumenter` | Sets instrumenter for tracing. (values - :sentry - for default Sentry instrumentation, :otel - OpenTelemetry instrumentation) | :sentry
| `:event-processors` | A seqable collection (vector for example) containing instances of event processors (implementing io.sentry.EventProcessor) |
| `:event-processors` | A seqable collection (vector for example) containing instances of event processors (implementing io.sentry.EventProcessor) |

Some examples:

Expand Down
8 changes: 4 additions & 4 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
;;
;;
;;
io.sentry/sentry {:mvn/version "6.33.1"}
ring/ring-core {:mvn/version "1.10.0"}}
io.sentry/sentry {:mvn/version "7.2.0"}
ring/ring-core {:mvn/version "1.11.0"}}

:aliases {:build {:extra-deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.2"}}
Expand All @@ -19,8 +19,8 @@
orchestra/orchestra {:mvn/version "2021.01.01-1"}
org.clojure/test.check {:mvn/version "1.1.1"}}}

:antq {:replace-deps {com.github.liquidz/antq {:mvn/version "2.7.1133"}
org.slf4j/slf4j-nop {:mvn/version "2.0.9"}}
:antq {:replace-deps {com.github.liquidz/antq {:mvn/version "2.8.1173"}
org.slf4j/slf4j-nop {:mvn/version "2.0.11"}}
:replace-paths ["."]
:exec-fn antq.tool/outdated
:exec-args {:skip ["pom"]
Expand Down
12 changes: 6 additions & 6 deletions examples/basic/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
;;
;;
;;
ch.qos.logback/logback-classic {:mvn/version "1.4.11"}
io.sentry/sentry {:mvn/version "6.33.1"}
ch.qos.logback/logback-classic {:mvn/version "1.4.14"}
io.sentry/sentry {:mvn/version "7.2.0"}
io.sentry/sentry-clj {:local/root "../../../sentry-clj"}
org.clojure/tools.cli {:mvn/version "1.0.219"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.9"}
org.slf4j/jul-to-slf4j {:mvn/version "2.0.9"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.9"}
org.slf4j/slf4j-api {:mvn/version "2.0.9"}}}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.11"}
org.slf4j/jul-to-slf4j {:mvn/version "2.0.11"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.11"}
org.slf4j/slf4j-api {:mvn/version "2.0.11"}}}
16 changes: 8 additions & 8 deletions examples/ring_with_tracing/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
;;
;;
;;
ch.qos.logback/logback-classic {:mvn/version "1.4.11"}
ch.qos.logback/logback-classic {:mvn/version "1.4.14"}
integrant/integrant {:mvn/version "0.8.1"}
integrant/repl {:mvn/version "0.3.3"}
io.sentry/sentry {:mvn/version "6.33.1"}
io.sentry/sentry {:mvn/version "7.2.0"}
io.sentry/sentry-clj {:local/root "../../../sentry-clj"}
org.clojure/tools.cli {:mvn/version "1.0.219"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.9"}
org.slf4j/jul-to-slf4j {:mvn/version "2.0.9"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.9"}
org.slf4j/slf4j-api {:mvn/version "2.0.9"}
ring/ring-core {:mvn/version "1.10.0"}
ring/ring-jetty-adapter {:mvn/version "1.10.0"}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.11"}
org.slf4j/jul-to-slf4j {:mvn/version "2.0.11"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.11"}
org.slf4j/slf4j-api {:mvn/version "2.0.11"}
ring/ring-core {:mvn/version "1.11.0"}
ring/ring-jetty-adapter {:mvn/version "1.11.0"}
ring/ring-json {:mvn/version "0.5.1"}}}
12 changes: 6 additions & 6 deletions examples/uncaught/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
;;
;;
;;
ch.qos.logback/logback-classic {:mvn/version "1.4.11"}
io.sentry/sentry {:mvn/version "6.33.1"}
ch.qos.logback/logback-classic {:mvn/version "1.4.14"}
io.sentry/sentry {:mvn/version "7.2.0"}
io.sentry/sentry-clj {:local/root "../../../sentry-clj"}
org.clojure/tools.cli {:mvn/version "1.0.219"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.9"}
org.slf4j/jul-to-slf4j {:mvn/version "2.0.9"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.9"}
org.slf4j/slf4j-api {:mvn/version "2.0.9"}}}
org.slf4j/jcl-over-slf4j {:mvn/version "2.0.11"}
org.slf4j/jul-to-slf4j {:mvn/version "2.0.11"}
org.slf4j/log4j-over-slf4j {:mvn/version "2.0.11"}
org.slf4j/slf4j-api {:mvn/version "2.0.11"}}}
2 changes: 1 addition & 1 deletion scripts/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

(defn ^:private the-version
[patch]
(format "6.33.%s" patch))
(format "7.2.%s" patch))

(defn ^:private pom-template
[tag]
Expand Down
13 changes: 7 additions & 6 deletions src/sentry_clj/tracing.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns sentry-clj.tracing
(:import
[io.sentry CustomSamplingContext EventProcessor ITransaction Scope Sentry SpanStatus TransactionContext]))
[io.sentry CustomSamplingContext EventProcessor ITransaction Scope Sentry SpanStatus TransactionContext TransactionOptions]))

(def span-status
{:ok SpanStatus/OK
Expand Down Expand Up @@ -34,12 +34,13 @@
"Start tracing transactions.
If a sentry-trace-header is given, connect the existing transaction."
[name operation custom-sampling-context sentry-trace-header]
(if sentry-trace-header
(let [contexts (TransactionContext/fromSentryTrace name operation (io.sentry.SentryTraceHeader. sentry-trace-header))]
(let [transaction-options (doto (TransactionOptions.) (.setBindToScope true) (.setCustomSamplingContext ^CustomSamplingContext custom-sampling-context))]
(if sentry-trace-header
(let [contexts (TransactionContext/fromSentryTrace name operation (io.sentry.SentryTraceHeader. sentry-trace-header))]
(-> (Sentry/getCurrentHub)
(.startTransaction contexts ^TransactionOptions transaction-options)))
(-> (Sentry/getCurrentHub)
(.startTransaction contexts ^CustomSamplingContext custom-sampling-context true)))
(-> (Sentry/getCurrentHub)
(.startTransaction ^String name "http.server" ^CustomSamplingContext custom-sampling-context true))))
(.startTransaction ^String name "http.server" ^TransactionOptions transaction-options)))))

(defn swap-scope-request!
"Set request info to the scope."
Expand Down

0 comments on commit 586623d

Please sign in to comment.