Skip to content

Commit d7316ea

Browse files
committed
renamed
1 parent 19c0eaa commit d7316ea

File tree

9 files changed

+36
-25
lines changed

9 files changed

+36
-25
lines changed

sentry-android-ndk/src/main/java/io/sentry/android/ndk/NdkScopeObserver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void setTrace(@Nullable SpanContext spanContext, @NotNull IScope scope) {
137137
}
138138

139139
try {
140-
options.getExecutorService().submit(() -> nativeScope.setTraceId(spanContext.getTraceId().toString(), spanContext.getSpanId().toString()));
140+
options.getExecutorService().submit(() -> nativeScope.setTrace(spanContext.getTraceId().toString(), spanContext.getSpanId().toString()));
141141
} catch (Throwable e) {
142142
options.getLogger().log(SentryLevel.ERROR, e, "Scope sync setTraceId failed.");
143143
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ public void reportFullyDisplayed() {
323323
}
324324

325325
@Override
326-
public void continueTrace(
326+
public void setTrace(
327327
final @NotNull String traceId, final @NotNull String spanId) {
328-
Sentry.continueTrace(traceId, spanId);
328+
Sentry.setTrace(traceId, spanId);
329329
}
330330

331331
@Override

sentry/src/main/java/io/sentry/HubScopesWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ public void reportFullyDisplayed() {
317317
}
318318

319319
@Override
320-
public void continueTrace(
320+
public void setTrace(
321321
@NotNull String traceId, @NotNull String spanId) {
322-
scopes.continueTrace(traceId, spanId);
322+
scopes.setTrace(traceId, spanId);
323323
}
324324

325325
@Override

sentry/src/main/java/io/sentry/IScopes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,12 @@ TransactionContext continueTrace(
658658
final @Nullable String sentryTrace, final @Nullable List<String> baggageHeaders);
659659

660660
/**
661-
* Continue a trace based on the trace ID and span ID provided
661+
* Set a trace. This is primarily used by other SDKs in a Hybrid SDK context
662662
*
663663
* @param traceId the trace ID
664664
* @param spanId the span ID this is continuing the trace from
665665
*/
666-
void continueTrace(final @NotNull String traceId, final @NotNull String spanId);
666+
void setTrace(final @NotNull String traceId, final @NotNull String spanId);
667667

668668
/**
669669
* Returns the "sentry-trace" header that allows tracing across services. Can also be used in

sentry/src/main/java/io/sentry/NoOpHub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public void reportFullyDisplayed() {}
277277
}
278278

279279
@Override
280-
public void continueTrace(
280+
public void setTrace(
281281
final @NotNull String traceID, final @NotNull String spanId) {}
282282

283283
@Override

sentry/src/main/java/io/sentry/NoOpScopes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public void reportFullyDisplayed() {}
272272
}
273273

274274
@Override
275-
public void continueTrace(
275+
public void setTrace(
276276
final @NotNull String traceId, final @NotNull String spanId) { }
277277

278278
@Override

sentry/src/main/java/io/sentry/Scopes.java

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -950,30 +950,41 @@ public void setActiveSpan(final @Nullable ISpan span) {
950950
getOptions().getCacheDirPath(), !getOptions().isEnableAutoSessionTracking());
951951
}
952952

953-
@Override
954-
public void reportFullyDisplayed() {
955-
if (getOptions().isEnableTimeToFullDisplayTracing()) {
956-
getOptions().getFullyDisplayedReporter().reportFullyDrawn();
957-
}
958-
}
959-
960953
@Override
961954
public @Nullable TransactionContext continueTrace(
962-
final @Nullable String sentryTrace, final @Nullable List<String> baggageHeaders) {
955+
final @Nullable String sentryTrace, final @Nullable List<String> baggageHeaders) {
963956
@NotNull
964957
PropagationContext propagationContext =
965-
PropagationContext.fromHeaders(getOptions().getLogger(), sentryTrace, baggageHeaders);
958+
PropagationContext.fromHeaders(getOptions().getLogger(), sentryTrace, baggageHeaders);
966959
configureScope(
967-
(scope) -> {
968-
scope.setPropagationContext(propagationContext);
969-
});
960+
(scope) -> {
961+
scope.setPropagationContext(propagationContext);
962+
});
970963
if (getOptions().isTracingEnabled()) {
971964
return TransactionContext.fromPropagationContext(propagationContext);
972965
} else {
973966
return null;
974967
}
975968
}
976969

970+
@Override
971+
public void continueTrace(
972+
final @NotNull String traceId, final @NotNull String spanID) {
973+
@NotNull
974+
PropagationContext propagationContext = PropagationContext.fromId(traceId, spanID);
975+
configureScope(
976+
(scope) -> {
977+
scope.setPropagationContext(propagationContext);
978+
});
979+
}
980+
981+
@Override
982+
public void reportFullyDisplayed() {
983+
if (getOptions().isEnableTimeToFullDisplayTracing()) {
984+
getOptions().getFullyDisplayedReporter().reportFullyDrawn();
985+
}
986+
}
987+
977988
@Override
978989
public @Nullable SentryTraceHeader getTraceparent() {
979990
if (!isEnabled()) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,9 @@ public void reportFullyDisplayed() {
322322
}
323323

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

330330
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,9 @@ public interface OptionsConfiguration<T extends SentryOptions> {
11691169
* @param spanId the span ID
11701170
*/
11711171
// return TransactionContext (if performance enabled) or null (if performance disabled)
1172-
public static void continueTrace(
1172+
public static void setTrace(
11731173
final @NotNull String traceId, final @NotNull String spanId) {
1174-
getCurrentScopes().continueTrace(traceId, spanId);
1174+
getCurrentScopes().setTrace(traceId, spanId);
11751175
}
11761176

11771177
/**

0 commit comments

Comments
 (0)