Skip to content

Commit cbe837c

Browse files
committed
moved 'settrace' to internal
1 parent 05147f9 commit cbe837c

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.sentry.android.core;
22

3+
import static io.sentry.Sentry.getCurrentScopes;
34
import static io.sentry.SentryLevel.DEBUG;
45
import static io.sentry.SentryLevel.INFO;
56
import static io.sentry.SentryLevel.WARNING;
@@ -329,4 +330,14 @@ private static Session updateSession(
329330
});
330331
return sessionRef.get();
331332
}
333+
334+
/**
335+
* Continue a trace based on the trace ID and span ID provided
336+
*
337+
* @param traceId the trace ID
338+
* @param spanId the span ID
339+
*/
340+
public static void setTrace(final @NotNull String traceId, final @NotNull String spanId, final @Nullable String sampleRand) {
341+
getCurrentScopes().setTrace(traceId, spanId);
342+
}
332343
}

sentry/src/main/java/io/sentry/HubAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public void reportFullyDisplayed() {
324324

325325
@Override
326326
public void setTrace(final @NotNull String traceId, final @NotNull String spanId) {
327-
Sentry.setTrace(traceId, spanId);
327+
Sentry.getCurrentScopes().setTrace(traceId, spanId);
328328
}
329329

330330
@Override

sentry/src/main/java/io/sentry/ScopesAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public void reportFullyDisplayed() {
323323

324324
@Override
325325
public void setTrace(final @NotNull String traceId, final @NotNull String spanId) {
326-
Sentry.setTrace(traceId, spanId);
326+
Sentry.getCurrentScopes().setTrace(traceId, spanId);
327327
}
328328

329329
@Override

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,17 +1162,6 @@ public interface OptionsConfiguration<T extends SentryOptions> {
11621162
return getCurrentScopes().continueTrace(sentryTrace, baggageHeaders);
11631163
}
11641164

1165-
/**
1166-
* Continue a trace based on the trace ID and span ID provided
1167-
*
1168-
* @param traceId the trace ID
1169-
* @param spanId the span ID
1170-
*/
1171-
// return TransactionContext (if performance enabled) or null (if performance disabled)
1172-
public static void setTrace(final @NotNull String traceId, final @NotNull String spanId) {
1173-
getCurrentScopes().setTrace(traceId, spanId);
1174-
}
1175-
11761165
/**
11771166
* Returns the "sentry-trace" header that allows tracing across services. Can also be used in
11781167
* &lt;meta&gt; HTML tags. Also see {@link Sentry#getBaggage()}.

0 commit comments

Comments
 (0)