Sentry-java: Unable to set tags at different levels

Created on 24 Jul 2020  路  12Comments  路  Source: getsentry/sentry-java

If sentry is configured for instance in sentry.properties with tags=commitHash:a5e39b08 and has env property, SENTRY_TAGS="namespaceK8s:test", then tags map is { namespaceK8s: test }while I would have expect tags to be merged in { namespaceK8s: test, commitHash: a5e39b08}.

I could prepare a pull request to fix it, but I would to know if it may be accepted before.

Legacy SDK enhancement help wanted

Most helpful comment

I agree, maybe the community could help with it, we accept PRs :)

All 12 comments

@mmadoo thanks for raising this, looks like a bug.
@bruno-garcia is it indeed a bug or intended to be like this? ideas?

Looks like it was an oversight indeed. A PR would be most welcomed. Thanks.

@bruno-garcia @maciejwalkowiak do you know if we merge configurations or one is a precedence of the other?

In v3 we do not merge configurations and we do not support setting tags externally. Perhaps something for 3.1?

sounds good

With #875, merge is done for tags (see https://github.com/DCbrainOrg/sentry-java/blob/0d6c3d45c66e68fbbe265c988e84825421f8c872/sentry/src/test/java/io/sentry/DefaultSentryClientFactoryTest.java#L69 )

With #875, merge is done for tags (see https://github.com/DCbrainOrg/sentry-java/blob/0d6c3d45c66e68fbbe265c988e84825421f8c872/sentry/src/test/java/io/sentry/DefaultSentryClientFactoryTest.java#L69 )

yep for v1.x, my comment was about the new version v3.x

In case of v3 we would need to add tags property to SentryOptions and likely set them on events in MainEventProcessor or some other event processor. If it's something you @marandaneto agree with I can take care of preparing the PR.

I don't think we have this in the unified API.
In ASP.NET Core I've added that as options.DefaultTags which bind to the framework's config system

So if you set things in the appseettinggs.json file, it ends up on all events (the integration basically does configureScope(s -> s.setTag(defaultTags) on startup

@bruno-garcia wondering if we should close it as non-supported or a feature request? as it's not a bug on v3, but actually a feature request which is not part of our unified API.

Agree it isn't a bug, it's a feature we dropped. Lets keep it open while we discuss how to proceed here.
We're considering adding an _integration_ that will bind SENTRY_ things into sentry options. Lets see how relevant to folks this is to prioritize this.

We either work on performance support or 1000 ways to load configs into the SDK. I believe we'd add more value adding performance support

I agree, maybe the community could help with it, we accept PRs :)

Was this page helpful?
0 / 5 - 0 ratings