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

API for per-day stats #697

Open
tazz4843 opened this issue Sep 7, 2023 · 1 comment
Open

API for per-day stats #697

tazz4843 opened this issue Sep 7, 2023 · 1 comment

Comments

@tazz4843
Copy link

tazz4843 commented Sep 7, 2023

I'm looking to bring my analytics data into Grafana since I already have everything else there. While trying to do so, I noticed there's no real way to transform the current data on GET /stats/hits into a total sum of hits per day, given the limited number of ways I have to process the data (JSONPath and JSONata, neither of which support the transformation required to get a sum per day). I can't make multiple API requests either, it all has to be done in one request.

About the only workaround I can see is a new API endpoint that returns data something like this, combined across all routes as a total sum.

{
  "total": 1000,
  "per_day": [
    {
      "date": "2023-09-05",
      "pageviews": 18,
      "visitors": 8
    },
    {
      "date": "2023-09-06",
      "pageviews": 10,
      "visitors": 3
    },
    {
      "date": "2023-09-07",
      "pageviews": 8,
      "visitors": 1
    }
  ]
}

Adding this to the existing GET /stats/total would also be doable for my use case.

@arp242
Copy link
Owner

arp242 commented Dec 6, 2023

Somewhat related: #662 (comment)

Adding a group parameter to /stats/total would probably also make sense here.

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