Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.opentelemetry.semconv.incubating.MessagingIncubatingAttributes;
import io.sentry.SentryOptions;
import io.sentry.protocol.TransactionNameSource;
import io.sentry.util.UrlUtils;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -77,10 +78,8 @@ private OtelSpanInfo descriptionForHttpMethod(
final @NotNull String op = opBuilder.toString();

final @Nullable String urlFull = attributes.get(UrlAttributes.URL_FULL);
if (urlFull != null) {
if (httpPath == null) {
httpPath = urlFull;
}
if (urlFull != null && httpPath == null) {
httpPath = UrlUtils.parse(urlFull).getUrl();
}

final @Nullable String urlPath = attributes.get(UrlAttributes.URL_PATH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class SpanDescriptionExtractorTest {
val info = whenExtractingSpanInfo()

assertEquals("http.server", info.op)
assertEquals("GET https://sentry.io/some/path?q=1#top", info.description)
assertEquals("GET https://sentry.io/some/path", info.description)
assertEquals(TransactionNameSource.URL, info.transactionNameSource)
}

Expand Down
Loading