Hey Team, I'm trying to record a histogram metric ...
# support
a
Hey Team, I'm trying to record a histogram metric in SigNoz using OpenTelemetry in Rust. Here's how I'm measuring and recording execution time for a function:
Copy code
let hist = meter
    .f64_histogram("test_hist")
    .with_description("Time taken")
    .with_unit("ms")
    .build();
        let start_time = Instant::now();
        //do_somthing
        let elapsed_time = start_time.elapsed().as_secs_f64() * 1000.0;
        hist.record(elapsed_time, &[]);
In the SigNoz dashboard, I see my histogram metric in the dropdown when creating a panel, but it appears as three different metrics: •
hist_count
hist_sum
hist_bucket
However, when I select
hist_bucket
, it shows no data. and I am struggling to understand the plot if I select other two. What is the correct metric to use to properly visualize the histogram distribution? Do I need to configure anything else to see histogram buckets properly? thanks
Can someone help explain this? I'm not sure how to verify my exported data. The test data exported from my histogram includes values 1200 and 3000. I have set the following histogram boundaries in my Rust code:
Copy code
vec![
    500.0, 1000.0, 1500.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, 5000.0
]
Here is the relevant Rust code I used to create the histogram:
Copy code
meter
    .u64_histogram("function_execution_time-2")
    .with_description("Time taken to execute a function")
    .with_boundaries(vec![
        500.0, 1000.0, 1500.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, 5000.0
    ])
    .with_unit("ms")
    .build()
To check if the values are being recorded, I ran the following Clickhouse query:
Copy code
SELECT value
FROM signoz_metrics.distributed_samples_v4
WHERE metric_name = 'function_execution_time_2_bucket'
LIMIT 10
The query returns a value of
1
, but I’m not sure what this means. Also, I see a 2950 value on the histogram panel, which I don't understand. Can someone explain what the 2950 value represents?
@Nagesh Bansal @Srikanth Chekuri
s
Please use the time series chart.
a
Thank you for your time. However, I’m having trouble correlating the time series graph with the actual percentile values or data points. I’ve attached the following screenshots for reference: 1. The time series for p50 and p90 from the histogram instrument. 2. The table panel showing trace attributes for the same values recorded in the histogram. 3. The data and percentile calculations (the 90th percentile is 24,100). I’m a bit confused, as the plot doesn’t seem to match this value. I’m having difficulty reading or explaining the graphs, and would appreciate any guidance.
Screenshot 2025-03-28 at 2.16.28 PM.png,Screenshot 2025-03-28 at 2.17.37 PM.png
s
Please share the exact test script that can reproduce these results.
a
sure thanks. We were exporting values from our app, but we were sending dummy values instead of the actual measured time.I'll need to create a test script to share with you. In the meantime, could you suggest if this issue might be related to how the dashboard is configured?
s
No, it is most likely not a config issue
a
okay, let me get back to you with the script. thanks