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

Metrics: log referral domains #39

Open
jayaddison opened this issue Aug 28, 2023 · 0 comments
Open

Metrics: log referral domains #39

jayaddison opened this issue Aug 28, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jayaddison
Copy link
Member

jayaddison commented Aug 28, 2023

Is your feature request related to a problem? Please describe.
The HTTP referer domain name -- only the domain name part, the full URL is not required -- should be recorded by our infrastructure and logged in the [backend] database in the events schema (see openculinary/backend#75).

Describe the solution you'd like
Since we deploy a single-page progressive web application, index.html should be the only file where the HTTP Referer header is relevant and received.

Similarly, index.html should be served using minimal, high-performance and low-cost infrastructure since it's the application's key entrypoint.

Currently, the frontend service that serves content does not support any dynamic per-request logic, and that's by-design (some template in-fill is performed by webpack at container build-time, but beyond that point the content is served statically).

Ideally, referral event recording should be performed in-cluster since that matches the behaviour of search logging.

I think that the most pragmatic and architecturally-consistent approach is to have a minimal passthrough Python flask microservice that relays requests to the frontend service, and as a side-effect places a log event on a referrals queue for a backend-worker to pick up and store.

Describe alternatives you've considered

  • Serving the frontend content from a Python/flask service directly.
  • Adding an analytics tag to the delivered PWA application.

Additional context
N/A

@jayaddison jayaddison added the enhancement New feature or request label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant