-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataLinks: Enable value time windowing in TimeSrv #18636
Conversation
@torkelo This supports only symmetrical windows around value time. WDYT about introducing syntax support for value time windowing when the valueTime is a limit value for the time range? I mean: ?valueTime=TS&valueTimeWindow=+window would result in time range:
?valueTime=TS&valueTimeWindow=-window would result in time range:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valueTime
and valueTimeWindow
seem kinda specific
what about the parameters time
and timeWindow
, or maybe time.window
?
I would expect time.window
to take a duration string, like '5m' or '10s' and then do the math to put time
in the middle of the window. If you don't want the middle, then you can calculate and set the to/from parameters directly?
I'm not sure now is the time for this change, but I think time
should be saved in TimeSrv
along with to/from -- this will be useful for anything trying to query or display based on a single time, not the range
Yeah, this sounds better.
Actually I don't think you could calculate it now, as we don't have support for any expressions in the data links and this would be necessary to increment/decrement value of |
Not sure I understand what you mean. nothing needs to be done in the data links for this: TimeSrv will check for url params time & time.window and set from & to accordingly. At least that is how I imagined this would work. |
@torkelo I was refering to :
I have confused from/to(TimeSrv properties) with from/to query params :) n/w, wil add support for predefined windows! |
Changed params and added support to time window being specified as interval string or in ms. Discussed with @torkelo and we decided no to focus on ranges relative to __value_time. I.e. case when you want to specify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
* grafana/master: Streaming: improve JSDocs for DataSourceAPI streaming support (grafana#18672) TimeSrv: Enable value time windowing in TimeSrv (grafana#18636) Explore: Fixes so Show context shows results again (grafana#18675) Graph: Updated y-axis ticks test dashboard (grafana#18677) Add typings to package.json in packages (grafana#18640) Plugins: better warning when plugins fail to load (grafana#18671)
* grafana/master: Heatmap: Add Cividis and Turbo color schemes (grafana#18710) Units: add counts/sec (cps) and counts/min (cpm) in Throughput (grafana#18702) Dev Docker: Use golang:1.12.9-alpine to prevent glibc mismatch. (grafana#18701) Docs: Fix broken link for the Grafana on RHEL or Ubuntu tutorial (grafana#18697) Fixes several usability issues with QueryField component (grafana#18681) convert teams section of user profile to react (grafana#18633) Singlestat/Gauge/BarGauge: Improvements to decimals logic and added test dashboard (grafana#18676) Emails: Change text (grafana#18683) Streaming: improve JSDocs for DataSourceAPI streaming support (grafana#18672) TimeSrv: Enable value time windowing in TimeSrv (grafana#18636) Explore: Fixes so Show context shows results again (grafana#18675) Graph: Updated y-axis ticks test dashboard (grafana#18677) Add typings to package.json in packages (grafana#18640) Plugins: better warning when plugins fail to load (grafana#18671) SingleStat2: save options to defaults not override (grafana#18666) Packages: Fix path import from grafana/data (grafana#18667)
* grafana/master: @grafana/data: improve the CircularVector api (grafana#18716) QueryEditor: check if optional func toggleEditorMode is provided (grafana#18705) Emails: remove the yarn.lock (grafana#18724) OAuth: Support JMES path lookup when retrieving user email (grafana#14683) Emails: resurrect template notification (grafana#18686) Email: add reply-to and direct attachment (grafana#18715) Dashboard: Adds Logs Panel (alpha) as visualization option for Dashboards (grafana#18641) Heatmap: Add Cividis and Turbo color schemes (grafana#18710) Units: add counts/sec (cps) and counts/min (cpm) in Throughput (grafana#18702) Dev Docker: Use golang:1.12.9-alpine to prevent glibc mismatch. (grafana#18701) Docs: Fix broken link for the Grafana on RHEL or Ubuntu tutorial (grafana#18697) Fixes several usability issues with QueryField component (grafana#18681) convert teams section of user profile to react (grafana#18633) Singlestat/Gauge/BarGauge: Improvements to decimals logic and added test dashboard (grafana#18676) Emails: Change text (grafana#18683) Streaming: improve JSDocs for DataSourceAPI streaming support (grafana#18672) TimeSrv: Enable value time windowing in TimeSrv (grafana#18636) Explore: Fixes so Show context shows results again (grafana#18675) Graph: Updated y-axis ticks test dashboard (grafana#18677) Add typings to package.json in packages (grafana#18640)
This PR introduces changes to TimeSrv that enables value time windowing.
Given a value time and custom time window size TimeSrv will set time range to be narrowed down to a specified window. I.e given a 5s window and value timestamp, dashboard's time range will be set to (valueTs - 2.5s) - (valueTs + 2.5s).
The change introduced to TimeSrv is about enabling support for
valueTime
&valueTimeWindow
query params that's translated to a custom time range.