elastic/kibana

[APM] Remove usage of `getDocumentTypeFilterForTransactions`

Open

#167,020 创建于 2023年9月22日

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)TypeScript (19,065 star) (8,021 fork)batch import
Team:obs-ux-infra_services - DEPRECATEDapm:service-metricsapm:transaction-metricsgood first issuetechnical debt

描述

Background

The APM UI is able to render using several different datasets:

  • raw transaction events
  • transaction metrics
  • service transaction metrics

The metric sets are further broken into intervals: 1m, 10m and 60m.

The UI should transparently use the most suitable, available dataset. This is what GET /internal/apm/time_range_metadata is for: it will decide which datasets are available for a given time range.

Problem

Currently some APIs like GET /internal/apm/services uses the time_range_metadata API for querying whilst other APIs like GET /internal/apm/services/{serviceName}/transaction_types do not and thus perform their own logic for determining which data to query. This results in some inconsistencies and outright bugs like seen in https://github.com/elastic/sdh-apm/issues/1078 (internal).

Solution

Every API that consumes (service) transaction metrics should use the information from time range metadata API as inputs. Specifically we should remove all usages of getDocumentTypeFilterForTransactions(searchAggregatedTransactions).

In some places we also call getDocumentTypeFilterForTransactions(true). We will still need this but it should be renamed to something likegetBackwardsCompatibleDocumentTypeFilterForOneMinuteTransactionMetrics().

Related

https://github.com/elastic/sdh-apm/issues/1078 https://github.com/elastic/kibana/pull/167500 (initial implementation)

贡献者指南

[APM] Remove usage of `getDocumentTypeFilterForTransactions` · elastic/kibana#167020 | Good First Issue