feat(monitor_check_ins): improve cron monitor slug readability with better formatting and hashing #2750
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR improves the readability of cron monitor slugs in the Sentry web UI by implementing better name formatting and intelligent truncation with hashing for long class names.
Attention: this PR introduces breaking change as slugs will be a bit different than before. According to rspec cases it affects only sentry-sidekiq.
Problem
Currently, cron monitor slugs generated from Ruby class names are hard to read in the Sentry web UI:
HappyWorkerWithCron
becomehappyworkerwithcron
(no word separation)VeryLongOuterModule::VeryVeryVeryVeryLongInnerModule::Job
are blindly truncated without leaving any trace to parent classSolution
parameterize
andunderscore
methodsChanges
sentry_monitor_slug
method with better CamelCase to snake_case conversionMAX_NAME_LENGTH
andSLUG_HASH_LENGTH
for better maintainabilityExamples
HappyWorkerWithCron
→happy_worker_with_cron
(was:happyworkerwithcron
)VeryLongOuterModule::VeryVeryVeryVeryLongInnerModule::Job
→675905e0c9_very_very_very_long_inner_module-job
(was:ongoutermodule-veryveryveryverylonginnermodule-job
)