-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority: lowNice to have, can waitNice to have, can wait
Description
Problem
We need to demonstrate W-ASAP adoption to stakeholders (grant reports, justifying infrastructure). Current monitoring (Prometheus/Grafana) covers operational metrics but not business analytics like unique users, returning visitors, or query patterns.
Classical tracking tools (Google Analytics etc.) won't work - our user base is technical and heavy on ad blockers.
Requirements
- Track daily/weekly/monthly unique users
- Identify returning users (not just daily uniques)
- Track which LAPIS endpoints get used and query parameters (mutations, locations, date ranges)
- Long-term storage for quarterly/yearly reporting (Prometheus retention is 2 weeks)
- No cleartext PII storage
- Simple, maintainable, fits existing Ansible-managed infrastructure
Proposed Approach
Two-layer setup:
-
Operational monitoring (existing): Prometheus + nginx-exporter for real-time dashboards - request rates, latencies, errors. Keep as-is.
-
Business analytics (new):
- Custom nginx log format capturing endpoint, query params, and a hashed user ID cookie
- nginx sets a persistent cookie on first visit (no application changes needed)
- Simple Python script (cron, hourly) parses logs → writes to SQLite
- Grafana queries SQLite for reporting dashboards
Why this approach
- Server-side tracking bypasses ad blockers
- nginx cookie is lightweight, no LAPIS modifications needed
- SQLite is zero-ops (no separate DB to manage), sufficient for our scale
- Separation of concerns: Prometheus stays short-term operational, SQLite handles long-term analytics
- Ansible-native: all components (nginx config, Python script, cron, SQLite path) can be templated and version-controlled
Implementation outline
- Add custom nginx log format to nginx role
- Add cookie-setting logic in nginx for returning user tracking
- Create new
analyticsrole: Python script + cron + SQLite setup - Add Grafana dashboard for usage reporting
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: lowNice to have, can waitNice to have, can wait