Prometheus query step alignment issue

Does anyone know any work-around to my issue with the step alignment on prometheus queries? I describe the issue here https://github.com/grafana/grafana/issues/17278 (hopefully I’m not too incomprehensible). I still think it is a bug (or at the very least a feature that grafana should have).

A quick summary is that Grafana seems to always align steps with UTC midnight. This means that I can’t do things like get one datapoint per calendar day (in a non-GMT timezone), I can’t get one datapoint per work-shift (like day shift, night shift), one data point per calendar week.

I do make a wild stab at where I think the code is failing but I really have little idea what I’m doing.

Thanks