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

Log User-Agent header #8

Open
redfast00 opened this issue Apr 28, 2022 · 1 comment
Open

Log User-Agent header #8

redfast00 opened this issue Apr 28, 2022 · 1 comment

Comments

@redfast00
Copy link
Member

At the moment, it's not clear what programs are calling endpoints (and how frequently). It would be nice to log the User-Agent header and log how frequently what User-Agent calls what endpoint.

Some concerns:

  • just logging every request to a file would lead to more wear on the SD-card of the Pi (maybe logging to tmpfs could be possible)?
  • having a global object and storing the stats in there might not work well, since there are multitple workers (but we can use https://docs.python.org/3/library/multiprocessing.html#managers)
  • some scripts might not have a User-Agent header, or the header might be the same for two programs running on another machine, so it probably makes sense to also log the IP address
@FKD13
Copy link
Member

FKD13 commented Jun 6, 2022

I think it would not make much sense to try and do this ourselves. Since we already have a Grafana instance running, maybe we can use something like https://grafana.com/oss/loki/ . This way we don't have worry about aggregating stats ourselves and can we keep this application simpler.

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

No branches or pull requests

2 participants