Skip to content

Commit

Permalink
Merge f3f75a2 into ce75759
Browse files Browse the repository at this point in the history
  • Loading branch information
adinauer committed Jun 19, 2024
2 parents ce75759 + f3f75a2 commit a5cd4f3
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class SentryOkHttpEventTest {
TransactionContext("name", "op", TracesSamplingDecision(true)),
SentryTracer(TransactionContext("name", "op", TracesSamplingDecision(true)), scopes),
scopes,
null,
SpanOptions()
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public SamplingResult shouldSample(
final @NotNull SpanKind spanKind,
final @NotNull Attributes attributes,
final @NotNull List<LinkData> parentLinks) {
// TODO [POTEL] use SamplingDecision.DROP sentry internal spans
// note: parentLinks seems to usually be empty
final @Nullable Span parentOtelSpan = Span.fromContextOrNull(parentContext);
final @Nullable OtelSpanWrapper parentSentrySpan =
Expand All @@ -65,6 +66,7 @@ public SamplingResult shouldSample(
private @NotNull SamplingResult handleRootOtelSpan(
final @NotNull String traceId, final @NotNull Context parentContext) {
if (!options.isTraceSampling()) {
// TODO [POTEL] should this return RECORD_ONLY to allow tracing without performance
return SamplingResult.create(SamplingDecision.DROP);
}
@Nullable Baggage baggage = null;
Expand Down
2 changes: 1 addition & 1 deletion sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -3098,7 +3098,7 @@ public final class io/sentry/ShutdownHookIntegration : io/sentry/Integration, ja
}

public final class io/sentry/Span : io/sentry/ISpan {
public fun <init> (Lio/sentry/TransactionContext;Lio/sentry/SentryTracer;Lio/sentry/IScopes;Lio/sentry/SentryDate;Lio/sentry/SpanOptions;)V
public fun <init> (Lio/sentry/TransactionContext;Lio/sentry/SentryTracer;Lio/sentry/IScopes;Lio/sentry/SpanOptions;)V
public fun finish ()V
public fun finish (Lio/sentry/SpanStatus;)V
public fun finish (Lio/sentry/SpanStatus;Lio/sentry/SentryDate;)V
Expand Down
3 changes: 1 addition & 2 deletions sentry/src/main/java/io/sentry/SentryTracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public SentryTracer(
Objects.requireNonNull(context, "context is required");
Objects.requireNonNull(scopes, "scopes are required");

this.root =
new Span(context, this, scopes, transactionOptions.getStartTimestamp(), transactionOptions);
this.root = new Span(context, this, scopes, transactionOptions);

this.name = context.getName();
this.instrumenter = context.getInstrumenter();
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/main/java/io/sentry/Span.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public Span(
final @NotNull TransactionContext context,
final @NotNull SentryTracer sentryTracer,
final @NotNull IScopes scopes,
final @Nullable SentryDate startTimestamp,
final @NotNull SpanOptions options) {
this.context = Objects.requireNonNull(context, "context is required");
this.context.setOrigin(options.getOrigin());
this.transaction = Objects.requireNonNull(sentryTracer, "sentryTracer is required");
this.scopes = Objects.requireNonNull(scopes, "scopes are required");
this.spanFinishedCallback = null;
final @Nullable SentryDate startTimestamp = options.getStartTimestamp();
if (startTimestamp != null) {
this.startTimestamp = startTimestamp;
} else {
Expand Down
1 change: 0 additions & 1 deletion sentry/src/main/java/io/sentry/SpanOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class SpanOptions {
/** The start timestamp of the transaction */
private @Nullable SentryDate startTimestamp = null;

// TODO [POTEL] this should also work for non OTel spans
/**
* Gets the startTimestamp
*
Expand Down
3 changes: 1 addition & 2 deletions sentry/src/test/java/io/sentry/protocol/SentrySpanTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class SentrySpanTest {
TransactionContext("name", "op"),
mock<SentryTracer>(),
mock<IScopes>(),
SentryLongDate(1000000),
SpanOptions()
SpanOptions().also { it.startTimestamp = SentryLongDate(1000000) }
)

val sentrySpan = SentrySpan(span)
Expand Down
1 change: 0 additions & 1 deletion sentry/src/test/java/io/sentry/util/TracingUtilsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class TracingUtilsTest {
TransactionContext("name", "op", TracesSamplingDecision(true)),
SentryTracer(TransactionContext("name", "op", TracesSamplingDecision(true)), scopes),
scopes,
null,
SpanOptions()
)
}
Expand Down

0 comments on commit a5cd4f3

Please sign in to comment.