hyperdx icon indicating copy to clipboard operation
hyperdx copied to clipboard

Charts should permit simple transforms (i.e. multiply number by 100)

Open sgarfinkel opened this issue 2 months ago • 4 comments

I have a metric for tracking pod CPU limit utilization, but it's returned as a number between 0 and 1. In Grafana I can easily transform this data to a percentage. However in HyperDX there is no way to apply any transformations to the metric.

sgarfinkel avatar Oct 31 '25 01:10 sgarfinkel

+1, and also it'd be great if we could convert a Unix timestamp into a human-readable timestamp (e.g. 1762098415 -> 2025/11/02 15:46:55.000)

I think we can use Clickhouse functionality for this with e.g. span attributes, but for metrics it appears we cannot

mrkaye97 avatar Nov 02 '25 15:11 mrkaye97

Hi @sgarfinkel and @mrkaye97, thanks for the suggestions!

I'm wondering if the "Number format" option provided in the chart builder would work for your use-cases. If you set the number format to Percentage, you can transform a number 0-1 to a percentage 0-100. There are other transformations as well, including one for time, which may work for a timestamp conversion use-case.

Image

If this functionality doesn't work for your use-cases, could you please describe the use-case in more detail?

pulpdrew avatar Nov 04 '25 00:11 pulpdrew

Hi @pulpdrew it looks like at one time there actually was Coefficient functionality in the NumberFormat dialog, but it’s been commented out for some time. https://github.com/hyperdxio/hyperdx/blob/43dfb3aaff08cc64bbd48fe64da4651e01eecdca/packages/app/src/components/NumberFormat.tsx#L58

If this could be uncommented and replaced with NumberInput perhaps, that would definitely be enough for us. I guess I wonder why this never got uncommented?

sgarfinkel avatar Nov 04 '25 00:11 sgarfinkel

Thanks for the find @sgarfinkel! I'm not sure why that was commented out either, but it looks like it was commented out all the way back to when it was initially committed to this repo. This does look like a feature that we could add. We'll take a look at it when priority allows - and contributions are welcome of course.

One additional thing to consider with this functionality is that we'd likely want the coefficient to be applied during alert evaluation, or ensure that it's clear when setting up an alert threshold how the threshold and coefficient relate.

pulpdrew avatar Nov 04 '25 21:11 pulpdrew