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

Feature fill-left #87

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Maddin-619
Copy link

Now the initial state can be taken into account at the left side of the time bar. It is necessary if you want to display the correct fractions of states over, for example one week.
It is a bit against the conventions of grafana. After getting the data for the chosen time range into the panel it starts a second query to fetch the last values before the original from time point for all measurements. This point will be added as first DistinctPoints with the timestamp set to from.

The time for the secound query to look in the past can be configured in the options:

image

I removed the old function applyPanelTimeOverrides(). It never gets called because it's no method of the panel any more.

This should solve Issue #69

I tested only with Influxdb as data source and it seems to work quite good. But it should also work with other data sources.

query datasource to get the initial distinct point
@dddesign
Copy link

when do we see this in the addon? version?

@Maddin-619
Copy link
Author

@ryantxu What is your opinion? I tested the feature also with postgres datasource and it worked nicely. What do you think? Is it to hacky? Is there a better solution for the problem?

@trollvottel
Copy link

trollvottel commented Aug 7, 2019

What about an (influx) query like

SELECT value FROM (SELECT last(value) AS value FROM measurement WHERE time < ${{__from}}ms), (SELECT mean(value) AS value FROM measurement WHERE $timeFilter GROUP BY time($interval))

This works regardless how old the last datapoint before the timerange is and without patching. Ideally, the panel would do this automatically though.

The trick is to select from two subselects, one for the last datapoint before timerange and the other one for the actual query.

@Tisonus
Copy link

Tisonus commented Aug 29, 2019

For me, it didn't solve #69 with InfluxDB

@thanosazlin
Copy link

For me as well didn't solve 69 i'm using MS SQL, but yes some sort of fill-left option would be nice.

@KKrup
Copy link

KKrup commented May 10, 2021

Is there some update on this PR? Any sort of left-fill option would help using the panel for many users.

@trollvottel
Copy link

trollvottel commented May 10, 2021

I worked around this by using JSON datasource plugin as middleware which simply inserts the last() left datapoint right at the beginning of the timerange. This also offers a lot more possibilities constructing recordsets for your graphs.

This panel plugin is dead IMO, no updates since a year or so!

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

Successfully merging this pull request may close these issues.

6 participants