Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Improve logic to determine when to use the transaction.duration…
….summary field (#171315) fixes #167578 ## Summary This pull request addresses an issue related to the rendering of latency charts in the UI when using APM Servers with versions both pre-8.7 and 8.7 or higher. it changes the `GET /internal/apm/time_range_metadata` to will only return `hasDurationSummary` `true` when **all** documents within a give time range are produced with `transaction.duration.summary` field. ### Services Inventory | before | after | |--------|--------| | <img width="800" alt="image" src="https://github.com/elastic/kibana/assets/2767137/eb8b7552-3bd8-4920-b0bf-2f64c6129e16"> | <img width="800" alt="image" src="https://github.com/elastic/kibana/assets/2767137/46079b0c-f29c-489f-8951-5235eae8ba71"> | ### Service Overview <img width="1427" alt="image" src="https://github.com/elastic/kibana/assets/2767137/1511b919-9f86-4e98-94a5-2415bd1d6fc5"> ```json { "isUsingServiceDestinationMetrics": false, "sources": [ { "documentType": "serviceTransactionMetric", "rollupInterval": "1m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "serviceTransactionMetric", "rollupInterval": "10m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "serviceTransactionMetric", "rollupInterval": "60m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionMetric", "rollupInterval": "1m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionMetric", "rollupInterval": "10m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionMetric", "rollupInterval": "60m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionEvent", "rollupInterval": "none", "hasDocs": true, "hasDurationSummaryField": false } ] } ``` **Time range with only APM Server >= 8.7 produced documents** <img width="1427" alt="image" src="https://github.com/elastic/kibana/assets/2767137/7a9fbc34-f233-4b89-923d-bc9970e9097b"> ```json { "isUsingServiceDestinationMetrics": false, "sources": [ { "documentType": "serviceTransactionMetric", "rollupInterval": "1m", "hasDocs": true, "hasDurationSummaryField": true }, { "documentType": "serviceTransactionMetric", "rollupInterval": "10m", "hasDocs": true, "hasDurationSummaryField": true }, { "documentType": "serviceTransactionMetric", "rollupInterval": "60m", "hasDocs": true, "hasDurationSummaryField": true }, { "documentType": "transactionMetric", "rollupInterval": "1m", "hasDocs": true, "hasDurationSummaryField": true }, { "documentType": "transactionMetric", "rollupInterval": "10m", "hasDocs": true, "hasDurationSummaryField": true }, { "documentType": "transactionMetric", "rollupInterval": "60m", "hasDocs": true, "hasDurationSummaryField": true }, { "documentType": "transactionEvent", "rollupInterval": "none", "hasDocs": true, "hasDurationSummaryField": false } ] } ``` **Time range with only APM Server < 8.7 produced documents** <img width="1427" alt="image" src="https://github.com/elastic/kibana/assets/2767137/4fd1aba5-75df-4f4c-a788-fae18fca38b0"> ```json { "isUsingServiceDestinationMetrics": false, "sources": [ { "documentType": "serviceTransactionMetric", "rollupInterval": "1m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "serviceTransactionMetric", "rollupInterval": "10m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "serviceTransactionMetric", "rollupInterval": "60m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionMetric", "rollupInterval": "1m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionMetric", "rollupInterval": "10m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionMetric", "rollupInterval": "60m", "hasDocs": true, "hasDurationSummaryField": false }, { "documentType": "transactionEvent", "rollupInterval": "none", "hasDocs": true, "hasDurationSummaryField": false } ] } ``` ### How to test - Setup local Kibana and ES instance - run Synthtrace to produce documents simulating APM Server < 8.7 ``` node scripts/synthtrace service_summary_field_version_dependent.ts --versionOverride=8.6.2 --from=now-15m --to=now ``` - run Synthtrace to produce documents simulating APM Server >= 8.7 ``` node scripts/synthtrace service_summary_field_version_dependent.ts --versionOverride=8.9.2 --from=now-15m --to=now ``` - Navigate to APM > Service and Trace and click through the services --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information