You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "btlqql (via GitHub)" <gi...@apache.org> on 2026/09/15 23:42:56 UTC

[PR] fix(metrics): preserve mixed float and histogram samples [rocketmq-dashboard]

btlqql opened a new pull request, #4358:
URL: https://github.com/apache/rocketmq-dashboard/pull/4358

   Prometheus matrix results can contain both float and native-histogram samples in the same series. The explorer previously retained only the float samples whenever any were present, dropping histogram rows from CSV and undercounting the response.
   
   Preserve and sort both kinds, count them individually, show mixed types in the details table, and plot floats and histogram-derived values on separate lines. Add a mixed-series export/statistics regression and update the component regression to use distinct sample timestamps.
   
   Reference: https://prometheus.io/docs/prometheus/latest/querying/api/#range-vectors
   
   Validation: 33 tests passed across MetricsExplorer and metricsExplorerDiagnostics; ESLint passed for the implementation and utility tests; `npm run build` passed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(metrics): preserve mixed float and histogram samples [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on code in PR #4358:
URL: https://github.com/apache/rocketmq-dashboard/pull/4358#discussion_r4021466149


##########
web/src/components/MetricsExplorer.tsx:
##########
@@ -122,14 +122,15 @@ const MetricChart = ({
   hiddenSeriesText,
 }: MetricChartProps) => {
   const allSeries = data.series
-    .map((series, index) => {
-      const { samples, fromHistogram } = toMetricSeriesSamples(series);
-      return {
+    .flatMap((series, index) => {
+      const { samples } = toMetricSeriesSamples(series);
+      // Keep raw floats and histogram-derived trends on separate lines.
+      return (['scalar', 'histogram'] as const).map((kind) => ({
         color: SERIES_COLORS[index % SERIES_COLORS.length],
         label: metricSeriesLabel(series, metric.name),
-        samples,
-        fromHistogram,
-      };
+        samples: samples.filter((sample) => sample.kind === kind),

Review Comment:
   After `flatMap`, a mixed series produces two entries in `allSeries` with the same `color` and `label`. The legend section (line ~247) iterates `chartSeries` and will render duplicate labels for mixed series. Consider either:
   1. Deduplicating legend entries by `label` (showing the color swatch once), or
   2. Appending a kind suffix like `"(scalar)"` / `"(histogram)"` to the legend text so users can distinguish the two trend lines.
   
   This is a minor UX polish item — the data correctness is solid.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(metrics): preserve mixed float and histogram samples [rocketmq-dashboard]

Posted by "btlqql (via GitHub)" <gi...@apache.org>.
btlqql commented on code in PR #4358:
URL: https://github.com/apache/rocketmq-dashboard/pull/4358#discussion_r4022823579


##########
web/src/components/MetricsExplorer.tsx:
##########
@@ -122,14 +122,15 @@ const MetricChart = ({
   hiddenSeriesText,
 }: MetricChartProps) => {
   const allSeries = data.series
-    .map((series, index) => {
-      const { samples, fromHistogram } = toMetricSeriesSamples(series);
-      return {
+    .flatMap((series, index) => {
+      const { samples } = toMetricSeriesSamples(series);
+      // Keep raw floats and histogram-derived trends on separate lines.
+      return (['scalar', 'histogram'] as const).map((kind) => ({
         color: SERIES_COLORS[index % SERIES_COLORS.length],
         label: metricSeriesLabel(series, metric.name),
-        samples,
-        fromHistogram,
-      };
+        samples: samples.filter((sample) => sample.kind === kind),

Review Comment:
   Addressed in a688f1c5. Mixed series now use distinct colors and explicit `(scalar)` / localized histogram suffixes, while single-kind series retain their existing labels. The component regression verifies both legend labels; 33 targeted tests and ESLint pass.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(metrics): preserve mixed float and histogram samples [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #4358:
URL: https://github.com/apache/rocketmq-dashboard/pull/4358


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org