You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
POTEL 11 - Move sampling logic into OTel Sampler (#3462)
* replace hub with scopes
* Add Scopes
* Introduce `IScopes` interface.
* Replace `IHub` with `IScopes` in core
* Replace `IHub` with `IScopes` in android core
* Replace `IHub` with `IScopes` in android integrations
* Replace `IHub` with `IScopes` in apollo integrations
* Replace `IHub` with `IScopes` in okhttp integration
* Replace `IHub` with `IScopes` in graphql integration
* Replace `IHub` with `IScopes` in logging integrations
* Replace `IHub` with `IScopes` in more integrations
* Replace `IHub` with `IScopes` in OTel integration
* Replace `IHub` with `IScopes` in Spring 5 / Spring Boot 2 integrations
* Replace `IHub` with `IScopes` in Spring 6 / Spring Boot 3 integrations
* Replace `IHub` with `IScopes` in samples
* gitscopes -> github
* Replace ThreadLocal with ScopesStorage
* Move client and throwable to span map to scope
* Add global scope
* use global scope in Scopes
* Implement pushScope popScope and withScope for Scopes
* Add pushIsolationScope; add fork methods to ISCope
* Use separate scopes for current, isolation and global scope; rename mainScopes to rootScopes
* Allow controlling which scope configureScope uses
* Combine scopes
* Use new API for CRONS integrations
* Add lifecycle helper
* Change spring integrations to use new API
* Use new API in servlet integrations
* Use new API for kotlin coroutines and wrapers for Supplier/Callable
* Discussion TODOs
* Fix breadcrumb ordering
* Mark TODOS with [HSM]
* Add getGlobalScope and forkedRootScopes to IScopes
* Fix EventProcessor ordering on scopes
* Reuse code in Scopes
* No longer replace global scope
* Replace hub occurrences in comments, var names etc.
* Implement ScopesTest
* Implement CombinedScopeViewTest
* Fix combined contexts
* Use combined scopes for cross platform
* Changes according to reviews of previous PRs
* more
* even more
* isEnabled checks client instead of having a property on Scopes
* Use SentryOptions.empty
* Remove Hub
* Use OpenTelemetry for Performance and Scopes propagation
* Promote certain span attributes
* Use OTel in Sentry API
* Deduplicate SpanInfo extraction
* Forward Sentry API to Sentry through OTel
* Use OTel status for Sentry span API
* POTel Tracing
* fix root span detection (remote flag), and scope closing
* Inherit OTel span IDs when sending to sentry
* Fix tracing; parse incoming baggage; add baggage to outgoing
* Cleanup
* Move sampling logic to OTel Sampler
Copy file name to clipboardExpand all lines: sentry-opentelemetry/sentry-opentelemetry-agentcustomization/src/main/java/io/sentry/opentelemetry/SentryAutoConfigurationCustomizerProvider.java
Copy file name to clipboardExpand all lines: sentry-opentelemetry/sentry-opentelemetry-core/api/sentry-opentelemetry-core.api
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@ public final class io/sentry/opentelemetry/OpenTelemetryLinkErrorEventProcessor
4
4
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
5
5
}
6
6
7
+
public final class io/sentry/opentelemetry/OtelSamplingUtil {
8
+
public fun <init> ()V
9
+
public static fun extractSamplingDecision (Lio/opentelemetry/api/common/Attributes;)Lio/sentry/TracesSamplingDecision;
10
+
public static fun extractSamplingDecisionOrDefault (Lio/opentelemetry/api/common/Attributes;)Lio/sentry/TracesSamplingDecision;
11
+
}
12
+
7
13
public final class io/sentry/opentelemetry/OtelSpanInfo {
8
14
public fun <init> (Ljava/lang/String;Ljava/lang/String;Lio/sentry/protocol/TransactionNameSource;)V
9
15
public fun <init> (Ljava/lang/String;Ljava/lang/String;Lio/sentry/protocol/TransactionNameSource;Ljava/util/Map;)V
@@ -36,6 +42,20 @@ public final class io/sentry/opentelemetry/SentryPropagator : io/opentelemetry/c
36
42
public fun inject (Lio/opentelemetry/context/Context;Ljava/lang/Object;Lio/opentelemetry/context/propagation/TextMapSetter;)V
37
43
}
38
44
45
+
public final class io/sentry/opentelemetry/SentrySampler : io/opentelemetry/sdk/trace/samplers/Sampler {
46
+
public fun <init> ()V
47
+
public fun <init> (Lio/sentry/IScopes;)V
48
+
public fun getDescription ()Ljava/lang/String;
49
+
public fun shouldSample (Lio/opentelemetry/context/Context;Ljava/lang/String;Ljava/lang/String;Lio/opentelemetry/api/trace/SpanKind;Lio/opentelemetry/api/common/Attributes;Ljava/util/List;)Lio/opentelemetry/sdk/trace/samplers/SamplingResult;
50
+
}
51
+
52
+
public final class io/sentry/opentelemetry/SentrySamplingResult : io/opentelemetry/sdk/trace/samplers/SamplingResult {
53
+
public fun <init> (Lio/sentry/TracesSamplingDecision;)V
54
+
public fun getAttributes ()Lio/opentelemetry/api/common/Attributes;
55
+
public fun getDecision ()Lio/opentelemetry/sdk/trace/samplers/SamplingDecision;
56
+
public fun getSentryDecision ()Lio/sentry/TracesSamplingDecision;
57
+
}
58
+
39
59
public final class io/sentry/opentelemetry/SentrySpanExporter : io/opentelemetry/sdk/trace/export/SpanExporter {
Copy file name to clipboardExpand all lines: sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/PotelSentrySpanProcessor.java
+40-76Lines changed: 40 additions & 76 deletions
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,14 @@
11
11
importio.sentry.Baggage;
12
12
importio.sentry.IScopes;
13
13
importio.sentry.PropagationContext;
14
-
importio.sentry.SamplingContext;
15
14
importio.sentry.ScopesAdapter;
16
15
importio.sentry.Sentry;
17
16
importio.sentry.SentryDate;
18
17
importio.sentry.SentryLevel;
19
18
importio.sentry.SentryLongDate;
20
19
importio.sentry.SentryTraceHeader;
21
20
importio.sentry.SpanId;
22
-
importio.sentry.TracesSampler;
23
21
importio.sentry.TracesSamplingDecision;
24
-
importio.sentry.TransactionContext;
25
22
importio.sentry.protocol.SentryId;
26
23
importorg.jetbrains.annotations.NotNull;
27
24
importorg.jetbrains.annotations.Nullable;
@@ -30,15 +27,12 @@ public final class PotelSentrySpanProcessor implements SpanProcessor {
0 commit comments