Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors reported to sentry.io result in an <unlabelled event> #15623

Closed
u6f6o opened this issue Mar 11, 2021 · 10 comments · Fixed by #15847
Closed

Errors reported to sentry.io result in an <unlabelled event> #15623

u6f6o opened this issue Mar 11, 2021 · 10 comments · Fixed by #15847

Comments

@u6f6o
Copy link

u6f6o commented Mar 11, 2021

In our setup, we use sentry.io to report errors. This setup seems to be currently broken for our quarkus services though. Errors reported to sentry.io do not show any actual content but are marked as unlabelled events:

image

Expected behavior
Errors in sentry should contain stacktraces, error messages etc.

Actual behavior
All errors reported result in unlabelled events with actual no content.

Configuration
gradle.properties:

# Add your application.properties here, if applicable.
#Gradle properties
#Fri Dec 18 09:44:23 CET 2020
quarkusPluginVersion=1.12.1.Final
quarkusPlatformArtifactId=quarkus-bom
quarkusPluginId=io.quarkus
quarkusPlatformGroupId=io.quarkus
quarkusPlatformVersion=1.12.1.Final
org.gradle.logging.level=INFO

dependencies from build.gradle

dependencies {

    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")

    implementation 'io.quarkus:quarkus-amazon-dynamodb'
    implementation 'software.amazon.awssdk:dynamodb-enhanced'
    implementation 'io.quarkus:quarkus-smallrye-openapi'
    implementation 'io.quarkus:quarkus-jackson'
    implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
    implementation 'de.spinscale.quarkus:quarkus-logging-ecs:0.0.2'
    implementation 'io.quarkus:quarkus-logging-sentry'
    implementation 'io.quarkus:quarkus-micrometer'
    implementation 'io.micrometer:micrometer-registry-prometheus'
    implementation 'io.quarkus:quarkus-cache'
    implementation 'io.quarkus:quarkus-config-yaml'
    implementation 'io.quarkus:quarkus-smallrye-health'
    implementation 'io.quarkus:quarkus-smallrye-jwt'
    implementation 'io.quarkus:quarkus-smallrye-jwt-build'
    implementation 'io.quarkus:quarkus-container-image-jib'
    implementation 'io.quarkus:quarkus-kotlin'
    implementation 'io.quarkus:quarkus-resteasy-reactive'
    implementation 'io.quarkus:quarkus-resteasy-reactive-jackson'
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
    implementation 'io.github.microutils:kotlin-logging:1.12.0'
}

Environment (please complete the following information):

  • Quarkus version or git rev: 1.12.1.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): Gradle 6.3
@u6f6o u6f6o added the kind/bug Something isn't working label Mar 11, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 11, 2021

/cc @evanchooly, @geoand

@u6f6o
Copy link
Author

u6f6o commented Mar 11, 2021

I initially forgot to mention, that this issue occurs only with the native image.

@u6f6o
Copy link
Author

u6f6o commented Mar 12, 2021

I took some time and played with the reflection recorder. After adding the following entries in reflection-config.json, the basic error reporting finally worked. I am not certain though, if this covers all possible cases. Looks like the sentry-java library is not ready for native execution yet:

[
  {
    "name":"io.sentry.Breadcrumb",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.SentryBaseEvent",
    "allDeclaredFields":true
  },
  {
    "name":"io.sentry.SentryEvent",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.SentryValues",
    "allDeclaredFields":true
  },
  {
    "name":"io.sentry.protocol.DebugImage",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.DebugMeta",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.Mechanism",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.Message",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.Request",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.SdkInfo",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.SdkVersion",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.SentryException",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.SentryPackage",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.SentryStackFrame",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.SentryStackTrace",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.SentryThread",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  },
  {
    "name":"io.sentry.protocol.User",
    "allDeclaredFields":true,
    "methods":[{"name":"<init>","parameterTypes":[] }]
  }
]

@maciejwalkowiak
Copy link
Contributor

FYI we are working on it on the Sentry SDK side: getsentry/sentry-java#1329

@maxandersen
Copy link
Member

@ia3andy any idea why we dont have this issue - just a feature of sentry we didnt use and thus wasnt noticed ?

gsmet added a commit to gsmet/quarkus that referenced this issue Mar 18, 2021
Fixes quarkusio#15623
Based on the work of u6f6o and Maciej Walkowiak
@gsmet
Copy link
Member

gsmet commented Mar 18, 2021

In the meantime, I think we should fix it for 1.13. I implemented the rules here while we wait for the upgrade to a Sentry version including them: #15847 .

@gsmet
Copy link
Member

gsmet commented Mar 18, 2021

@u6f6o if you have the time to check the PR fixes your issue, that would be very nice.

https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#checking-an-issue-is-fixed-in-main might be of help (except you need to target my PR branch instead of main).

@ia3andy
Copy link
Contributor

ia3andy commented Mar 18, 2021

@ia3andy any idea why we dont have this issue - just a feature of sentry we didnt use and thus wasnt noticed ?

In code.quarkus.io we are not using native, so I guess this was never actually tested in native.

@maciejwalkowiak it would be nice if we add some integration tests to make sure events are sent correctly (native & non native), any idea how we could do it, mocking some Sentry components maybe?

@maciejwalkowiak
Copy link
Contributor

You can mock the transport - which is the last piece before payloads are sent to Sentry. Maybe you can take a look at how I did the tests for Logback appender to verify events at the very end: https://github.com/getsentry/sentry-java/blob/main/sentry-logback/src/test/kotlin/io/sentry/logback/SentryAppenderTest.kt#L82 and https://github.com/getsentry/sentry-java/blob/main/sentry-test-support/src/main/kotlin/io/sentry/test/assertions.kt

@quarkus-bot quarkus-bot bot added this to the 1.14 - main milestone Mar 18, 2021
@u6f6o
Copy link
Author

u6f6o commented Mar 19, 2021

@gsmet : I tested it as well, it worked for me. Thx for the fix!

@gsmet gsmet modified the milestones: 1.14 - main, 1.13.0.Final Mar 23, 2021
gsmet added a commit to gsmet/quarkus that referenced this issue Mar 23, 2021
Fixes quarkusio#15623
Based on the work of u6f6o and Maciej Walkowiak

(cherry picked from commit 908c87f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants