Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

speezepearson
Copy link
Contributor

No description provided.

@orborde orborde self-requested a review April 9, 2020 23:32
Copy link
Member

@vjkoskela vjkoskela left a 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()))
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

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());
Copy link
Member

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)

@orborde orborde removed their request for review June 5, 2020 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants