Skip to content

Commit

Permalink
POTEL 29 - Partially fix bootstrap class loading (#3543)
Browse files Browse the repository at this point in the history
* Partially fix class loading into bootstrap classloader

* changelog
  • Loading branch information
adinauer authored Jul 3, 2024
1 parent a62056e commit afff380
Show file tree
Hide file tree
Showing 19 changed files with 250 additions and 164 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- Support spans that are split into multiple batches ([#3539](https://github.com/getsentry/sentry-java/pull/3539))
- When spans belonging to a single transaction were split into multiple batches for SpanExporter, we did not add all spans because the isSpanTooOld check wasn't inverted.
- Parse and use `send-default-pii` and `max-request-body-size` from `sentry.properties` ([#3534](https://github.com/getsentry/sentry-java/pull/3534))
- Partially fix bootstrap class loading ([#3543](https://github.com/getsentry/sentry-java/pull/3543))
- There was a problem with two separate Sentry `Scopes` being active inside each OpenTelemetry `Context` due to using context keys from more than one class loader.

## 8.0.0-alpha.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ val upstreamAgent = configurations.create("upstreamAgent") {
dependencies {
bootstrapLibs(projects.sentry)
bootstrapLibs(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap)
bootstrapLibs(projects.sentryOpentelemetry.sentryOpentelemetryExtra)
javaagentLibs(projects.sentryOpentelemetry.sentryOpentelemetryAgentcustomization)
upstreamAgent(Config.Libs.OpenTelemetry.otelJavaAgent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ dependencies {
exclude(group = "io.opentelemetry")
exclude(group = "io.opentelemetry.javaagent")
}
// compileOnly(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap)
implementation(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap)
compileOnly(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap)
implementation(projects.sentryOpentelemetry.sentryOpentelemetryExtra)

compileOnly(Config.Libs.OpenTelemetry.otelSdk)
compileOnly(Config.Libs.OpenTelemetry.otelExtensionAutoconfigureSpi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,169 +10,10 @@ public final class io/sentry/opentelemetry/InternalSemanticAttributes {
public fun <init> ()V
}

public final class io/sentry/opentelemetry/OpenTelemetryUtil {
public fun <init> ()V
public static fun applyOpenTelemetryOptions (Lio/sentry/SentryOptions;)V
}

public final class io/sentry/opentelemetry/OtelContextScopesStorage : io/sentry/IScopesStorage {
public fun <init> ()V
public fun close ()V
public fun get ()Lio/sentry/IScopes;
public fun set (Lio/sentry/IScopes;)Lio/sentry/ISentryLifecycleToken;
}

public final class io/sentry/opentelemetry/OtelSpanContext : io/sentry/SpanContext {
public fun <init> (Lio/opentelemetry/sdk/trace/ReadWriteSpan;Lio/sentry/TracesSamplingDecision;Lio/sentry/opentelemetry/OtelSpanWrapper;Lio/sentry/Baggage;)V
public fun getOperation ()Ljava/lang/String;
public fun getStatus ()Lio/sentry/SpanStatus;
public fun setOperation (Ljava/lang/String;)V
public fun setStatus (Lio/sentry/SpanStatus;)V
}

public final class io/sentry/opentelemetry/OtelSpanFactory : io/sentry/ISpanFactory {
public fun <init> ()V
public fun createSpan (Lio/sentry/IScopes;Lio/sentry/SpanOptions;Lio/sentry/SpanContext;Lio/sentry/ISpan;)Lio/sentry/ISpan;
public fun createTransaction (Lio/sentry/TransactionContext;Lio/sentry/IScopes;Lio/sentry/TransactionOptions;Lio/sentry/TransactionPerformanceCollector;)Lio/sentry/ITransaction;
public fun retrieveCurrentSpan (Lio/sentry/IScope;)Lio/sentry/ISpan;
public fun retrieveCurrentSpan (Lio/sentry/IScopes;)Lio/sentry/ISpan;
}

public final class io/sentry/opentelemetry/OtelSpanWrapper : io/sentry/ISpan {
public fun <init> (Lio/opentelemetry/sdk/trace/ReadWriteSpan;Lio/sentry/IScopes;Lio/sentry/SentryDate;Lio/sentry/TracesSamplingDecision;Lio/sentry/opentelemetry/OtelSpanWrapper;Lio/sentry/Baggage;)V
public fun finish ()V
public fun finish (Lio/sentry/SpanStatus;)V
public fun finish (Lio/sentry/SpanStatus;Lio/sentry/SentryDate;)V
public fun getContexts ()Lio/sentry/protocol/Contexts;
public fun getData ()Ljava/util/Map;
public fun getData (Ljava/lang/String;)Ljava/lang/Object;
public fun getDescription ()Ljava/lang/String;
public fun getFinishDate ()Lio/sentry/SentryDate;
public fun getLocalMetricsAggregator ()Lio/sentry/metrics/LocalMetricsAggregator;
public fun getMeasurements ()Ljava/util/Map;
public fun getOperation ()Ljava/lang/String;
public fun getSamplingDecision ()Lio/sentry/TracesSamplingDecision;
public fun getScopes ()Lio/sentry/IScopes;
public fun getSpanContext ()Lio/sentry/SpanContext;
public fun getStartDate ()Lio/sentry/SentryDate;
public fun getStatus ()Lio/sentry/SpanStatus;
public fun getTag (Ljava/lang/String;)Ljava/lang/String;
public fun getTags ()Ljava/util/Map;
public fun getThrowable ()Ljava/lang/Throwable;
public fun getTraceId ()Lio/sentry/protocol/SentryId;
public fun getTransactionName ()Ljava/lang/String;
public fun getTransactionNameSource ()Lio/sentry/protocol/TransactionNameSource;
public fun isFinished ()Z
public fun isNoOp ()Z
public fun isProfileSampled ()Ljava/lang/Boolean;
public fun isSampled ()Ljava/lang/Boolean;
public fun makeCurrent ()Lio/sentry/ISentryLifecycleToken;
public fun setContext (Ljava/lang/String;Ljava/lang/Object;)V
public fun setData (Ljava/lang/String;Ljava/lang/Object;)V
public fun setDescription (Ljava/lang/String;)V
public fun setMeasurement (Ljava/lang/String;Ljava/lang/Number;)V
public fun setMeasurement (Ljava/lang/String;Ljava/lang/Number;Lio/sentry/MeasurementUnit;)V
public fun setOperation (Ljava/lang/String;)V
public fun setStatus (Lio/sentry/SpanStatus;)V
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
public fun setThrowable (Ljava/lang/Throwable;)V
public fun setTransactionName (Ljava/lang/String;)V
public fun setTransactionName (Ljava/lang/String;Lio/sentry/protocol/TransactionNameSource;)V
public fun startChild (Lio/sentry/SpanContext;Lio/sentry/SpanOptions;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;Lio/sentry/SentryDate;Lio/sentry/Instrumenter;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;Lio/sentry/SentryDate;Lio/sentry/Instrumenter;Lio/sentry/SpanOptions;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;Lio/sentry/SpanOptions;)Lio/sentry/ISpan;
public fun toBaggageHeader (Ljava/util/List;)Lio/sentry/BaggageHeader;
public fun toSentryTrace ()Lio/sentry/SentryTraceHeader;
public fun traceContext ()Lio/sentry/TraceContext;
public fun updateEndDate (Lio/sentry/SentryDate;)Z
}

public final class io/sentry/opentelemetry/OtelTransactionSpanForwarder : io/sentry/ITransaction {
public fun <init> (Lio/sentry/opentelemetry/OtelSpanWrapper;)V
public fun finish ()V
public fun finish (Lio/sentry/SpanStatus;)V
public fun finish (Lio/sentry/SpanStatus;Lio/sentry/SentryDate;)V
public fun finish (Lio/sentry/SpanStatus;Lio/sentry/SentryDate;ZLio/sentry/Hint;)V
public fun forceFinish (Lio/sentry/SpanStatus;ZLio/sentry/Hint;)V
public fun getContexts ()Lio/sentry/protocol/Contexts;
public fun getData (Ljava/lang/String;)Ljava/lang/Object;
public fun getDescription ()Ljava/lang/String;
public fun getEventId ()Lio/sentry/protocol/SentryId;
public fun getFinishDate ()Lio/sentry/SentryDate;
public fun getLatestActiveSpan ()Lio/sentry/ISpan;
public fun getLocalMetricsAggregator ()Lio/sentry/metrics/LocalMetricsAggregator;
public fun getName ()Ljava/lang/String;
public fun getOperation ()Ljava/lang/String;
public fun getSamplingDecision ()Lio/sentry/TracesSamplingDecision;
public fun getSpanContext ()Lio/sentry/SpanContext;
public fun getSpans ()Ljava/util/List;
public fun getStartDate ()Lio/sentry/SentryDate;
public fun getStatus ()Lio/sentry/SpanStatus;
public fun getTag (Ljava/lang/String;)Ljava/lang/String;
public fun getThrowable ()Ljava/lang/Throwable;
public fun getTransactionNameSource ()Lio/sentry/protocol/TransactionNameSource;
public fun isFinished ()Z
public fun isNoOp ()Z
public fun isProfileSampled ()Ljava/lang/Boolean;
public fun isSampled ()Ljava/lang/Boolean;
public fun makeCurrent ()Lio/sentry/ISentryLifecycleToken;
public fun scheduleFinish ()V
public fun setContext (Ljava/lang/String;Ljava/lang/Object;)V
public fun setData (Ljava/lang/String;Ljava/lang/Object;)V
public fun setDescription (Ljava/lang/String;)V
public fun setMeasurement (Ljava/lang/String;Ljava/lang/Number;)V
public fun setMeasurement (Ljava/lang/String;Ljava/lang/Number;Lio/sentry/MeasurementUnit;)V
public fun setName (Ljava/lang/String;)V
public fun setName (Ljava/lang/String;Lio/sentry/protocol/TransactionNameSource;)V
public fun setOperation (Ljava/lang/String;)V
public fun setStatus (Lio/sentry/SpanStatus;)V
public fun setTag (Ljava/lang/String;Ljava/lang/String;)V
public fun setThrowable (Ljava/lang/Throwable;)V
public fun startChild (Lio/sentry/SpanContext;Lio/sentry/SpanOptions;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;Lio/sentry/SentryDate;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;Lio/sentry/SentryDate;Lio/sentry/Instrumenter;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;Lio/sentry/SentryDate;Lio/sentry/Instrumenter;Lio/sentry/SpanOptions;)Lio/sentry/ISpan;
public fun startChild (Ljava/lang/String;Ljava/lang/String;Lio/sentry/SpanOptions;)Lio/sentry/ISpan;
public fun toBaggageHeader (Ljava/util/List;)Lio/sentry/BaggageHeader;
public fun toSentryTrace ()Lio/sentry/SentryTraceHeader;
public fun traceContext ()Lio/sentry/TraceContext;
public fun updateEndDate (Lio/sentry/SentryDate;)Z
}

public final class io/sentry/opentelemetry/SentryContextStorage : io/opentelemetry/context/ContextStorage {
public fun <init> (Lio/opentelemetry/context/ContextStorage;)V
public fun attach (Lio/opentelemetry/context/Context;)Lio/opentelemetry/context/Scope;
public fun current ()Lio/opentelemetry/context/Context;
}

public final class io/sentry/opentelemetry/SentryContextWrapper : io/opentelemetry/context/Context {
public fun get (Lio/opentelemetry/context/ContextKey;)Ljava/lang/Object;
public fun toString ()Ljava/lang/String;
public fun with (Lio/opentelemetry/context/ContextKey;Ljava/lang/Object;)Lio/opentelemetry/context/Context;
public static fun wrap (Lio/opentelemetry/context/Context;)Lio/sentry/opentelemetry/SentryContextWrapper;
}

public final class io/sentry/opentelemetry/SentryOtelKeys {
public static final field SENTRY_BAGGAGE_KEY Lio/opentelemetry/context/ContextKey;
public static final field SENTRY_SCOPES_KEY Lio/opentelemetry/context/ContextKey;
public static final field SENTRY_TRACE_KEY Lio/opentelemetry/context/ContextKey;
public fun <init> ()V
}

public final class io/sentry/opentelemetry/SentryOtelThreadLocalStorage : io/opentelemetry/context/ContextStorage {
public fun <init> ()V
public fun attach (Lio/opentelemetry/context/Context;)Lio/opentelemetry/context/Scope;
public fun current ()Lio/opentelemetry/context/Context;
}

public final class io/sentry/opentelemetry/SentryWeakSpanStorage {
public static fun getInstance ()Lio/sentry/opentelemetry/SentryWeakSpanStorage;
public fun getSentrySpan (Lio/opentelemetry/api/trace/SpanContext;)Lio/sentry/opentelemetry/OtelSpanWrapper;
public fun storeSentrySpan (Lio/opentelemetry/api/trace/SpanContext;Lio/sentry/opentelemetry/OtelSpanWrapper;)V
}

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
compileOnly(projects.sentry)
// TODO implementation?
compileOnly(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap)
compileOnly(projects.sentryOpentelemetry.sentryOpentelemetryExtra)

implementation(Config.Libs.OpenTelemetry.otelSdk)
compileOnly(Config.Libs.OpenTelemetry.otelSemconv)
Expand All @@ -34,6 +35,7 @@ dependencies {

// tests
testImplementation(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap)
testImplementation(projects.sentryOpentelemetry.sentryOpentelemetryExtra)
testImplementation(projects.sentryTestSupport)
testImplementation(kotlin(Config.kotlinStdLib))
testImplementation(Config.TestLibs.kotlinTestJunit)
Expand Down
Loading

0 comments on commit afff380

Please sign in to comment.