Skip to content

Commit 98d3fe5

Browse files
committed
Format code
1 parent d698679 commit 98d3fe5

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SentrySampler.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@
2323
import io.sentry.TransactionContext;
2424
import io.sentry.clientreport.DiscardReason;
2525
import io.sentry.protocol.SentryId;
26-
2726
import java.util.HashMap;
2827
import java.util.List;
2928
import java.util.Map;
30-
3129
import org.jetbrains.annotations.NotNull;
3230
import org.jetbrains.annotations.Nullable;
3331

@@ -74,7 +72,9 @@ public SamplingResult shouldSample(
7472
}
7573

7674
private @NotNull SamplingResult handleRootOtelSpan(
77-
final @NotNull String traceId, final @NotNull Context parentContext, final @NotNull Attributes attributes) {
75+
final @NotNull String traceId,
76+
final @NotNull Context parentContext,
77+
final @NotNull Attributes attributes) {
7878
if (!scopes.getOptions().isTracingEnabled()) {
7979
return SamplingResult.create(SamplingDecision.RECORD_ONLY);
8080
}
@@ -100,7 +100,11 @@ public SamplingResult shouldSample(
100100
.getOptions()
101101
.getInternalTracesSampler()
102102
.sample(
103-
new SamplingContext(transactionContext, null, propagationContext.getSampleRand(), toMapWithStringKeys(attributes)));
103+
new SamplingContext(
104+
transactionContext,
105+
null,
106+
propagationContext.getSampleRand(),
107+
toMapWithStringKeys(attributes)));
104108

105109
if (!sentryDecision.getSampled()) {
106110
scopes
@@ -144,12 +148,12 @@ public SamplingResult shouldSample(
144148

145149
if (attributes != null) {
146150
attributes.forEach(
147-
(key, value) -> {
148-
if (key != null) {
149-
final @NotNull String stringKey = key.getKey();
151+
(key, value) -> {
152+
if (key != null) {
153+
final @NotNull String stringKey = key.getKey();
150154
mapWithStringKeys.put(stringKey, value);
151155
}
152-
});
156+
});
153157
}
154158

155159
return mapWithStringKeys;

sentry/src/main/java/io/sentry/SamplingContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import io.sentry.util.Objects;
44
import io.sentry.util.SentryRandom;
5+
import java.util.Collections;
6+
import java.util.Map;
57
import org.jetbrains.annotations.ApiStatus;
68
import org.jetbrains.annotations.NotNull;
79
import org.jetbrains.annotations.Nullable;
810

9-
import java.util.Collections;
10-
import java.util.Map;
11-
1211
/**
1312
* Context used by {@link io.sentry.SentryOptions.TracesSamplerCallback} to determine if transaction
1413
* is going to be sampled.

sentry/src/main/java/io/sentry/Sentry.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ private static void handleAppStartProfilingConfig(
460460
TransactionContext appStartTransactionContext = new TransactionContext("app.launch", "profile");
461461
appStartTransactionContext.setForNextAppStart(true);
462462
SamplingContext appStartSamplingContext =
463-
new SamplingContext(appStartTransactionContext, null, SentryRandom.current().nextDouble(), null);
463+
new SamplingContext(
464+
appStartTransactionContext, null, SentryRandom.current().nextDouble(), null);
464465
return options.getInternalTracesSampler().sample(appStartSamplingContext);
465466
}
466467

0 commit comments

Comments
 (0)