Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

How can I make my Grafana charts start from the first of the month when I select an interval of 1M?

All my time-based Grafana charts exhibit this "issue". If I select a 1M interval, each data point (e.g. each bar in a bar chart) starts from a seemingly random day of the month, like the 10th of December in the screenshot below.

Even I set my time range to be 20xx-01-01 - 2020-12-31.

How can I force it to show one bar per calendar month instead?

chart

Thanks!

question from:https://stackoverflow.com/questions/65902718/how-can-i-make-my-grafana-charts-start-from-the-first-of-the-month-when-i-select

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The reason is that "month" is not a proper interval as it is not a constant duration. Depending on your data source, you may be able to aggregate the data by month. For example, InfluxDB 2.0 supports aggregation by month using Flux (note that prior to 2.0 aggregation by month wasn't supported).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...