Skip to content

Commit 7c61b46

Browse files
POTEL 58 - Extract OpenTelemetry URL_PATH span attribute into description (#3933)
* Extract OTel URL_PATH span attribute into description * Update sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SpanDescriptionExtractor.java Co-authored-by: Stefano <[email protected]> * changelog --------- Co-authored-by: Stefano <[email protected]>
1 parent 6de95f1 commit 7c61b46

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Features
6+
7+
- Extract OpenTelemetry `URL_PATH` span attribute into description ([#3933](https://github.com/getsentry/sentry-java/pull/3933))
8+
39
## 8.0.0-beta.3
410

511
### Features

sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SpanDescriptionExtractor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,19 @@ private OtelSpanInfo descriptionForHttpMethod(
6868
httpPath = httpTarget;
6969
}
7070
final @NotNull String op = opBuilder.toString();
71+
7172
final @Nullable String urlFull = attributes.get(UrlAttributes.URL_FULL);
7273
if (urlFull != null) {
7374
if (httpPath == null) {
7475
httpPath = urlFull;
7576
}
7677
}
7778

79+
final @Nullable String urlPath = attributes.get(UrlAttributes.URL_PATH);
80+
if (httpPath == null && urlPath != null) {
81+
httpPath = urlPath;
82+
}
83+
7884
if (httpPath == null) {
7985
return new OtelSpanInfo(op, name, TransactionNameSource.CUSTOM);
8086
}

0 commit comments

Comments
 (0)