Skip to content

Skip instrumentation in run_validators when no validators present#2667

Merged
dblock merged 1 commit intomasterfrom
skip_instrumentation_no_validators
Mar 30, 2026
Merged

Skip instrumentation in run_validators when no validators present#2667
dblock merged 1 commit intomasterfrom
skip_instrumentation_no_validators

Conversation

@ericproulx
Copy link
Copy Markdown
Contributor

Summary

  • Early return in run_validators when saved_validations is empty, skipping ParamScopeTracker.track and ActiveSupport::Notifications instrumentation entirely.

Motivation

Every request paid the overhead of the endpoint_run_validators.grape notification and tracker setup even when the endpoint declared no params at all. With this change those are only invoked when there is actual work to do.

Breaking change

endpoint_run_validators.grape is no longer fired for endpoints with no validators. Documented in UPGRADING.md under >= 3.2.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

Danger Report

No issues found.

View run

Avoids unnecessary ParamScopeTracker setup and AS::Notifications
instrumentation for endpoints that have no validators.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ericproulx ericproulx force-pushed the skip_instrumentation_no_validators branch from b4b7f59 to 586641f Compare March 29, 2026 20:41
@ericproulx ericproulx requested a review from dblock March 29, 2026 20:42
@ericproulx
Copy link
Copy Markdown
Contributor Author

@dblock I'm gonna cut a version this week.

@dblock dblock merged commit ec1b0fe into master Mar 30, 2026
79 checks passed
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.

2 participants