Skip to content

Commit

Permalink
Merge f355e91 into 57d88b9
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Jun 13, 2023
2 parents 57d88b9 + f355e91 commit 44d22ce
Show file tree
Hide file tree
Showing 13 changed files with 816 additions and 103 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## Unreleased

### Features

- Support for automatically capturing Failed GraphQL (Apollo 3) Client errors ([#2781](https://github.com/getsentry/sentry-java/pull/2781))

```kotlin
import com.apollographql.apollo3.ApolloClient

val apolloClient = ApolloClient.Builder()
.serverUrl("https://example.com/graphql")
.sentryTracing(captureFailedRequests = true)
.build()
```

### Dependencies

- Bump Native SDK from v0.6.2 to v0.6.3 ([#2746](https://github.com/getsentry/sentry-java/pull/2746))
Expand Down
10 changes: 10 additions & 0 deletions sentry-android-core/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,13 @@
-keep class * extends io.sentry.SentryOptions { *; }

##---------------End: proguard configuration for android-core ----------

##---------------Begin: proguard configuration for sentry-apollo-3 ----------

# don't warn about missing classes, as it depends on the sentry-apollo-3 jar dependency.
-dontwarn io.sentry.apollo3.SentryApollo3ClientException

# we don't want this class to be obfuscated, otherwise issue's titles are obfuscated as well.
-keep class io.sentry.apollo3.SentryApollo3ClientException { <init>(...); }

##---------------End: proguard configuration for sentry-apollo-3 ----------
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import io.sentry.ISpan
import io.sentry.IntegrationName
import io.sentry.SentryEvent
import io.sentry.SentryIntegrationPackageStorage
import io.sentry.SentryOptions.DEFAULT_PROPAGATION_TARGETS
import io.sentry.SpanStatus
import io.sentry.TypeCheckHint.OKHTTP_REQUEST
import io.sentry.TypeCheckHint.OKHTTP_RESPONSE
Expand Down Expand Up @@ -46,7 +47,7 @@ class SentryOkHttpInterceptor(
private val failedRequestStatusCodes: List<HttpStatusCodeRange> = listOf(
HttpStatusCodeRange(HttpStatusCodeRange.DEFAULT_MIN, HttpStatusCodeRange.DEFAULT_MAX)
),
private val failedRequestTargets: List<String> = listOf(".*")
private val failedRequestTargets: List<String> = listOf(DEFAULT_PROPAGATION_TARGETS)
) : Interceptor, IntegrationName {

constructor() : this(HubAdapter.getInstance())
Expand Down
19 changes: 14 additions & 5 deletions sentry-apollo-3/api/sentry-apollo-3.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ public final class io/sentry/apollo3/BuildConfig {
public static final field VERSION_NAME Ljava/lang/String;
}

public final class io/sentry/apollo3/SentryApollo3ClientException : java/lang/Exception {
public fun <init> (Ljava/lang/String;)V
public final fun getSerialVersionUID ()J
}

public final class io/sentry/apollo3/SentryApollo3HttpInterceptor : com/apollographql/apollo3/network/http/HttpInterceptor, io/sentry/IntegrationName {
public static final field Companion Lio/sentry/apollo3/SentryApollo3HttpInterceptor$Companion;
public static final field SENTRY_APOLLO_3_OPERATION_NAME Ljava/lang/String;
public static final field DEFAULT_CAPTURE_FAILED_REQUESTS Z
public static final field SENTRY_APOLLO_3_OPERATION_TYPE Ljava/lang/String;
public static final field SENTRY_APOLLO_3_VARIABLES Ljava/lang/String;
public fun <init> ()V
public fun <init> (Lio/sentry/IHub;)V
public fun <init> (Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;)V
public synthetic fun <init> (Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;Z)V
public fun <init> (Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;)V
public synthetic fun <init> (Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun dispose ()V
public fun getIntegrationName ()Ljava/lang/String;
public fun intercept (Lcom/apollographql/apollo3/api/http/HttpRequest;Lcom/apollographql/apollo3/network/http/HttpInterceptorChain;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand All @@ -33,8 +40,10 @@ public final class io/sentry/apollo3/SentryApolloBuilderExtensionsKt {
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static synthetic fun sentryTracing$default (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ILjava/lang/Object;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static synthetic fun sentryTracing$default (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ILjava/lang/Object;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;Z)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static synthetic fun sentryTracing$default (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;ILjava/lang/Object;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static synthetic fun sentryTracing$default (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;ILjava/lang/Object;)Lcom/apollographql/apollo3/ApolloClient$Builder;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.sentry.apollo3

/**
* Used for holding an Apollo3 client error, for example. An integration that does not throw when API
* returns 4xx, 5xx or the `errors` field.
*/
class SentryApollo3ClientException(message: String?) : Exception(message) {
val serialVersionUID = 1L
}
Loading

0 comments on commit 44d22ce

Please sign in to comment.