Display Data in Graph Panel for some Custom Range for time in X-Axis

Hi, I am very new to Grafana, just started understanding since yesterday. I am using InfluxDB as a Datasource. I actually liked Grafana, but I could not able to achieve simple scenario.

I wanna show some data based on some “time” custom range in X-Axis. Although I could be able to select custom Date globally, but I wanna select time range (say, I wanna see graph of data between 5 Pm to 7 Pm of some column data for Jan 11, 2020), how can I achieve this in Graph Panel? I 've selected custom date using Date Picker as “Jan 11”, but not understanding how to view data for some specific custom range in Graph Panel.

I will be glad if anyone could be able to look into my above issue. Thank you!

can anyone please help me on above?

Can I expect any response on above? Does above issue already implemented? or yet to implement? or not going to be implemented at all?

When you select Jan 11 2020 in the custom date picker, do you not also get the
option to select the times?

Maybe provide a screenshot of the window you do get, so we can see how it is
different from normal.

Antony.

Hi Antony,

At first, thanks for replying. All I see Date Picker, I mean just to select dates. Moreover, I do want to select time range in each Graph Panels and time range differs for each panel. FYI, all my time ranges in epoch format (some numbers), so I want to select epoch range in each Graph Panel, is this possible to show?

I know of no way to select dates & times by epoch - this is such an unwieldy
format for most people to use that I’ve never seen it offered in a user
interface.

Also, you cannot have different time ranges for different panels, unless this is
defined in the query for the panel, in which case it is not then selectable
from the date picker. The date picker applies to the entire dashboard, and
any panel which uses “$timeFilter” in its query will have the same date / time
selection.

However, in terms of simply selecting times, here is what I see (using Grafana
6.5.2):

  1. Click on the date/time picker at the top right - when you hover the mouse
    on it, it should show you the current range (with both date and time) which is
    being shown.

  2. Once you’ve clicked on it, select “Custom time range” at the top of the
    menu.

  3. You should see a “From” box with a month calendar underneath it, and to the
    right of that, a “To” box with another month calendar underneath it, and an
    “Apply” button underneath both calendars.

  4. Select “11” in each calendar, for 11th January 2020. You should see
    “2020-01-11 00:00:00” appear in the “From” box, and “2020-01-11 23:59:59” in
    the “To” box.

  5. You can now click onto the times and edit them to whatever you wish, for
    example “17:00:00” and “18:59:59”, and when you click on “Apply”, that’s the
    date and time range which will be used for your graphs.

If the above does not match your experience, let us know which version of
Grafana you’re working with, and at which point in the above steps it doesn’t
work as I’ve described.

Regards,

Antony.

I can convert epoch to normal time using https://www.epochconverter.com/ , so I can get from and to normal GMT times, now can you please tell me how to show different time ranges in each Graph Panel (for normal GMT times). Any clear document?

I don’t know of any documentation for this, but my approach was as follows:

  1. Use the date picker to select a date & time range of interest.

  2. Go to the Query Inspector to see what Grafana has converted “$timeFilter”
    into for that date / time range.

  3. Replace “$timeFilter” in your query (you’ll need to use the raw mode editor
    for this) with the same syntax, substituting whatever date / time range you
    want for the particular panel.

  4. Repeat step 3 for each panel you want to give a bespoke date / time range
    to.

Hope that helps,

Antony.

Graph panel showing entire Date Range whatever range selected from DatePicker, even though I’ve modified query between 2 epoch dates.

If above approach works for you, can you please send me any screenshot fo yours having graph panel showing only between some time range

Here’s a sample of four graph panels and six singlestat panels covering three
different timescales; the “Last 7 days” selection at the top right is
irrelevant / ignored, however the dashboard does update every 15 seconds as
indicated.

Regards,

Antony.

Nice! Is that possible to share me your dashboard or query of your 90 minutes graph panel? I mean can you share me your query and panel settings which is displaying just only for 90 minutes?

Ah, that one I’ve done using the Time Range override facility.

The query is simple:

select RTT from stats where topic=‘Calls’ and Dir=‘outbound’ and $timeFilter

But I’ve specified “90m” for Override Relative Time for the Time Range.

Regards,

Antony.

I have a doubt, your global time filter is: 7 days and you just kepted Relative Time as 90m, then how it picked 11:50 to 13:10? and what GMT time region we need to select? if possible, screenshot of your dashboard query might helpful.

I have a doubt, your global time filter is: 7 days and you just kept
Relative Time as 90m, then how it picked 11:50 to 13:10?

Because I took that screenshot at 13:12, and 90 minutes before that is 11:42.

You can see from the additional “graph space” before and after the first / last
labels on the X-axis that that’s the timescale the graph covers.

and what GMT time region we need to select?

I am not in GMT; I am in CET.

if possible, screenshot of your dashboard query might helpful.

Sorry, can’t manage that. I provision all panels using JSON, and since
Cannot create query - new Grafana installation I can’t view
anything useful in edit mode in the browser.

It still works fine in Grafana 5.4.5, but that looks completely different, so
isn’t helpful for you.

What I can share is the information from the Query Inspector, which tells me
that the query Grafana is submitting to my back-end data store is:

select RTT from stats where topic = ‘Calls’ and Dir=‘outbound’ and time >=
now() - 90m

So, what Grafana has done is to set $timeFilter to “time >= now() - 90m”

That’s the sort of things you can do manually if you want to create more
complex exceptions for individual panels.

Antony.

Okay, Many Thanks Antony for your replies. I also try using now() - 90m and I will update you.

As you’ve inserted data in db just now and then added now() - 90m, so graph showing good, but if you come later again (say after 2 days), then now() - 90m, will show you empty data in graph panel, right?

Well, yes.

I would not want a graph of “the last 90 minutes” to show me data from 2 days
ago.

What (timescale) do you want the graph to show?

Antony.

My only requirement to show data between some time range (say some hrs) in some graph panel. and when I come back after some days in same dashboard, I want to see same graph… So, basically looking for a graph having data between 2 time ranges

I can’t think of any way to achieve that with a different range for different
panels.

You can easily do this for the entire dashboard (as I explained in my second
reply in this conversation, with steps 1-5 outlined), but I know no way to do
it differently for different panels.

Antony.

Hmm okay… But I think this feature should also be there… not sure why no one had this kinda requirement yet! Anyway Thanks again Antony for your time!