_Platform:_
_IDE:_
_Build system:_
_Android Gradle Plugin:_
_Sentry Android Gradle Plugin:_
_Proguard/R8:_
_Platform installed with:_
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.
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:
Expected result:
@dparrella thanks for testing out Performance for the Java SDK :)
environment and release are set to transactions too, fixed by #1147 already, and hopefully, there'll be a new alpha version today.
If you want to filter out transactions, you could use the TracesSamplerCallback or tracesSampleRate instead of SentryBeforeSendCallback.
About the tags, indeed, we're still discussing which fields should be set to transactions, We want transactions to be cheap so it doesn't make sense to set everything, right.
Which fields would be vital for you? thanks.
@maciejwalkowiak tags is already part of the SentryBaseEvent but it's not copying the tags over in the processTransaction method, was it purposely or an oversight?
Ideally, we'd need to discuss field per field, what makes sense to be copied over, tags does make sense IMO, they are filterable items on the dashboard.
@marandaneto agreed. Since transactions are not a subject of event processing they are also not processed by the MainEventProcessor. I believe the starting point should be specifying what's in the SentryBaseEvent and do most of the processing on this base class.
@dparrella thanks for testing out Performance for the Java SDK :)
environmentandreleaseare set to transactions too, fixed by #1147 already, and hopefully, there'll be a new alpha version today.If you want to filter out transactions, you could use the
TracesSamplerCallbackortracesSampleRateinstead ofSentryBeforeSendCallback.About the tags, indeed, we're still discussing which fields should be set to transactions, We want transactions to be cheap so it doesn't make sense to set everything, right.
Which fields would be vital for you? thanks.
@marandaneto environment and release are the most important, so thanks for getting that fixed! Without those we can't use those drop-downs to filter transactions in the UI ;-). For the sake of consistency, I do think it is reasonable to expect the same tags that we would see on our Issues. Otherwise the filtering/searching does not work the same. So what I'm saying is, tags are important :).
@marandaneto do we consider this issue as critical part for https://github.com/getsentry/sentry-java/issues/1151? I can easily add setting tags but perhaps we are going to have field by field guidelines?
@maciejwalkowiak I'd say that tags are part of the bare min. because of filtering/searching, but still, we'd need to figure out field by field.
I guess we could definitely do a PR adding tags and sdk, as the sdk would be important for debugging at the beginning, so we know which versions are sending bad/wrong data if any.
Might be the case that sdk is already appended automatically because the envelope header contains it.
What is left now is the request field, which contains useful info too, this is populated automatically when using servlet and spring, right?
If not super complicated, I'd be sure request is also available thru transactions, but tags I'd consider the bare min.
@dparrella would you expect the Scope's tags also to be available under transactions?
Scope's tags are those added at runtime via configureScope, thanks.