Extracting sum and count metrics from histogram
This documentation explains how to extract summary metrics (sum and count) from histogram-type metrics while excluding the original bucket data. This transformation is particularly useful for calculating averages.
Overview
The transformation configuration allows you to:
- Extract count and sum metrics from histogram data
- Filter out the original histogram buckets
- Use the resulting metrics for average calculations
transform:
error_mode: ignore
metric_statements:
- context:
metric:
conditions:
- name == "myApp_latency_bucket"
statements:
- extract_count_metric(true)
- extract_sum_metric(true)
filter:
metrics:
exclude:
match_type: strict
metric_names:
- myApp_latency_bucket
Generated Metrics
The transformation will create two new metrics:
- myApp_latency_bucket_count: Total number of observations
- myApp_latency_bucket_sum: Sum of all observations
Was this page helpful?
On this page