Skip to content

ref(dashboards): Update TimeSeries timestamp types #90104

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

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

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Apr 22, 2025

Closes DAIN-361: Change TimeSeries timestamp field to be an integer. This PR helps align the TimeSeries type to the response format of the /events-timeseries/ endpoint. This PR changes the timestamp field everywhere that's relevant to use numbers instead of strings.

The main changes are to the fixtures and stories, where we generate the data. The other changes are to the conversion functions we use to convert the current endpoint responses to TimeSeries. The important part here is that Date() accepts strings and integers, so the type safety doesn't necessarily save us. Especially since it wants millisecond timestamps!

Integer timestamps are a little harder to read when debugging, but they're much easier to use when creating dates, shifting them by offsets, comparing them, sorting them, etc.

@gggritso gggritso requested review from a team as code owners April 22, 2025 21:08
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant