ref(dashboards): Simplify TimeSeries
field meta
#86834
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is an incoming re-write of the
/events-stats/
endpoint, which will include a new and much nicer data output format. This PR start to align with that format with one very nice simplification, of what themeta
field looks like. SinceTimeSeries
is already a transformed type (we make it fromEventsStats
, usually) we can make changes to it in preparation for the API to returnTimeSeries
straight, eventually. Plus these changes are good and useful, and make the code simpler.Contributes to https://github.com/getsentry/team-performance/issues/58
Before:
This format is very awkward, because you have to go digging through the meta to find the type and unit. This can be very annoying if you don't know what the field was, because that information wasn't passed along. This is even more annoying because in
TimeSeries
, if its ever renamed, we have to also rename the fields in the meta, so they match the field. Yikes.After:
This is much more sensible. No need to go digging for types and units, no need to rename anything. Since almost all the code is going through
convertSeriesToTimeSeries
I didn't even have to change much, mostly mocks and stories.