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

Enable Fill on the timeGroup macro #345

Open
CraigLager opened this issue Jan 22, 2025 · 0 comments
Open

Enable Fill on the timeGroup macro #345

CraigLager opened this issue Jan 22, 2025 · 0 comments
Labels

Comments

@CraigLager
Copy link

CraigLager commented Jan 22, 2025

Is your feature request related to a problem? Please describe.

Timeseries graphs using the redshift $__timeGroup macro are incorrect as groups with no data are not filled in. For example, the query:

SELECT
    $__timeGroup(timestamp, '10m'),
    count($__column)
FROM 
    $__schema.$__table
WHERE
    $__timeFilter(timestamp)
    and $__column = '$Seller'
GROUP BY
    time
ORDER BY
    time

Results in:

time count
2025-01-15 14:00 1
2025-01-15 14:10 1
2025-01-15 14:30 1
2025-01-15 14:40 1
2025-01-15 15:00 1
2025-01-15 15:20 1
2025-01-15 15:30 1
2025-01-15 15:40 2
2025-01-15 16:10 2
2025-01-15 16:40 1
2025-01-15 16:50 3
2025-01-15 17:00 1
2025-01-16 05:00 1
2025-01-16 06:00 2

Notice the gap at 14:20, 14:50 etc. As there is no row, the grafana Fill options don't do anything. This results in timeseries graphs being incorrect

Image

Describe the solution you'd like

Rows should be generated and the value returned as NULL for missing entries in the time group.

Describe alternatives you've considered

Creating a data source which is just timestamps to left join

Additional context

Postgres has support for this feature: https://grafana.com/docs/grafana/latest/datasources/postgres/#macros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

1 participant