[APM] Time range metadata API to drive available fields rather than individual logics to check for them #168446
Labels
apm:performance
APM UI - Performance Work
apm:service-metrics
apm:transaction-metrics
APM UI - Transaction Metrics Work
bug
Fixes for quality problems that affect the customer experience
Team:APM
All issues that need APM UI Team support
Currently we have the Time Range Metadata returning specifics about
hasDurationSummaryField
field as part of its response.kibana/x-pack/plugins/apm/common/time_range_metadata.ts
Lines 10 to 15 in bb08db9
This adds limitation given we might introduce more such fields in the future or new metrics might come up where such fields would add little to no value.
PS
I had an initial discussion with @sqren on this and this ticket is to brainstorm on the idea proposed below. Inspiration for this ticket came from here
Idea
Instead of returning such metadata fields in addition to Document types, the API can start returning better Document Types.
For example,
transaction.duration.summary
field is a new field added to transaction metrics documents. This means we have a new version of a Transaction Document Type which now supports an additional fieldtransaction.duration.summary
. Hence this can be treated as version 2 of this document.Currently we identify documents types like this
If we change them a bit to return this new versioned document, like
Now this is the document type which the
Time Range Metadata
API should return. With this we can encapsulate the whole logic and the client side now does not need to know about the availability of specific fields and what they need to pass while calling other APIs.The whole flow would look like -
Time Range Metadata
API.apmEventClient
to handle these specially created new Document Types and add filter queries accordingly.The text was updated successfully, but these errors were encountered: