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

Single Stat: allow timestamps to be displayed as the stat #698

Open
TCL735 opened this issue Nov 13, 2021 · 1 comment
Open

Single Stat: allow timestamps to be displayed as the stat #698

TCL735 opened this issue Nov 13, 2021 · 1 comment

Comments

@TCL735
Copy link
Contributor

TCL735 commented Nov 13, 2021

Currently, Single Stat will only render strings or numbers without any interpretation of what they represent. For example, a timestamp in JavaScript is a number that can be interpreted as milliseconds from a certain time.

Proposal: Allow Single Stat to interpret numbers as timestamps and render a time rather than a number.

Here is an example .csv that will not show a timestamp, but rather just a number.

#group,false,false,true,true,true,true,false,false,true
#datatype,string,long,string,string,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,string
#default,_result,,,,,,,,
,result,table,_field,_measurement,_start,_stop,_time,_value,url
,,0,traefik_config_last_reload_success,prometheus,2021-11-12T17:31:49.314450792Z,2021-11-12T18:31:49.314450792Z,2021-11-12T18:31:02.720095288Z,2021-11-12T14:43:33Z,https://www.google.com

The output is this but what we really want is a timestamp:
Screen Shot 2021-11-13 at 8 13 53 AM

@TCL735
Copy link
Contributor Author

TCL735 commented Nov 13, 2021

This requires updating LatestValueTransform to preserve the column type, passing the column type down as props, and then updating formatStatValue to consider the column type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant