-
Notifications
You must be signed in to change notification settings - Fork 12
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
add ?from=...&to=... to Grafana report URIs #349
base: master
Are you sure you want to change the base?
Conversation
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.
Can you also update the inline help on the UI to indicate how from/to are set?
public URI getUri(final GrafanaReportPanelReportSource source, final TimeRange timeRange) { | ||
try { | ||
return new URIBuilder(source.getWebPageReportSource().getUri()) | ||
.setParameter("from", Long.toString(timeRange.getStart().getEpochSecond())) |
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.
Unfortunately, I'm not sure that Grafana does the "right thing" with epoch from/to values.
e.g.
?from=1586787676&to=1586809276
1586787676 = Monday, April 13, 2020 2:21:16 PM (GMT)
1586809276 = Monday, April 13, 2020 8:21:16 PM (GMT)
It looks to me that the values are in fact millisecond epochs.
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.
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.
Also, this dashboard was configured as "UTC". However, I have seen "bugs" where developers treat epoch as "local". It may be worthwhile testing that if a report were configured as local timezone, that supplying the epoch values still causes it to render the same time interval as if the report were configured UTC (e.g. epoch interpretation is locale agnostic -- if it's not, this quirk will need to be addressed in our plugin ... somehow ... or at least documented)
@@ -107,7 +109,7 @@ | |||
.addData("format", format) | |||
.addData("timeRange", timeRange) | |||
.log(); | |||
final CompletableFuture<Void> navigate = dts.navigate(getUri(source).toString()); | |||
final CompletableFuture<Void> navigate = dts.navigate(getUri(source, timeRange).toString()); |
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.
Just want to confirm that the timeRange
here is the fixed target and independent of any scheduling and jitter. (e.g. a daily midnight to midnight report with a 1h delay will still have a timerange of midnight to midnight)
No description provided.