-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 UI] Latency distribution chart breaks due to transaction durations of value 0 #184256
Labels
apm:charts
bug
Fixes for quality problems that affect the customer experience
good first issue
low hanging fruit
sdh-linked
Team:obs-ux-infra_services
Observability Infrastructure & Services User Experience Team
Comments
neptunian
added
the
Team:obs-ux-infra_services
Observability Infrastructure & Services User Experience Team
label
May 24, 2024
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
smith
added
bug
Fixes for quality problems that affect the customer experience
apm:charts
needs-refinement
A reason and acceptance criteria need to be defined for this issue
sdh-linked
labels
May 25, 2024
jennypavlova
removed
the
needs-refinement
A reason and acceptance criteria need to be defined for this issue
label
Sep 3, 2024
rmyz
added a commit
that referenced
this issue
Sep 5, 2024
…ations of value 0 (#191994) ## Summary Fixes: #184256 This PR fixes the APM latency distribution chart not being able to render when we had any duration value as 0, to fix it, we now check if it's 0 and override it with 1. |Before|After| |-|-| |![image](https://github.com/user-attachments/assets/df224a1d-a669-4ea8-ad0e-9f81a82b904a)|![image](https://github.com/user-attachments/assets/cbf6957c-df6f-4f71-8f96-7985279912fa)| ## Test steps 1. Open the following file `x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts` 2. Modify L61 and L118 changing the initial two values passed to `getHistogramRangeSteps` to 0. Like `getHistogramRangeSteps(0, 0, steps)`. It doesn't matter the order, if one of the params is at 0 it won't render anything. 3. Revert the change and check if the chart is being rendered.
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Sep 5, 2024
…ations of value 0 (elastic#191994) ## Summary Fixes: elastic#184256 This PR fixes the APM latency distribution chart not being able to render when we had any duration value as 0, to fix it, we now check if it's 0 and override it with 1. |Before|After| |-|-| |![image](https://github.com/user-attachments/assets/df224a1d-a669-4ea8-ad0e-9f81a82b904a)|![image](https://github.com/user-attachments/assets/cbf6957c-df6f-4f71-8f96-7985279912fa)| ## Test steps 1. Open the following file `x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts` 2. Modify L61 and L118 changing the initial two values passed to `getHistogramRangeSteps` to 0. Like `getHistogramRangeSteps(0, 0, steps)`. It doesn't matter the order, if one of the params is at 0 it won't render anything. 3. Revert the change and check if the chart is being rendered. (cherry picked from commit 917473f)
kibanamachine
referenced
this issue
Sep 5, 2024
…ion durations of value 0 (#191994) (#192165) # Backport This will backport the following commits from `main` to `8.15`: - [[APM UI] Fix Latency distribution chart breaks due to transaction durations of value 0 (#191994)](#191994) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sergi Romeu","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-05T10:35:29Z","message":"[APM UI] Fix Latency distribution chart breaks due to transaction durations of value 0 (#191994)\n\n## Summary\r\nFixes: https://github.com/elastic/kibana/issues/184256\r\n\r\nThis PR fixes the APM latency distribution chart not being able to\r\nrender when we had any duration value as 0, to fix it, we now check if\r\nit's 0 and override it with 1.\r\n\r\n|Before|After|\r\n|-|-|\r\n\r\n|![image](https://github.com/user-attachments/assets/df224a1d-a669-4ea8-ad0e-9f81a82b904a)|![image](https://github.com/user-attachments/assets/cbf6957c-df6f-4f71-8f96-7985279912fa)|\r\n\r\n## Test steps\r\n1. Open the following file\r\n`x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts`\r\n2. Modify L61 and L118 changing the initial two values passed to\r\n`getHistogramRangeSteps` to 0.\r\nLike `getHistogramRangeSteps(0, 0, steps)`.\r\nIt doesn't matter the order, if one of the params is at 0 it won't\r\nrender anything.\r\n3. Revert the change and check if the chart is being rendered.","sha":"917473f8321fd56b90f18e5a88d643d5abb7eb29","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","apm:charts","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.15.0","v8.16.0","backport:version"],"title":"[APM UI] Fix Latency distribution chart breaks due to transaction durations of value 0","number":191994,"url":"https://github.com/elastic/kibana/pull/191994","mergeCommit":{"message":"[APM UI] Fix Latency distribution chart breaks due to transaction durations of value 0 (#191994)\n\n## Summary\r\nFixes: https://github.com/elastic/kibana/issues/184256\r\n\r\nThis PR fixes the APM latency distribution chart not being able to\r\nrender when we had any duration value as 0, to fix it, we now check if\r\nit's 0 and override it with 1.\r\n\r\n|Before|After|\r\n|-|-|\r\n\r\n|![image](https://github.com/user-attachments/assets/df224a1d-a669-4ea8-ad0e-9f81a82b904a)|![image](https://github.com/user-attachments/assets/cbf6957c-df6f-4f71-8f96-7985279912fa)|\r\n\r\n## Test steps\r\n1. Open the following file\r\n`x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts`\r\n2. Modify L61 and L118 changing the initial two values passed to\r\n`getHistogramRangeSteps` to 0.\r\nLike `getHistogramRangeSteps(0, 0, steps)`.\r\nIt doesn't matter the order, if one of the params is at 0 it won't\r\nrender anything.\r\n3. Revert the change and check if the chart is being rendered.","sha":"917473f8321fd56b90f18e5a88d643d5abb7eb29"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191994","number":191994,"mergeCommit":{"message":"[APM UI] Fix Latency distribution chart breaks due to transaction durations of value 0 (#191994)\n\n## Summary\r\nFixes: https://github.com/elastic/kibana/issues/184256\r\n\r\nThis PR fixes the APM latency distribution chart not being able to\r\nrender when we had any duration value as 0, to fix it, we now check if\r\nit's 0 and override it with 1.\r\n\r\n|Before|After|\r\n|-|-|\r\n\r\n|![image](https://github.com/user-attachments/assets/df224a1d-a669-4ea8-ad0e-9f81a82b904a)|![image](https://github.com/user-attachments/assets/cbf6957c-df6f-4f71-8f96-7985279912fa)|\r\n\r\n## Test steps\r\n1. Open the following file\r\n`x-pack/plugins/observability_solution/apm/server/routes/correlations/queries/fetch_duration_histogram_range_steps.ts`\r\n2. Modify L61 and L118 changing the initial two values passed to\r\n`getHistogramRangeSteps` to 0.\r\nLike `getHistogramRangeSteps(0, 0, steps)`.\r\nIt doesn't matter the order, if one of the params is at 0 it won't\r\nrender anything.\r\n3. Revert the change and check if the chart is being rendered.","sha":"917473f8321fd56b90f18e5a88d643d5abb7eb29"}}]}] BACKPORT--> Co-authored-by: Sergi Romeu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
apm:charts
bug
Fixes for quality problems that affect the customer experience
good first issue
low hanging fruit
sdh-linked
Team:obs-ux-infra_services
Observability Infrastructure & Services User Experience Team
Summary
The latency distribution chart will not render if there are any documents where transaction.duration.histogram has a minimum or maximum value of 0.
This happens in the call to
get_duration_histogram_range_steps
and it responds with:Using the min and max values we call getHistogramRangeSteps. This purpose of this function is to generate a set of bins for histogram visualization, where the bins are distributed on a logarithmic scale, however logarithmic scales are undefined for zero and we don't handle this in the function. The array of zeros, then gets passed to another es query, get_duration_ranges, before it response with zero ranges. The result is it will return zeros to the UI and won't render anything.
Solution proposal
Transaction durations likely should never have values of 0, but in the event they do, we should still handle them. A solution would be to set the values to 1 if they are 0 in the function.
After some investigation, we verified that the values can be both
1
(the chart will still render) but they can't be 0.AC
The text was updated successfully, but these errors were encountered: