Skip to content

Commit 94ba63c

Browse files
authored
POTEL 13 - Use transaction name (#3464)
* replace hub with scopes * Add Scopes * Introduce `IScopes` interface. * Replace `IHub` with `IScopes` in core * Replace `IHub` with `IScopes` in android core * Replace `IHub` with `IScopes` in android integrations * Replace `IHub` with `IScopes` in apollo integrations * Replace `IHub` with `IScopes` in okhttp integration * Replace `IHub` with `IScopes` in graphql integration * Replace `IHub` with `IScopes` in logging integrations * Replace `IHub` with `IScopes` in more integrations * Replace `IHub` with `IScopes` in OTel integration * Replace `IHub` with `IScopes` in Spring 5 / Spring Boot 2 integrations * Replace `IHub` with `IScopes` in Spring 6 / Spring Boot 3 integrations * Replace `IHub` with `IScopes` in samples * gitscopes -> github * Replace ThreadLocal with ScopesStorage * Move client and throwable to span map to scope * Add global scope * use global scope in Scopes * Implement pushScope popScope and withScope for Scopes * Add pushIsolationScope; add fork methods to ISCope * Use separate scopes for current, isolation and global scope; rename mainScopes to rootScopes * Allow controlling which scope configureScope uses * Combine scopes * Use new API for CRONS integrations * Add lifecycle helper * Change spring integrations to use new API * Use new API in servlet integrations * Use new API for kotlin coroutines and wrapers for Supplier/Callable * Discussion TODOs * Fix breadcrumb ordering * Mark TODOS with [HSM] * Add getGlobalScope and forkedRootScopes to IScopes * Fix EventProcessor ordering on scopes * Reuse code in Scopes * No longer replace global scope * Replace hub occurrences in comments, var names etc. * Implement ScopesTest * Implement CombinedScopeViewTest * Fix combined contexts * Use combined scopes for cross platform * Changes according to reviews of previous PRs * more * even more * isEnabled checks client instead of having a property on Scopes * Use SentryOptions.empty * Remove Hub * Use OpenTelemetry for Performance and Scopes propagation * Promote certain span attributes * Use OTel in Sentry API * Deduplicate SpanInfo extraction * Forward Sentry API to Sentry through OTel * Use OTel status for Sentry span API * POTel Tracing * fix root span detection (remote flag), and scope closing * Inherit OTel span IDs when sending to sentry * Fix tracing; parse incoming baggage; add baggage to outgoing * Cleanup * Move sampling logic to OTel Sampler * Remove internal span attributes so they are not sent to Sentry * Use transaction name * remove obsolete comment
1 parent dd6307a commit 94ba63c

File tree

1 file changed

+8
-3
lines changed
  • sentry-opentelemetry/sentry-opentelemetry-bootstrap/src/main/java/io/sentry/opentelemetry

1 file changed

+8
-3
lines changed

sentry-opentelemetry/sentry-opentelemetry-bootstrap/src/main/java/io/sentry/opentelemetry/OtelSpanFactory.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public final class OtelSpanFactory implements ISpanFactory {
4040
@NotNull IScopes scopes,
4141
@NotNull TransactionOptions transactionOptions,
4242
@Nullable TransactionPerformanceCollector transactionPerformanceCollector) {
43-
// TODO [POTEL] name vs. op for transaction
4443
final @Nullable OtelSpanWrapper span =
4544
createSpanInternal(
4645
scopes, transactionOptions, null, context.getSamplingDecision(), context);
@@ -137,8 +136,14 @@ public final class OtelSpanFactory implements ISpanFactory {
137136
if (description != null) {
138137
sentrySpan.setDescription(description);
139138
}
140-
if (samplingDecision != null) {
141-
sentrySpan.getSpanContext().setSamplingDecision(samplingDecision);
139+
// TODO [POTEL] do we need this?
140+
// if (samplingDecision != null) {
141+
// sentrySpan.getSpanContext().setSamplingDecision(samplingDecision);
142+
// }
143+
if (spanContext instanceof TransactionContext) {
144+
final @NotNull TransactionContext transactionContext = (TransactionContext) spanContext;
145+
sentrySpan.setTransactionName(
146+
transactionContext.getName(), transactionContext.getTransactionNameSource());
142147
}
143148
}
144149

0 commit comments

Comments
 (0)