Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Avoid returning data for incomplete/partial days for new dashboards #99

@PatrickNercessian

Description

@PatrickNercessian

As per @bajtos

We are already 'using Grafana's feature called "time shift" to hide the most recent data in the charts. "-1d" for daily values, "-30d" for monthly values' for other dashboards

But 'Maybe we can implement this inside the spark-stats service? We already have some logic to handle date ranges; it understands the concept of “today”. But maybe not “this month”.'
https://github.com/filecoin-station/spark-stats/blob/5e1b373b56acd4ea8817e27e38a82d5e61f959c6/lib/request-helpers.js#L22-L38
Maybe we can modify the SQL queries to something like this: MAX(filter.to, date_trunc('month', now()) - "1 month")

If we never return stats for the current period (day/week/month), then we can also simplify the response cache control header:
https://github.com/filecoin-station/spark-stats/blob/5e1b373b56acd4ea8817e27e38a82d5e61f959c6/lib/request-helpers.js#L75-L87'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions