Skip to content

Feature fill-left#87

Open
Maddin-619 wants to merge 3 commits into
NatelEnergy:masterfrom
Maddin-619:fill-left
Open

Feature fill-left#87
Maddin-619 wants to merge 3 commits into
NatelEnergy:masterfrom
Maddin-619:fill-left

Conversation

@Maddin-619

Copy link
Copy Markdown

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
Copy Markdown

when do we see this in the addon? version?

@Maddin-619

Copy link
Copy Markdown
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

trollvottel commented Aug 7, 2019

Copy link
Copy Markdown

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

Tisonus commented Aug 29, 2019

Copy link
Copy Markdown

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

@thanosazlin

Copy link
Copy Markdown

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

KKrup commented May 10, 2021

Copy link
Copy Markdown

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

@trollvottel

trollvottel commented May 10, 2021

Copy link
Copy Markdown

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