---
updatedAt: 2026-04-16T21:23:00.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# m_tdigest

```
m_tdigest(metricName: string, [filter: bool]?) -> tdigest of float64
```

Selects a `tdigest`-valued metric inside [align](verb-align) the same way [m](function-m) selects floats, but requires the chosen metric to be known as a `tdigest` type in dataset metadata. If the name is missing from metadata the compiler emits both an error (unknown type for this selector) and a warning that the metric may need an explicit `set_metric` `tdigest` declaration. The optional boolean filter restricts which points contribute after the name match. Histogram or float metrics must use [m\_histogram](function-m_histogram), [m\_exponential\_histogram](function-m_exponential_histogram), [m\_object](function-m_object), or `m` respectively. Usage outside `align` is rejected.

# Domain

This is a scalar function (calculates a single output value for a single input row).

# Categories

* [Misc](function#misc-functions)

# Examples

<OpalCodeBlock code={
`align 5m, frame(back: 5m), o: tdigest_combine(m_tdigest("latency_digest"))
`}/>

Merges partial t-digest states for the named digest metric across each five-minute alignment bucket.

<OpalCodeBlock code={
`align 1m, frame(back: 1m), o: histogram_quantile(m_tdigest("payload_size"), 0.99)
`}/>

Computes an approximate 99th percentile from a t-digest metric selected with the digest-specific accessor.