Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ public final class io/sentry/HubAdapter : io/sentry/IHub {
public fun setUser (Lio/sentry/protocol/User;)V
public fun startSession ()V
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down Expand Up @@ -674,7 +673,6 @@ public final class io/sentry/HubScopesWrapper : io/sentry/IHub {
public fun setUser (Lio/sentry/protocol/User;)V
public fun startSession ()V
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down Expand Up @@ -915,7 +913,6 @@ public abstract interface class io/sentry/IScopes {
public abstract fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public fun startTransaction (Ljava/lang/String;Ljava/lang/String;)Lio/sentry/ITransaction;
public fun startTransaction (Ljava/lang/String;Ljava/lang/String;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public abstract fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public abstract fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public abstract fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down Expand Up @@ -1450,7 +1447,6 @@ public final class io/sentry/NoOpHub : io/sentry/IHub {
public fun setUser (Lio/sentry/protocol/User;)V
public fun startSession ()V
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down Expand Up @@ -1611,7 +1607,6 @@ public final class io/sentry/NoOpScopes : io/sentry/IScopes {
public fun setUser (Lio/sentry/protocol/User;)V
public fun startSession ()V
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down Expand Up @@ -2208,7 +2203,6 @@ public final class io/sentry/Scopes : io/sentry/IScopes, io/sentry/metrics/Metri
public fun startSession ()V
public fun startSpanForMetric (Ljava/lang/String;Ljava/lang/String;)Lio/sentry/ISpan;
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down Expand Up @@ -2274,7 +2268,6 @@ public final class io/sentry/ScopesAdapter : io/sentry/IScopes {
public fun setUser (Lio/sentry/protocol/User;)V
public fun startSession ()V
public fun startTransaction (Lio/sentry/TransactionContext;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down Expand Up @@ -2384,7 +2377,6 @@ public final class io/sentry/Sentry {
public static fun startTransaction (Ljava/lang/String;Ljava/lang/String;)Lio/sentry/ITransaction;
public static fun startTransaction (Ljava/lang/String;Ljava/lang/String;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public static fun startTransaction (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/sentry/TransactionOptions;)Lio/sentry/ITransaction;
public static fun traceHeaders ()Lio/sentry/SentryTraceHeader;
public static fun withIsolationScope (Lio/sentry/ScopeCallback;)V
public static fun withScope (Lio/sentry/ScopeCallback;)V
}
Expand Down
6 changes: 0 additions & 6 deletions sentry/src/main/java/io/sentry/HubAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,6 @@ public boolean isAncestorOf(final @Nullable IScopes otherScopes) {
return Sentry.startTransaction(transactionContext, transactionOptions);
}

@Deprecated
@Override
public @Nullable SentryTraceHeader traceHeaders() {
return Sentry.traceHeaders();
}

@Override
public void setSpanContext(
final @NotNull Throwable throwable,
Expand Down
5 changes: 0 additions & 5 deletions sentry/src/main/java/io/sentry/HubScopesWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,6 @@ public boolean isAncestorOf(final @Nullable IScopes otherScopes) {
return scopes.startTransaction(transactionContext, transactionOptions);
}

@Override
public @Nullable SentryTraceHeader traceHeaders() {
return scopes.traceHeaders();
}

@ApiStatus.Internal
@Override
public void setSpanContext(
Expand Down
11 changes: 0 additions & 11 deletions sentry/src/main/java/io/sentry/IScopes.java
Original file line number Diff line number Diff line change
Expand Up @@ -583,17 +583,6 @@ ITransaction startTransaction(
final @NotNull TransactionContext transactionContext,
final @NotNull TransactionOptions transactionOptions);

/**
* Returns the "sentry-trace" header that allows tracing across services. Can also be used in
* <meta> HTML tags. Also see {@link IScopes#getBaggage()}.
*
* @deprecated please use {@link IScopes#getTraceparent()} instead.
* @return sentry trace header or null
*/
@Deprecated
@Nullable
SentryTraceHeader traceHeaders();

/**
* Associates {@link ISpan} and the transaction name with the {@link Throwable}. Used to determine
* in which trace the exception has been thrown in framework integrations.
Expand Down
7 changes: 0 additions & 7 deletions sentry/src/main/java/io/sentry/NoOpHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,6 @@ public boolean isAncestorOf(@Nullable IScopes otherScopes) {
return NoOpTransaction.getInstance();
}

@Override
@Deprecated
@SuppressWarnings("InlineMeSuggester")
public @NotNull SentryTraceHeader traceHeaders() {
return new SentryTraceHeader(SentryId.EMPTY_ID, SpanId.EMPTY_ID, true);
}

@Override
public void setSpanContext(
final @NotNull Throwable throwable,
Expand Down
7 changes: 0 additions & 7 deletions sentry/src/main/java/io/sentry/NoOpScopes.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,6 @@ public boolean isAncestorOf(@Nullable IScopes otherScopes) {
return NoOpTransaction.getInstance();
}

@Override
@Deprecated
@SuppressWarnings("InlineMeSuggester")
public @NotNull SentryTraceHeader traceHeaders() {
return new SentryTraceHeader(SentryId.EMPTY_ID, SpanId.EMPTY_ID, true);
}

@Override
public void setSpanContext(
final @NotNull Throwable throwable,
Expand Down
7 changes: 0 additions & 7 deletions sentry/src/main/java/io/sentry/Scopes.java
Original file line number Diff line number Diff line change
Expand Up @@ -900,13 +900,6 @@ public void flush(long timeoutMillis) {
return transaction;
}

@Deprecated
@SuppressWarnings("InlineMeSuggester")
@Override
public @Nullable SentryTraceHeader traceHeaders() {
return getTraceparent();
}

@Override
@ApiStatus.Internal
public void setSpanContext(
Expand Down
7 changes: 0 additions & 7 deletions sentry/src/main/java/io/sentry/ScopesAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,6 @@ public boolean isAncestorOf(final @Nullable IScopes otherScopes) {
return Sentry.startTransaction(transactionContext, transactionOptions);
}

@Deprecated
@Override
@SuppressWarnings("deprecation")
public @Nullable SentryTraceHeader traceHeaders() {
return Sentry.traceHeaders();
}

@ApiStatus.Internal
@Override
public void setSpanContext(
Expand Down
13 changes: 0 additions & 13 deletions sentry/src/main/java/io/sentry/Sentry.java
Original file line number Diff line number Diff line change
Expand Up @@ -1031,19 +1031,6 @@ public static void endSession() {
return getCurrentScopes().startTransaction(transactionContext, transactionOptions);
}

/**
* Returns the "sentry-trace" header that allows tracing across services. Can also be used in
* <meta> HTML tags. Also see {@link Sentry#getBaggage()}.
*
* @deprecated please use {@link Sentry#getTraceparent()} instead.
* @return sentry trace header or null
*/
@Deprecated
@SuppressWarnings("InlineMeSuggester")
public static @Nullable SentryTraceHeader traceHeaders() {
return getCurrentScopes().traceHeaders();
}

/**
* Gets the current active transaction or span.
*
Expand Down
5 changes: 0 additions & 5 deletions sentry/src/test/java/io/sentry/HubAdapterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ class HubAdapterTest {
verify(scopes).startTransaction(eq(transactionContext), eq(transactionOptions))
}

@Test fun `traceHeaders calls Hub`() {
HubAdapter.getInstance().traceHeaders()
verify(scopes).traceHeaders()
}

@Test fun `setSpanContext calls Hub`() {
val throwable = mock<Throwable>()
val span = mock<ISpan>()
Expand Down
6 changes: 0 additions & 6 deletions sentry/src/test/java/io/sentry/NoOpHubTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.mockito.kotlin.verify
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertSame

Expand Down Expand Up @@ -84,11 +83,6 @@ class NoOpHubTest {
@Test
fun `clone returns the same instance`() = assertSame(NoOpHub.getInstance(), sut.clone())

@Test
fun `traceHeaders is not null`() {
assertNotNull(sut.traceHeaders())
}

@Test
fun `getSpan returns null`() {
assertNull(sut.span)
Expand Down
5 changes: 0 additions & 5 deletions sentry/src/test/java/io/sentry/ScopesAdapterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ class ScopesAdapterTest {
verify(scopes).startTransaction(eq(transactionContext), eq(transactionOptions))
}

@Test fun `traceHeaders calls Scopes`() {
ScopesAdapter.getInstance().traceHeaders()
verify(scopes).traceHeaders()
}

@Test fun `setSpanContext calls Scopes`() {
val throwable = mock<Throwable>()
val span = mock<ISpan>()
Expand Down
23 changes: 0 additions & 23 deletions sentry/src/test/java/io/sentry/ScopesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1822,29 +1822,6 @@ class ScopesTest {
}
//endregion

//region startTransaction tests
@Test
fun `when traceHeaders and no transaction is active, traceHeaders are generated from scope`() {
val scopes = generateScopes()

var spanId: SpanId? = null
scopes.configureScope { spanId = it.propagationContext.spanId }

val traceHeader = scopes.traceHeaders()
assertNotNull(traceHeader)
assertEquals(spanId, traceHeader.spanId)
}

@Test
fun `when traceHeaders and there is an active transaction, traceHeaders are not null`() {
val scopes = generateScopes()
val tx = scopes.startTransaction("aTransaction", "op")
scopes.configureScope { it.setTransaction(tx) }

assertNotNull(scopes.traceHeaders())
}
//endregion

//region getSpan tests
@Test
fun `when there is no active transaction, getSpan returns null`() {
Expand Down
Loading