elastic/kibana

[APM] Remove usage of `getDocumentTypeFilterForTransactions`

クローズ

#167,020 opened on 2023/09/22

 (6 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (8,021 件のフォーク)batch import
Team:obs-ux-infra_services - DEPRECATEDapm:service-metricsapm:transaction-metricsgood first issuetechnical debt

Repository metrics

Stars
 (19,065 個のスター)
PR merge metrics
 (平均マージ 1d 16h) (30d で 999 merged PRs)

説明

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)

コントリビューターガイド