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

Console templates not working in Firefox #1442

Closed
StephanErb opened this Issue Mar 1, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@StephanErb
Copy link
Contributor

StephanErb commented Mar 1, 2016

It seems like console templates in Prometheus 16.2 are not working in Firefox 44 due to a date parsing issue:

A console template (when clicking on the rewind butten) runs the following code:

PromConsole.TimeControl.prototype.getEndDate = function() {
  if (this.endElement.value === '') {
    return null;
  }
  return new Date(this.endElement.value).getTime();
};

The property this.endElement.value is set to a value such as 2016-3-1 17:55. It seems like Firefox is unable to create a valid Date from this and returns None from the getEndDate function. This breaks the template rendering.

Steps to reproduce:

@brian-brazil brian-brazil added the bug label Mar 1, 2016

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 2, 2016

@StephanErb Thanks!

@brian-brazil Besides not zero-padding month and day, PromConsole.TimeControl.prototype.getHumanDate does not insert a T between date and time that's necessary for the resulting string to be parsed as a valid Date in Firefox. If I replace the entire function simply by return date.toISOString();, it works. The question is whether that is "human-readable" enough for you, as the output in the end-time input box now looks like this: 2016-03-02T09:32:02.835Z. Probably ok? Or do we need another layer that translates between what's actually shown in the input box vs. what gets used internally for the Date conversion?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 2, 2016

The expression browser also produces times like that, so what we probably want to do is use unixtime in the URL fragment.

@fabxc fabxc added kind/bug and removed bug labels Apr 28, 2016

@brian-brazil brian-brazil added this to the v1.0.0 milestone May 12, 2016

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jun 8, 2016

Can we exclude console templates from 1.0?
It doesn't seem anyone is working on them and they'll just block us. Arguably they are not part of Prometheus server directly. That they happen to be placed in the Prometheus repository is unideal.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jun 8, 2016

The example templates are excluded from the 1.0 guarantee.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Jun 8, 2016

Cool, can we remove the 1.0 milestone then? As in the other issue, I'd like
to remove anything that defers 1.0.

On Wed, Jun 8, 2016 at 12:16 PM Brian Brazil notifications@github.com
wrote:

The example templates are excluded from the 1.0 guarantee.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1442 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEuA8rynirpQncXRRLRig4CqMmSTv9zQks5qJpaNgaJpZM4Hmqtb
.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jun 8, 2016

It's something we should really fix before 1.0.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.