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

Feature request: Track views without the mixin #10

Open
NiklasMerz opened this issue Oct 31, 2022 · 3 comments · May be fixed by #19
Open

Feature request: Track views without the mixin #10

NiklasMerz opened this issue Oct 31, 2022 · 3 comments · May be fixed by #19

Comments

@NiklasMerz
Copy link
Contributor

NiklasMerz commented Oct 31, 2022

I must admit I did not investigate further myself so far. Would it be possible to have a middleware that tracks the page visits to class based views that don't have the ApmView mixin? What's the purpose of this mixin?

I think it would be cool to have a middleware that "just works" and tracks everything without changing every view.

@leandrodesouzadev You can probably tell me what the mixin is doing before I find out why it's needed the hard way.

@leandrodesouzadev
Copy link
Contributor

leandrodesouzadev commented Oct 31, 2022

Would it be possible to have a middleware that tracks the page visits to class based views that don't have the ApmView mixin?

I think that it's definitely possible, although the current behavior makes really clear what routes should send any errors, or be tracked of. This leaves the possibility to the user decide which routes we should track.

One possible way of implementing this catch all is by implementing a new middleware that adds the required attributes for the current middlewares work. Because right now the middlewares expects the incoming request to contain a id attribute that means that this request should be tracked and was processed by the _contribute_to_request function, that adds the id, logger and other required attributes that the current middlewares expect.

@NiklasMerz
Copy link
Contributor Author

Thanks for the info. We will consider implementing such middleware.

@NiklasMerz
Copy link
Contributor Author

I started experimenting with this in #19 . It's not done, yet but let me know what you think.

@NiklasMerz NiklasMerz linked a pull request Nov 18, 2022 that will close this issue
4 tasks
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 a pull request may close this issue.

2 participants