Skip to content

Support for before_send_log option#2634

Merged
solnic merged 6 commits intomasterfrom
2633-support-for-before_send_log
May 20, 2025
Merged

Support for before_send_log option#2634
solnic merged 6 commits intomasterfrom
2633-support-for-before_send_log

Conversation

@solnic
Copy link
Copy Markdown
Collaborator

@solnic solnic commented May 19, 2025

This adds support for a new configuration option called before_send_log.

Closes #2633

@solnic solnic linked an issue May 19, 2025 that may be closed by this pull request
@solnic
Copy link
Copy Markdown
Collaborator Author

solnic commented May 19, 2025

@sl0thentr0py do we need to support hint argument here too? Also, any...hints how to handle recording lost events in case of logs? 🙂

@codecov
Copy link
Copy Markdown

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.12%. Comparing base (73745bb) to head (297ce99).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2634      +/-   ##
==========================================
- Coverage   97.11%   95.12%   -2.00%     
==========================================
  Files         133      133              
  Lines        5095     5125      +30     
==========================================
- Hits         4948     4875      -73     
- Misses        147      250     +103     
Components Coverage Δ
sentry-ruby 95.49% <100.00%> (-2.21%) ⬇️
sentry-rails 91.91% <ø> (-2.89%) ⬇️
sentry-sidekiq 96.16% <ø> (+1.89%) ⬆️
sentry-resque 94.44% <ø> (ø)
sentry-delayed_job 94.68% <ø> (ø)
sentry-opentelemetry 98.62% <ø> (-1.38%) ⬇️
Files with missing lines Coverage Δ
sentry-ruby/lib/sentry/client.rb 99.40% <100.00%> (+0.07%) ⬆️
sentry-ruby/lib/sentry/configuration.rb 98.35% <100.00%> (+0.01%) ⬆️
sentry-ruby/lib/sentry/log_event_buffer.rb 100.00% <100.00%> (ø)

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sl0thentr0py
Copy link
Copy Markdown
Member

sl0thentr0py commented May 19, 2025

checked python (empty placeholder hint) and JS (no hint)

https://github.com/getsentry/sentry-python/blob/8be519faa2d7df2d1882fa2f57cbca13cc899328/sentry_sdk/client.py#L937-L941
https://github.com/getsentry/sentry-javascript/blob/61940fc22052e9005043f77c7355db1742d1d78c/packages/core/src/logs/exports.ts#L132

let's just go with no hint since I can't see any additional info we can put in there anyway


the client report you can use

record_lost_event(:before_send, "log_item")

@solnic solnic force-pushed the 2633-support-for-before_send_log branch from 4cbbdf5 to b9d5ce6 Compare May 20, 2025 11:37
@solnic solnic marked this pull request as ready for review May 20, 2025 11:41
@solnic solnic requested a review from sl0thentr0py May 20, 2025 11:42
@solnic solnic changed the title Support for before send log Support for before_send_log option May 20, 2025
@solnic solnic requested a review from sl0thentr0py May 20, 2025 11:59
@solnic solnic merged commit ee6536f into master May 20, 2025
139 of 140 checks passed
@solnic solnic deleted the 2633-support-for-before_send_log branch May 20, 2025 12:39
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.

Support for before_send_log

2 participants