New dependency on jni for Sentry (on Linux)

I wonder if anyone else has this problem.

  1. My game uses Sentry for error reporting.
  2. Sentry used to be “pure Dart”, and worked well on Linux.
  3. With the latest update, Sentry uses JNI and therefore Java? Apparently?

This breaks my build and even if it didn’t, I’m not a big fan of using Java to do something that Dart can easily do by itself?

Here’s what I suddenly see in linux/flutter/generated_plugins.cmake:

list(APPEND FLUTTER_FFI_PLUGIN_LIST
  jni
)

Something similar happens on Windows, btw, but I don’t have build issues there.

Anyway, I just filed a bug (while I was writing this post, in fact, because I realized it’s actually a bug). Here’s the link: Sentry's dependency on JNI breaks build on Linux · Issue #3284 · getsentry/sentry-dart · GitHub

Any inputs highly appreciated!

did you consider using OTLP? I’m also looking into getting logs, it should be enough for getting errors.

There are a lot of vendors that can consume OTLP, even sentry.

there’s another implementation, seems more actively maintained

Thanks for the suggestion! I haven’t seen Otel yet, and it seem nice. I’m making a note to have a look later.

From what I can see, though, the one feature that I really care about (logs) is either unimplemented (pkg:opentelemetry) or it seems to assume a vendor (pkg:dartastic_opentelemetry, which is dartastic). So I think this doesn’t solve my immediate issue. (Though I’m super happy it exists and look forward to using it.)

pkg:dartastic_opentelemetry readme: Dartastic can be used with any OTel backend, it's standards-compliant.

I think dartastic here means the package not their service, which doesn’t even seem available yet, so probably you can use other OTLP compatible backend.

They’re planning to donate the package to [Donation Proposal]: Dart SDK and API for OpenTelemetry · Issue #2718 · open-telemetry/community · GitHub
Logs are not implemented in dartastic either. It has to be implemented before they can donate it.

They are looking for contributors.

1 Like