Skip to content

Support for before send log #2634

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

solnic
Copy link
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
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? 🙂

Copy link

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.13%. Comparing base (73745bb) to head (900cc5c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2634      +/-   ##
==========================================
- Coverage   97.11%   95.13%   -1.99%     
==========================================
  Files         133      133              
  Lines        5095     5094       -1     
==========================================
- Hits         4948     4846     -102     
- Misses        147      248     +101     
Components Coverage Δ
sentry-ruby 95.27% <100.00%> (-2.44%) ⬇️
sentry-rails 93.71% <ø> (-1.09%) ⬇️
sentry-sidekiq 95.01% <ø> (+0.74%) ⬆️
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.36% <100.00%> (+0.03%) ⬆️
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
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")

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