getsentry / sentry-java

A Sentry SDK for Java, Android and other JVM languages.
https://docs.sentry.io/
MIT License
1.16k stars 435 forks source link

Using `setContext` on transaction fails ingestion for simple types #3350

Open adinauer opened 7 months ago

adinauer commented 7 months ago

Integration

sentry

Java Version

any

Version

7.8.0

Steps to Reproduce

Use setContext on transaction and set any of String, Boolean or number as value.

Expected Result

Event is ingested

Actual Result

Ingestion doesn't work for these values.

adinauer commented 7 months ago

In Scope.java we wrap simple values with a HashMap and key value. See https://github.com/getsentry/sentry-java/blob/7b7964f423f45db68b01e66b1b6ce08dacb3e7b6/sentry/src/main/java/io/sentry/Scope.java#L614-L690

romtsn commented 7 months ago

@adinauer is the event just dropped, or just the values that are set incorrectly are not showing up?

adinauer commented 7 months ago

The simple values in Contexts are dropped and the ingested JSON and UI have some info about it but the event shows up in Sentry.