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

[APM] Time range metadata API to drive available fields rather than individual logics to check for them #168446

Open
achyutjhunjhunwala opened this issue Oct 10, 2023 · 4 comments
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

Comments

@achyutjhunjhunwala
Copy link
Contributor

achyutjhunjhunwala commented Oct 10, 2023

Currently we have the Time Range Metadata returning specifics about hasDurationSummaryField field as part of its response.

export interface TimeRangeMetadata {
isUsingServiceDestinationMetrics: boolean;
sources: Array<
ApmDataSource & { hasDocs: boolean; hasDurationSummaryField: boolean }
>;
}

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 field transaction.duration.summary. Hence this can be treated as version 2 of this document.

Currently we identify documents types like this

type AnyApmDocumentType =
  | ApmDocumentType.ServiceTransactionMetric
  | ApmDocumentType.TransactionMetric
  | ApmDocumentType.TransactionEvent
  | ApmDocumentType.ServiceDestinationMetric
  | ApmDocumentType.ServiceSummaryMetric
  | ApmDocumentType.ErrorEvent

If we change them a bit to return this new versioned document, like

type AnyApmDocumentType =
  | ApmDocumentType.ServiceTransactionMetric
  | ApmDocumentType.TransactionMetric
  | ApmDocumentType.TransactionEvent
  | ApmDocumentType.ServiceDestinationMetric
  | ApmDocumentType.ServiceSummaryMetric
  | ApmDocumentType.ErrorEvent

  | ApmDocumentType.TransactionMetricV2

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 -

  1. Get the document type from Time Range Metadata API.
  2. Pass the Document Type as it is with RollUpIntervals to subsequent API calls
  3. On the server side, we can may be enhance the apmEventClient to handle these specially created new Document Types and add filter queries accordingly.
@achyutjhunjhunwala achyutjhunjhunwala added the Team:APM All issues that need APM UI Team support label Oct 10, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@sorenlouv sorenlouv added apm:transaction-metrics APM UI - Transaction Metrics Work apm:performance APM UI - Performance Work apm:service-metrics labels Oct 31, 2023
@smith smith added the bug Fixes for quality problems that affect the customer experience label Apr 5, 2024
@smith
Copy link
Contributor

smith commented Apr 10, 2024

Moving this back to backlog in favor of #180444.

@cauemarcondes
Copy link
Contributor

cauemarcondes commented Apr 11, 2024

@smith I'm missing the connection between this issue and this one #180444, can you elaborate?

@smith
Copy link
Contributor

smith commented Apr 11, 2024

@smith I'm missing the connection between this issue and this one #180444, can you elaborate?

This issue was moved out of "Ready" and back to the backlog. The other issue was moved out of the backlog and in to Ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

5 participants