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

Add new Sentry.capture_check_in API for Cron monitoring #2117

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

sl0thentr0py
Copy link
Member

@sl0thentr0py sl0thentr0py commented Sep 27, 2023

  • New CheckInEvent class for the envelope payload
  • New Cron::MonitorConfig class that holds the monitor configuration
  • New Cron::MonitorSchedule module that holds two types of schedules Crontab and Interval

part of #2090

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #2117 (fb9bc77) into master (ba29bb8) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2117      +/-   ##
==========================================
+ Coverage   97.41%   97.48%   +0.06%     
==========================================
  Files          85       88       +3     
  Lines        3294     3382      +88     
==========================================
+ Hits         3209     3297      +88     
  Misses         85       85              
Components Coverage Δ
sentry-ruby 97.99% <100.00%> (+0.10%) ⬆️
sentry-rails 94.96% <ø> (ø)
sentry-sidekiq ∅ <ø> (∅)
sentry-resque 91.80% <ø> (-1.64%) ⬇️
sentry-delayed_job ∅ <ø> (∅)
sentry-opentelemetry 100.00% <ø> (ø)
Files Coverage Δ
sentry-ruby/lib/sentry-ruby.rb 95.83% <100.00%> (+0.08%) ⬆️
sentry-ruby/lib/sentry/check_in_event.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/client.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/cron/monitor_config.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/cron/monitor_schedule.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/hub.rb 99.38% <100.00%> (+0.04%) ⬆️
sentry-ruby/lib/sentry/integrable.rb 100.00% <100.00%> (ø)
...-ruby/lib/sentry/utils/argument_checking_helper.rb 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@sl0thentr0py sl0thentr0py force-pushed the neel/crons/capture-checkin branch 4 times, most recently from f48f9c1 to 1b0377e Compare October 4, 2023 12:23
@sl0thentr0py sl0thentr0py marked this pull request as ready for review October 4, 2023 13:31
Copy link
Member

@cleptric cleptric left a comment

Choose a reason for hiding this comment

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

Looks fine to me, I'm just worried about all the places CodeCov calls out as being uncovered.

sentry-ruby/lib/sentry-ruby.rb Outdated Show resolved Hide resolved
@sl0thentr0py
Copy link
Member Author

codecov is off, just ignore it, a lot of those lines are covered

sentry-ruby/lib/sentry-ruby.rb Outdated Show resolved Hide resolved
@cleptric
Copy link
Member

cleptric commented Oct 4, 2023

Oh, and please get the codecove stuff fixed. You'll likely want to do something similar to https://github.com/getsentry/sentry/blob/master/codecov.yml#L61-L63.

@sl0thentr0py sl0thentr0py force-pushed the neel/crons/capture-checkin branch 2 times, most recently from c2f266f to 045578a Compare October 5, 2023 08:51
* New `CheckInEvent` class for the envelope payload
* New `Cron::MonitorConfig` class that holds the monitor configuration
* New `Cron::MonitorSchedule` module that holds two types of schedules
  `Crontab` and `Interval`
@sl0thentr0py
Copy link
Member Author

CI will be fixed separately, codecov is now fixed so i'm merging

@sl0thentr0py sl0thentr0py merged commit 286135c into master Oct 5, 2023
70 of 97 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/crons/capture-checkin branch October 5, 2023 13:54
end

describe '.from_interval' do
it 'returns nil without valid unit' do

Choose a reason for hiding this comment

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

@sl0thentr0py would you consider having this raise instead? Maybe just in development/test?

I spent way too long trying to work out why this wasn't reporting properly:

image

Copy link
Member Author

Choose a reason for hiding this comment

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

in general, as a principle, we don't raise in the Sentry SDK since we are an error monitoring service and we don't want to raise our own errors.

I could add debug logs if you wish.

Choose a reason for hiding this comment

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

Haha yes that makes a lot of sense 😂

Logging would be amazing.

Copy link
Member Author

Choose a reason for hiding this comment

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

tracking #2456

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.

3 participants