influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.92k stars 3.55k forks source link

[feature request] Support month and year as duration unit #3991

Closed ghost closed 4 years ago

ghost commented 9 years ago

For example:

Its useful for me when i want to query the data last month and year...

otoolep commented 9 years ago

@diiidiii -- how long is a month?

beckettsean commented 9 years ago

@diiidiii the challenge with supporting month or year durations is that they are not regular. It requires InfluxDB to be aware of things like variable month lengths, leap years, etc. This is a potential feature but certainly not a short-term one.

ghost commented 9 years ago

they are not regular

Yes thats the reason why i need it. I know it isn't easy to implement but i just want to notify you that this will maybe a good feature. At the moment i use 30d, itsnt not always correct but its okay

daviesalex commented 8 years ago

Anybody that comes across this because Grafana is sending queries that have ''1y'' in them, see https://github.com/grafana/grafana/issues/2874

The workaround to that bug is to set a minimum span on the grafana pane.

dstreppa commented 8 years ago

+1

jaapz commented 7 years ago

Would be great to have this. It's not a trivial problem, but then again, InfluxDB is a time-series database, so it should have a good notion of what certain time durations are, right?

gsemet commented 7 years ago

Agree, I would like to be able to group by month or year and have grafana at least handle all subtilities automatically

stantonk commented 7 years ago

👍

ryanmills commented 7 years ago

+1 need ability to group by time(1M) (month) or time(1y) (year)

Wolfgang1966 commented 7 years ago

I would also like to have the ability to group by month and year.

Thanks a lot

Wolfgang

Wolfgang1966 commented 7 years ago

@beckettsean By the way, days are not regular also ... thinking of DST switches, leap seconds a.s.o. :)

tyhunt99 commented 7 years ago

+1 need ability to group by time(1M) (month) or time(1y) (year)

as a time-series database isn't this sort of a standard feature?

ale91x commented 7 years ago

+1 need ability to group by time(1M(month)), (1y(year))

xsherlockpl commented 7 years ago

I cant get solar production for the last month with just one query without that. +1

olro commented 7 years ago

+1 in general it is nice to have e.g. consumption data for water, electricity, gas on a per month/year basis

m-tymchyk commented 7 years ago

+1 need ability to group by time(1M) (month) or time(1y) (year)

smalenfant commented 7 years ago

+1 We derive bandwidth capacity by month, this makes it a little hard. Currently using 4w or 30d. Data not far off, just not exactly what the report viewer expects.

mkren commented 7 years ago

+1

gtt116 commented 7 years ago

+1 need ability to group by time(1M) (month) or time(1y) (year)

lcarsos commented 7 years ago

+1 grouping by 30d only gets you so far, and frustrates users when they compare against previous results and numbers for finished months change.

cicciopizza commented 7 years ago

+1 need ability to group by month / year. ex. 1M / 1Y

mikegroot commented 7 years ago

+1

chfumero commented 7 years ago

+1

zandacw commented 7 years ago

+1

zopyx commented 7 years ago

+100

zopyx commented 7 years ago

My workaround for grouping rows by year+month is by adding a tag "ym=YYYY-MM" to each row. Then you can "GROUP BY ym".

Codelica commented 7 years ago

Which is fine if you have relatively low series series cardinality or lots of RAM. But otherwise the 12x annual multiplier is too heavy for measurements like ours. I'm hoping Influx will provide the ability natively, or potentially provide some timestamp functions as a workaround similar to what people do for groupings like this on SQL servers.

SilentButeo2 commented 7 years ago

+1 Used influxdb because it was described as a time series database. So grouping /month, /year, was something I thought was implemented by default. My mistake it seems. I know dates can be difficult, but with things like tzdata, you can do great stuff. Keep up the good work guys!

grydstedt commented 7 years ago

+1

ADahmani commented 7 years ago

+1

Oxydros commented 7 years ago

+1

mythfish commented 7 years ago

+1

MThomassen commented 7 years ago

+1

patrickvallet commented 7 years ago

+1, really important for me too.

lqjing commented 7 years ago

+1

matyunin commented 7 years ago

+1

steveseeger commented 7 years ago

+1.. couldn't believe this didn't make 1.0 priority. Even a low performance solution. It requires setting the relative timezone, is that the complexity issue? I assumed this would be here before switching over our platform from MySQL. Have to change to loop and query per month and manually construct results..

chywwq commented 7 years ago

+1

kevinsteger commented 7 years ago

+1 Lack of this feature makes this influx/grafana problematic for any accounting application.

pgayvallet commented 7 years ago

+1. Blocker for our usages.

SR-G commented 7 years ago

Also +1, would definitely be very usefull.

aguiraf commented 7 years ago

+1

KlonD90 commented 7 years ago

+1

g-k-r commented 7 years ago

+1 and while you are at it you might want to consider adding Q for quarter, so 'timestamp/Q' translates to time frame of the quarter the timestamp is in. i.e. 2017-10-12/Q -> 2017-10-01 >= t < 2018-01-01] and Group By time (1Q) aggregates by these time frames.

thanks for a great tool

dietert commented 7 years ago

+1

akarakotov commented 7 years ago

+1 grafana+influxdb is the best solution for real-time monitoring and alerting, but we can't right now detect problems within calendar month period because of this feature absense.

codingheld commented 6 years ago

+1 This is a blocker for production use...

martinschuberts commented 6 years ago

+1

zopyx commented 6 years ago

Hard to believe how ignorant and arrogant the Influx-DB team is here on this issue.

dgomes commented 6 years ago

+1