Closed maxachis closed 3 months ago
@josh-chamberlain I personally think option 1 is worth exploring and trying out for a while, especially considering our recent persistent search engine bug. If it's a specific endpoint call that causes the app to break, this logging would help us determine that. Some of the third party apps Digital Ocean offers have free tiers that we can use to see how they behave.
@maxachis This is sort of a generalized version of https://github.com/Police-Data-Accessibility-Project/data-sources-app/issues/270
Yes, let's set up a cheap place to accept some forwarded logs! ELK seems a little overkill, and reddit murmurs about other things, like this: https://grafana.com/docs/loki/latest/
@josh-chamberlain I set up logging at Papertrail and sent you an email invite to the organization. Have a look at it and let me know what you think. If you think it's good, we can add login/account information to our organizational password manager and probably also make details in Notion about it.
@maxachis I'm in there, I'm seeing logs. Approved!
we typically prefer open source
but it's probably OK in this case that we don't have to roll our own. Would you mind sharing any particular reasons you chose papertrail?
In order to make this official:
@josh-chamberlain My choice of Papertrail in this case was simply that:
I added some additional details to Notion. Currently, the detail I've put in there is uncharacteristically concise! Let me know if you would like more details added. If not, I defer to you as to whether this is ready to be closed. We could still pursue option 2, as an expansion/refinement of our quick search query logging, as a way to track user metrics, but that may be worth exploring in a different issue.
Setting up logging for endpoint calls would make it easier for us to both debug our application in the production environment (i.e. seeing what endpoint calls occurred right before a crash or bug occurred) as well as provide us a means to better assess who is accessing PDAP and for what purposes.
We have a few options at our disposal:
[data-sources-app] [2024-06-21 22:03:03] 10.244.55.86 - - [21/Jun/2024:22:03:03 +0000] "GET /search-tokens?arg1=stops&arg2=pittsburgh&endpoint=quick-search HTTP/1.1" 200 1421 "-" "python-requests/2.28.2"
. Utilizing Log Forwarding offered by Digital Ocean, we could forward our logs to a third party application, and then access the logs that way. Probably would be the easiest way and fastest way to do it, but it would also mean we're adding an additional third party application to our repertoire. We'd also have less control.