Apply a one day offset to x axis in Grafana (Prometheus data source) - grafana

I've created a metric to count unique ids in a data set over the day yesterday and am scraping it into prometheus. So say yesterday's count was 100, this value will be reported throughout today until tomorrow, when today's tally will be computed an then reported throughout tomorrow.
So far so good. Now when I display the value 100 in Grafana, it will show it with today's date, when the actual value is actually yesterday's.
Is there a way to simply offset the x axis in Grafana by -1d to make the dates and values align again, i.e. to change the scrape date to the 'value' date, if you will?
I know there's a 'time shift' in Grafana, but that will just offset the scrape date. I'm also aware of prometheus' 'offset' operator, which will do the same.
What I'm looking for is simply to tell Grafana that it should display 'now' as 'now-1d'.
I've found a setting on the dashboard level that is labeled "Now delay now-". However, this also doesn't shift the x axis and does nothing to change the display.
Grafana version 4.1.1, Prometheus version 1.5.3

Related

Grafana : Compare with same day of the week last year

I have dashboard with a single stat panel showing the number of bookings for the current day. I need to show the same information (in order to compare) for the same of the week for last year on the same dashboard.
I know there is the "Time shift" feature in the panel but I don't want to set 364 days because I will not be sure to compare the same day.
Is there an easy way to do that?
Reagards,
If you're using InfluxDB/Flux you could timeShift your data independently from the Grafana UI.

Prometheus / Grafana highest value and time

Is it possible in grafana with a prometheus backend to determine the highest value recorded for the lifetime of a data set, and if so, determine the time that the value occurred?
For example, I'm using site_logged_in as the query in a Singlestat panel to get the current number of logged in users, along with a nice graph of recent activity over the past hour. Wrapping that in a max() seems to do nothing, and a max_over_time(site_logged_in[1y]) gives me a far too low number.
The value is a single gauge value coming from the endpoint like so
# HELP site_logged_in Logged In Members
# TYPE site_logged_in gauge
site_logged_in 583
Is something like determining highest values even a realistic use case for prometheus?
max_over_time(site_logged_in[1y]) is the max over the past year, however this presumes that you have a year worth of data to work from.
The highest value over the specified time range can be obtained with max_over_time() function. For example, the following value would return the maximum value for site_logged_in metric over the last year:
max_over_time(site_logged_in[1y])
Unfortunately Prometheus doesn't provide the function for returning the timestamp for the maximum value. If you need to obtain the timestamp for the maximum value, then you can use tmax_over_time() function from MetricsQL. For example, the following MetricsQL query returns the timestamp in seconds for the maximum value of site_logged_in metric over the last year:
tmax_over_time(site_logged_in[1y])

Dashboard with auto-updating current and previous month in Tableau

I'm working on a dashboard in Tableau desktop and I want it to automatically update for the current and previous month, each month to show % change in simple, numerical terms (not graphed).
Is there a way to fix the previous month and current month numbers?
Sound like all you need is to use Relative Date filters. https://onlinehelp.tableau.com/current/pro/online/mac/en-us/filtering_add_dragfields_dates.html

How do I get an SSRS chart to use a specific month or the last month for each year?

I have the chart below in Microsoft Visual Studio 2008 for an SSRS report.
The date in the x-axis uses January from each year, but I want it to use the latest month that is available from my dataset (from SQL Server). For example, we're currently in December of 2012, so I want it to be Dec-06, Dec-07, Dec-08, Dec-09, Dec-10, Dec-11, Dec-12 for the x-axis rather than Jan-06, Jan-07 etc.
I already tried reversing the order of the date in the SQL Server query (changed to descending), but it didn't make a difference to the chart (the data however is changed to desc, the chart just forces the date to have January).
Any help would be much appreciated.
Try playing with the scale and iterations on the x-axis itself. Your data isn't going to change but you should be able to set this in detail.
Updated Answer:
You will have to live with setting the minimum on your chart to being x years prior to the current month this way forcing the month starting to be, say, December.
The following Microsoft site specifies these minimum and maximim labels are automatically used. Then the intervals are set based on this. Your only option is to manually set the minimum and maximum.

Jasperreports time series chart timePeriod Expression

I have dataset with 00:00:00,00:00:15...
how to set it to be the timePeriod Expression to show one day's time from 00:00:00 to 23:59:59
i put (Date)new SimpleDateFormat("HH:mm").parse($F{time}) into the timePeriod Expression
but the chart just show one time point
If you don't have gaps you can use Line chart like DeGriz's link to Tarnschaf's answer.
If you may have gaps or would like to summarise the data ensure you use <timeSeriesDatasettimePeriod="Second"> or perhaps timePeriod="Minute" otherwise it tends to default to something large like a year, hence one data point.
THE JASPERREPORTS ULTIMATE GUIDE: Time Period Expression
This expression returns a java.util.Date value from which the engine will extract the
corresponding time period depending on the value set for the timePeriod attribute
mentioned earlier in the Time Series dataset. For instance, if the chart is about yearly
data, the engine will extract only the year from the date value, or if you are gathering
monthly data, the engine will use only the month value from the date object returned by
this expression.
I think you may also be asking to set the Min and Max for the axis to exactly one day, for this I believe you can use <domainAxisMinValueExpression> and <domainAxisMaxValueExpression>