getsentry / sentry-ruby

Sentry SDK for Ruby
https://sentry.io/for/ruby
MIT License
927 stars 493 forks source link

Cron monitors slug prefix #2279

Closed ixti closed 1 month ago

ixti commented 5 months ago

Cron monitor slugs are global per-organization. Thus, it will be very nice to be able to specify slugs prefix. In addition, it would be nice to keep sidekiq-scheduler's cron name as is instead of using slug as the name.

Why do you think it's beneficial to most of the users

Possible implementation

Sentry.init do |c|
  c.crons.slug_prefix = "myapp-"
end

Alternatively, if there will be a way to provide custom slugifier lambda - that will be enough. Either way it would be nice to keep original name as the monitor's name.

sl0thentr0py commented 5 months ago

hey @ixti yea prefixes make sense, feel free to PR if you want it quicker otherwise I'll try to get to it sometime soon.

re: slug logic, the server decided to slugify anyway so it won't matter if we expose custom slugify logic on the SDK.

Sorry this is just a design choice we have to live with for now but I can pass on the feedback to our Crons team if they want to reconsider this.

sethherr commented 5 months ago

I agree that the name of the job should set the name of the monitor (rather than the slug). The slug is much less readable!

I opened #2290 specifically for setting the name.

ixti commented 5 months ago

re: slug logic, the server decided to slugify anyway so it won't matter if we expose custom slugify logic on the SDK.

If I read Python correctly, it only slugifies when slug is not presented

evanpurkhiser commented 5 months ago

Sorry, a little late to the party here, but cron monitors are unique to the project now. We recently changed this: https://github.com/getsentry/sentry/issues/66615

ixti commented 1 month ago

We've decided to stop using cron monitors - by some reason, cron monitors with sidekiq-scheduler only cause unactionable noise for us. So feel free to close this one.