Skip to content

Fix APM metric card calculations and clean up Services Home labels#2624

Merged
ps48 merged 2 commits intoopensearch-project:mainfrom
ps48:service-home-fix
Mar 25, 2026
Merged

Fix APM metric card calculations and clean up Services Home labels#2624
ps48 merged 2 commits intoopensearch-project:mainfrom
ps48:service-home-fix

Conversation

@ps48
Copy link
Copy Markdown
Member

@ps48 ps48 commented Mar 25, 2026

Description

  • Fix metric card calculations: Metric cards for fault rate, availability, and latency were showing inflated values (e.g., 575% fault rate) because showTotal mode summed all data points and divided by 1 instead of the number of data points. Fixed by defaulting the divisor to chartData.length when no explicit divisor is provided.
  • Fix latency to use true percentile: Services Home latency column was showing the arithmetic mean of per-step P99 values. Added an instant query using sum_over_time on histogram buckets to compute the true P99/P90/P50 over the full selected time range.
  • Fix throughput metric card: Removed misleading "Avg" subtitle and secondary raw count value from the throughput card — throughput (req/s) is a rate, not an average, and the raw count was confusing without context.
  • Remove unused faultRate queries: getQueryAllOperationsFaultRate and getQueryAllDependenciesFaultRate were fetched but never rendered in the Operations or Dependencies tables. Removed to save 1 unnecessary Prometheus API call per tab.
  • Label cleanup: Renamed "Avg. Latency" → "Latency", "Avg. throughput" → "Throughput" in Services Home. Updated tooltips to match current calculation logic.

Issues Resolved

#2545

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

ps48 added 2 commits March 24, 2026 17:30
Signed-off-by: ps48 <pshenoy36@gmail.com>
@ps48 ps48 added the bug Something isn't working label Mar 25, 2026
}) => {
const { config } = useApmConfig();
const windowDuration = config?.windowDuration ?? 60;
const { _config } = useApmConfig();
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a known unused variable, will fix it in follow up PR later.

@ps48 ps48 merged commit 3877541 into opensearch-project:main Mar 25, 2026
14 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants