Sitemap

about Datadog as_count()

2 min readDec 1, 2025

According to the docs, as_count() is considered a metrics modifier. Thing is when you’re visualizing a timeseries from the browser even counters have as_count() always attached at the end. Is it really needed? What’s the effect of it?

Docs state it clearly that the effect of applying as_count() to counters is not null. Indeed,

Press enter or click to view image in full size

Here’s an example

Press enter or click to view image in full size

You can see widget at the top left has the as_count() at the end and it’s ~10G, top right ~1.5M/s, the other is ~30M. The most interesting ones are the top left and bottom left. The difference is that the bottom left is using average as the aggregation over the rollup period. The top left is using sum as stated in the docs.

To prove it let’s force the average aggregation even when applying as_count()

Press enter or click to view image in full size

The rationale here I guess is that counters are aggregated summing over time at the agent level

Press enter or click to view image in full size

so the most likely thing a user wanna do is to keep aggregating as a sum when visualizing the whole series over hours or weeks. On the other hand the default rollup function (unless hinted by as_count()) is average probably because of …reasons.

Giuseppe Crinò
Giuseppe Crinò

Written by Giuseppe Crinò

Software Engineer, working on Site Reliability Engineering