Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Sentry.init and specifying contextTags now has an effect on the Log4j SentryAppender #2054

Merged
merged 7 commits into from
May 25, 2022

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented May 17, 2022

📜 Description

No longer used the contextTags property in SentryAppender, instead get via Options from HubAdapter.

💡 Motivation and Context

Fix #2043 for Log4j

💚 How did you test it?

Demo code

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brrrr, this feels wrong again, having to maintain 2 different properties for the same purpose 🤣

Would it be possible to set contextTags directly on the hub in the SentryAppender constructor? This way we could eliminate the field contextTags and wouldn't need to set it in start.

Although this could be a problem if the appender was initialized but never started, we still set the contextTags on the hub, don't know if that can be ever the case

Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
@adinauer
Copy link
Member Author

brrrr, this feels wrong again, having to maintain 2 different properties for the same purpose 🤣

Would it be possible to set contextTags directly on the hub in the SentryAppender constructor? This way we could eliminate the field contextTags and wouldn't need to set it in start.

Although this could be a problem if the appender was initialized but never started, we still set the contextTags on the hub, don't know if that can be ever the case

I've added something to #2053 , should we deal with this at a later time?

@romtsn
Copy link
Member

romtsn commented May 18, 2022

brrrr, this feels wrong again, having to maintain 2 different properties for the same purpose 🤣
Would it be possible to set contextTags directly on the hub in the SentryAppender constructor? This way we could eliminate the field contextTags and wouldn't need to set it in start.
Although this could be a problem if the appender was initialized but never started, we still set the contextTags on the hub, don't know if that can be ever the case

I've added something to #2053 , should we deal with this at a later time?

Yeah sure, was just a quick suggestion, but we can do it later

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2022

Codecov Report

❗ No coverage uploaded for pull request base (6.x.x@6b3fd20). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff            @@
##             6.x.x    #2054   +/-   ##
========================================
  Coverage         ?   81.07%           
  Complexity       ?     3217           
========================================
  Files            ?      230           
  Lines            ?    11821           
  Branches         ?     1572           
========================================
  Hits             ?     9584           
  Misses           ?     1650           
  Partials         ?      587           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b3fd20...c3e71d6. Read the comment docs.

@adinauer
Copy link
Member Author

adinauer commented May 18, 2022

brrrr, this feels wrong again, having to maintain 2 different properties for the same purpose 🤣
Would it be possible to set contextTags directly on the hub in the SentryAppender constructor? This way we could eliminate the field contextTags and wouldn't need to set it in start.
Although this could be a problem if the appender was initialized but never started, we still set the contextTags on the hub, don't know if that can be ever the case

I've added something to #2053 , should we deal with this at a later time?

Yeah sure, was just a quick suggestion, but we can do it later

I like the suggestion but I'm not sure about the consequences so I don't wanna rush it. The quick fix should suffice for now I hope.

adinauer and others added 2 commits May 18, 2022 09:15
Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
@maciejwalkowiak
Copy link
Contributor

I believe it should be put on hold until #2052 (review) is resolved, so that we have ideally one consistent approach between logging frameworks.

@adinauer adinauer merged commit e0fd191 into 6.x.x May 25, 2022
@adinauer adinauer deleted the fix/init-not-affecting-log4j branch May 25, 2022 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants