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

Added support for request profiling via django-silk #5169

Merged
merged 22 commits into from
Feb 2, 2024

Conversation

lampwins
Copy link
Member

@lampwins lampwins commented Jan 24, 2024

What's Changed

This adds support for user session profiling via django-silk. This allows a user to enable a setting in their user profile which persists until they log out or disable the setting. Django silk will then log all subsequent requests for that user's session. Administrators can access the logs in the silk UI.

Screenshots

Screenshot 2024-01-24 at 4 02 01 PM

silk-ui

TODO

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Example Plugin Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

changes/5169.added Outdated Show resolved Hide resolved
nautobot/users/forms.py Outdated Show resolved Hide resolved
nautobot/users/forms.py Outdated Show resolved Hide resolved
nautobot/users/tests/test_views.py Show resolved Hide resolved
nautobot/users/views.py Outdated Show resolved Hide resolved
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
@gsnider2195
Copy link
Contributor

gsnider2195 commented Jan 29, 2024

We want to add a setting to toggle this feature (or document the existing setting). Also backport to LTM.

Copy link
Contributor

@gsnider2195 gsnider2195 left a comment

Choose a reason for hiding this comment

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

The only concern I have is there are no links to the /silk/ URL anywhere in the application.

@lampwins lampwins merged commit a475309 into develop Feb 2, 2024
17 checks passed
@lampwins lampwins deleted the u/lampwins-django-silk branch February 2, 2024 03:09
lampwins added a commit that referenced this pull request Feb 2, 2024
* added support for django-silk

* changelog and permissions

* disable lambda warning

* disable lambda warning

* disable lambda warning

* disable lambda warning

* linting wins, no more lambda

* Apply suggestions from code review

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* Update nautobot/users/urls.py

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* added ALLOW_REQUEST_PROFILING setting and access tests

* Update nautobot/users/tests/test_views.py

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* pr updates

* pr updates

* fix tests

* add link to silk when superuser

---------

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Hanlin Miao <46973263+HanlinMiao@users.noreply.github.com>
@lampwins lampwins mentioned this pull request Feb 2, 2024
lampwins added a commit that referenced this pull request Feb 2, 2024
* Added support for request profiling via django-silk (#5169)

* added support for django-silk

* changelog and permissions

* disable lambda warning

* disable lambda warning

* disable lambda warning

* disable lambda warning

* linting wins, no more lambda

* Apply suggestions from code review

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* Update nautobot/users/urls.py

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* added ALLOW_REQUEST_PROFILING setting and access tests

* Update nautobot/users/tests/test_views.py

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

* pr updates

* pr updates

* fix tests

* add link to silk when superuser

---------

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Hanlin Miao <46973263+HanlinMiao@users.noreply.github.com>

* added note about files

---------

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Hanlin Miao <46973263+HanlinMiao@users.noreply.github.com>
This was referenced Feb 5, 2024
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.

None yet

5 participants