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 :locals to ActionView rendering instrumentation #45977

Merged
merged 1 commit into from
Sep 9, 2022
Merged

Add :locals to ActionView rendering instrumentation #45977

merged 1 commit into from
Sep 9, 2022

Conversation

aarongough
Copy link
Contributor

@aarongough aarongough commented Sep 8, 2022

Motivation / Background

This Pull Request has been created in order to expand the data that ActiveSupport::Notifications captures during the rendering process. This change is motivated by the need for additional insight into the rendering process in order to make assertions about it during testing, but will potentially also be useful for APM use.

Detail

This Pull Request changes:

  • ActionView::TemplateRenderer.render_template
  • ActionView::PartialRenderer.render_partial_template
  • ActionView::StreamingTemplateRenderer.render_template

in all cases simply adding locals: locals to the hash that is sent to ActiveSupport::Notifications.instrument.

There are also small additions to the documentation (active_support_instrumentation.md) and to the CHANGELOG in order to keep them up to date.

Additional information

NOTE: There are no existing tests for the instrumentation or the data that is reported by it, nor is there a terribly obvious place to add it. I am very happy to add tests, just let me know the best place for them.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • There are no typos in commit messages and comments.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Feature branch is up-to-date with main (if not - rebase it).
  • Pull request only contains one commit for bug fixes and small features. If it's a larger feature, multiple commits are permitted but must be descriptive.
  • Tests are added if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.
  • PR is not in a draft state.
  • CI is passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants