elastic/kibana

[APM] Remove usage of `getDocumentTypeFilterForTransactions`

Open

#167.020 aperta il 22 set 2023

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)TypeScript (8021 fork)batch import
Team:obs-ux-infra_services - DEPRECATEDapm:service-metricsapm:transaction-metricsgood first issuetechnical debt

Metriche repository

Star
 (19.065 star)
Metriche merge PR
 (Merge medio 1g 16h) (999 PR mergiate in 30 g)

Descrizione

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)

Guida contributor