Skip to content

Transactions are missing configured tags #1163

@dparrella

Description

@dparrella

Platform:

  • Android -> If yes, which Device API (and compileSdkVersion/targetSdkVersion/Build tools) version?
  • Java -> If yes, which Java (and sourceCompatibility/targetCompatibility) version? JDK 11
  • Kotlin -> If yes, which Kotlin (and jvmTarget) version?
  • NDK -> If yes, which NDK/CMake version?
  • React-Native -> If yes, which version?
  • Timber -> If yes, which version?
  • Log4j2 -> If yes, which version?
  • Logback -> If yes, which version?
  • Spring -> If yes, which version?

IDE:

  • Android Studio -> If yes, which version?
  • IntelliJ -> If yes, which version?
  • Other -> If yes, which one?

Build system:

  • Gradle -> If yes, which version?
  • Buck -> If yes, which version?
  • Bazel -> If yes, which version?
  • Maven -> If yes, which version?
  • Other -> If yes, which one?

Android Gradle Plugin:

  • Yes -> If yes, which version?
  • No

Sentry Android Gradle Plugin:

  • Yes -> If yes, which version?
  • No

Proguard/R8:

  • Enabled
  • Disabled

Platform installed with:

  • JCenter
  • Bintray
  • Maven Central
  • Manually

The version of the SDK:
4.0.0-alpha.2


I have the following issue:

I've noticed that all transactions are missing tags, including the environment and release. These are configured using SentryOptions that we pass in to Sentry.init(). These tags appear on all of our Issues.

It also seems like the SentryBeforeSendCallback we configure is not called, so it is not possible to work around the issue.

We are using the logback and Spring integrations but I am able to reproduce even with just manual calls to send a transaction.

Inspecting the code and setting a breakpoint with a debugger, I can see that SentryClient.captureTransaction() has the correctly configured scope, but the transaction has no tags.

https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/SentryClient.java#L343-L378

Steps to reproduce:

Initialize Sentry:

SentryOptions options = SentryOptions.from(PropertiesProviderFactory.create());
options.setDsn("your-dsn-here");
options.setEnvironment("test");
options.setRelease("1234");
options.setTracesSampleRate(1.0);
options.setTag("tag", "bag");

Sentry.init(options);

Send a transaction:

final SentryTransaction transaction = Sentry.startTransaction("test transaction");
final ISpan span = Sentry.getSpan();
final Span innerSpan = span.startChild("test", "a test span");
innerSpan.finish();
transaction.finish();

Actual result:

  • Transaction is visible in the UI but it has none of the expected tags (environment, release, "tag").

Expected result:

  • Transaction should have the same tags we would expect to see on Issues as configured via SentryOptions.
  • SentryBeforeSendCallback should be invoked, as SentryTransaction is another SentryEvent

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance API issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions