getsentry / getsentry/sentry-java
Micrometer OpenTelemetry support
- 主要语言
- Kotlin
- 星标
- 1.4k
- 派生
- 478
- 平均合并
- 2 天 23 小时
- 30 天内合并 PR
- 67
描述
### Integration
sentry-spring-jakarta
### Java Version
17
### Version
7.8.0
### Steps to Reproduce
While profiling some reactive code using project Reactor with automatic context propagation and Sentry, I noticed quite a lot of time is spent instantiating `SecureRandom` objects as the `SentryReactorThreadLocalAccessor.getValue` call will always cause a new `TracesSampler` thus a new `SecureRandom` object to be created when `hub == null || hub instanceof NoOpHub` in `Sentry#getCurrentHub`.
SecureRandom objects are said to be thread-safe by the javadoc, would it be possible/safe to just reuse the same instance? Or reuse the TracesSampler? Or avoid cloning the NoOpHub alltogether..?
### Expected Result
Not so much time spent creating SecureRandom objects
### Actual Result
Screenshot of profiling results:
贡献指南
评估
这个 Issue 还没有评估数据。