Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added documentation for seperating sum and count from histogram… #1081

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions constants/docsSideNav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,11 @@ const docsSideNav = [
route: '/docs/metrics-management/docker-container-metrics',
label: 'Docker container metrics',
},
{
type: 'doc',
route: '/docs/metrics-management/extracting-sum-and-count-from-histogram',
label: 'Extracting sum and count from histogram',
}
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
date: 2025-01-07
title: Extracting sum and count metrics from histogram
id: docker-container-metrics
---

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:

1. Extract count and sum metrics from histogram data
2. Filter out the original histogram buckets
3. Use the resulting metrics for average calculations

```yaml
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:

1. myApp_latency_bucket_count: Total number of observations
2. myApp_latency_bucket_sum: Sum of all observations