Skip to content

Commit

Permalink
Merge branch 'main' into feat/android-profile-rate-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanosiano authored Jun 13, 2023
2 parents fb1f07a + 3bb708a commit 165fde9
Show file tree
Hide file tree
Showing 15 changed files with 825 additions and 108 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
${{ runner.os }}-gradle-
- name: Initialize CodeQL
uses: github/codeql-action/init@83f0fe6c4988d98a455712a27f0255212bba9bd4 # pin@v2
uses: github/codeql-action/init@cdcdbb579706841c47f7063dda365e292e5cad7a # pin@v2
with:
languages: ${{ matrix.language }}

- run: |
./gradlew assemble
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@83f0fe6c4988d98a455712a27f0255212bba9bd4 # pin@v2
uses: github/codeql-action/analyze@cdcdbb579706841c47f7063dda365e292e5cad7a # pin@v2
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
### Features

- Add profile rate limiting ([#2782](https://github.com/getsentry/sentry-java/pull/2782))
- 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
import io.sentry.apollo3.sentryTracing

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))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#063)
- [diff](https://github.com/getsentry/sentry-native/compare/0.6.2...0.6.3)

## 6.22.0

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
21 changes: 15 additions & 6 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 @@ -32,9 +39,11 @@ public final class io/sentry/apollo3/SentryApollo3Interceptor : com/apollographq
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;Z)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;ZLjava/util/List;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;ZLjava/util/List;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static final fun sentryTracing (Lcom/apollographql/apollo3/ApolloClient$Builder;ZLjava/util/List;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static synthetic fun sentryTracing$default (Lcom/apollographql/apollo3/ApolloClient$Builder;Lio/sentry/IHub;ZLjava/util/List;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;ILjava/lang/Object;)Lcom/apollographql/apollo3/ApolloClient$Builder;
public static synthetic fun sentryTracing$default (Lcom/apollographql/apollo3/ApolloClient$Builder;ZLjava/util/List;Lio/sentry/apollo3/SentryApollo3HttpInterceptor$BeforeSpanCallback;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 165fde9

Please sign in to comment.