# How to correctly model a traffic-based SLO when total request count can be zero?

**URL:** <https://community.dynatrace.com/t/how-to-correctly-model-a-traffic-based-slo-when-total-request-count-can-be-zero/54558>\
**Category:** Automations\
**Tags:** slo\
**Created:** [January 7, 2026, 6:51pm UTC](https://community.dynatrace.com/t/how-to-correctly-model-a-traffic-based-slo-when-total-request-count-can-be-zero/54558 "2026-01-07T18:51:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![deni](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/deni/32/163_2.png) [@deni](https://community.dynatrace.com/u/deni)\
**Post date:** [January 7, 2026, 6:51pm UTC](https://community.dynatrace.com/t/how-to-correctly-model-a-traffic-based-slo-when-total-request-count-can-be-zero/54558/1 "2026-01-07T18:51:36Z")

</div>

Hi,

I’m trying to define a **combined, traffic-based availability SLO** in Dynatrace, built from multiple calculated service metrics (for example, total requests vs. failed requests across several endpoints).

The basic success formula is the usual one:

```markup
success = 100 * (total_requests - failed_requests) / total_requests

```

This works correctly as long as there is traffic.

However, I’m struggling with the **edge case where total\_requests = 0** , which can legitimately happen (for example during maintenance windows, upgrades, or when the service is intentionally unavailable and receives no traffic).

### Observations so far

- default(0) works as expected for **error metrics** (failed request count).

- Applying default() or value to **total request metrics** either:

- When total requests are zero, the SLO evaluation either becomes **N/A** or produces **non-intuitive results** if workarounds are attempted (for example very low percentages like 4%).

### Example expression

This expression works correctly **as long as total requests are greater than zero** :

```markup
100 *
(
  (
    (
      calc:service.totalService1Requests
      + calc:service.service2Requests
    )
    -
    (
      calc:service.errorService1Requests:count:default(0)
      + calc:service.errorService2Requests:count:default(0)
    )
  )
  /
  (
    calc:service.totalService1Requests
    + calc:service.totalService2Requests
  )
)

```

### Questions

1. Is it **by design** that traffic-based SLOs in Dynatrace cannot meaningfully evaluate to **100% when total\_requests = 0**?
2. Is there any **recommended pattern** to handle this case within a **single combined SLO** (for example, treating “no traffic” as healthy)?

I’d like to avoid workarounds that distort the SLO math or burn-rate calculation, and instead understand the **officially supported behavior and best practices**.

Regards, Deni

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 7, 2026, 9:55pm UTC](https://community.dynatrace.com/t/how-to-correctly-model-a-traffic-based-slo-when-total-request-count-can-be-zero/54558/2 "2026-01-07T21:55:28Z")

</div>

[@deni](https://community.dynatrace.com/user/90225)&nbsp; can you be more specific with the errors and results you have? (screenshots please).  
I believe that this is caused by the way how (classic) SLOs are calculated - the SLO uses inf resolution. This essentially breaks metric expressions as there are single values used instead of timeseries as input for the expression. In other words - a division of averages is not the same as the average of divisions.

You can see that, for example, in the playground, I took a “zero” only metric - as an example

- [metric expression in Data Explorer with Graph chart](https://wkf10640.live.dynatrace.com/ui/data-explorer?gtf=c_1767815763077_1767822963077&gf=all#eyJ2ZXJzaW9uIjoyLCJjb25maWciOnsiYm91bmRzIjp7fSwiY29uZmlndXJlZCI6ZmFsc2UsImVkaXRhYmxlIjp0cnVlLCJuYW1lIjoiRGF0YSBleHBsb3JlciByZXN1bHRzIiwidGlsZVR5cGUiOiJEQVRBX0VYUExPUkVSIiwiY3VzdG9tTmFtZSI6IkRhdGEgZXhwbG9yZXIgcmVzdWx0cyIsInF1ZXJpZXMiOlt7ImlkIjoiQSIsImVuYWJsZWQiOnRydWUsIm1ldHJpY1NlbGVjdG9yIjoiMTAwKlxuKGNvbS5keW5hdHJhY2UuZXh0ZW5zaW9uLnNubXAtZ2VuZXJpYy1jaXNjby1kZXZpY2Uuc25tcC5pbi5iYWQudmFsdWVzLmNvdW50OnNwbGl0QnkoKVxuLyBjb20uZHluYXRyYWNlLmV4dGVuc2lvbi5zbm1wLWdlbmVyaWMtY2lzY28tZGV2aWNlLnNubXAuaW4uYmFkLnZhbHVlcy5jb3VudDpzcGxpdEJ5KCkpOmRlZmF1bHQ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iYXNlbGluZUNvbmZpZ3MiOltdfX0=)&nbsp;- SLO expression like yours- 100\*(success/total):default(1)
- [the same&nbsp;metric expression in Data Explorer](https://wkf10640.live.dynatrace.com/ui/data-explorer?gtf=c_1767814630493_1767821830493&gf=all#eyJ2ZXJzaW9uIjoyLCJjb25maWciOnsiYm91bmRzIjp7fSwiY29uZmlndXJlZCI6ZmFsc2UsImVkaXRhYmxlIjp0cnVlLCJuYW1lIjoiRGF0YSBleHBsb3JlciByZXN1bHRzIiwidGlsZVR5cGUiOiJEQVRBX0VYUExPUkVSIiwiY3VzdG9tTmFtZSI6IkRhdGEgZXhwbG9yZXIgcmVzdWx0cyIsInF1ZXJpZXMiOlt7ImlkIjoiQSIsImVuYWJsZWQiOnRydWUsIm1ldHJpY1NlbGVjdG9yIjoiMTAwKlxuKGNvbS5keW5hdHJhY2UuZXh0ZW5zaW9uLnNubXAtZ2VuZXJpYy1jaXNjby1kZXZpY2Uuc25tcC5pbi5iYWQudmFsdWVzLmNvdW50OnNwbGl0QnkoKVxuLyBjb20uZHluYXRyYWNlLmV4dGVuc2lvbi5zbm1wLWdlbmVyaWMtY2lzY28tZGV2aWNlLnNubXAuaW4uYmFkLnZhbHVlcy5jb3VudDpzcGxpdEJ5KClcbik6ZGVmYXVsdCgxKSIsInNwbGl0QnkiOltdfV0sInZpc3VhbENvbmZpZyI6eyJ0aHJlc2hvbGRzIjpbeyJ2aXNpYmxlIjp0cnVlLCJydWxlcyI6W3siY29sb3IiOiIjN2RjNTQwIn0seyJjb2xvciI6IiNmNWQzMGYifSx7ImNvbG9yIjoiI2RjMTcyYSJ9XX1dLCJnbG9iYWwiOnt9LCJydWxlcyI6W10sInR5cGUiOiJTSU5HTEVfVkFMVUUiLCJoZWF0bWFwU2V0dGluZ3MiOnsieUF4aXMiOiJWQUxVRSIsInNob3dMYWJlbHMiOmZhbHNlfSwiaG9uZXljb21iU2V0dGluZ3MiOnsic2hvd0xlZ2VuZCI6dHJ1ZSwic2hvd0hpdmUiOnRydWV9LCJncmFwaENoYXJ0U2V0dGluZ3MiOnsiY29ubmVjdE51bGxzIjpmYWxzZX0sInNpbmdsZVZhbHVlU2V0dGluZ3MiOnsibGlua1RpbGVDb2xvclRvVGhyZXNob2xkIjp0cnVlLCJzaG93U3BhcmtMaW5lIjp0cnVlLCJzaG93VHJlbmQiOnRydWV9LCJpc1RhYmxlUGFnaW5hdGlvbkVuYWJsZWQiOmZhbHNlfSwicXVlcmllc1NldHRpbmdzIjp7InJlc29sdXRpb24iOiIifSwiYmFzZWxpbmVDb25maWdzIjpbXX19)&nbsp;- but as a single value, **leaving you with the default fold aggregation**. This needs to be set to avg - but you cannot do that in SLO definition. Essentially, this is how SLO is calculated.
- [metric expression with fold transformation in Data Explorer](https://wkf10640.live.dynatrace.com/ui/data-explorer?gtf=c_1767814743294_1767821943294&gf=all#eyJ2ZXJzaW9uIjoyLCJjb25maWciOnsiYm91bmRzIjp7fSwiY29uZmlndXJlZCI6ZmFsc2UsImVkaXRhYmxlIjp0cnVlLCJuYW1lIjoiRGF0YSBleHBsb3JlciByZXN1bHRzIiwidGlsZVR5cGUiOiJEQVRBX0VYUExPUkVSIiwiY3VzdG9tTmFtZSI6IkRhdGEgZXhwbG9yZXIgcmVzdWx0cyIsInF1ZXJpZXMiOlt7ImlkIjoiQSIsImVuYWJsZWQiOnRydWUsIm1ldHJpY1NlbGVjdG9yIjoiMTAwKlxuKGNvbS5keW5hdHJhY2UuZXh0ZW5zaW9uLnNubXAtZ2VuZXJpYy1jaXNjby1kZXZpY2Uuc25tcC5pbi5iYWQudmFsdWVzLmNvdW50OnNwbGl0QnkoKTpmb2xkKGF2Zylcbi8gY29tLmR5bmF0cmFjZS5leHRlbnNpb24uc25tcC1nZW5lcmljLWNpc2NvLWRldmljZS5zbm1wLmluLmJhZC52YWx1ZXMuY291bnQ6c3BsaXRCeSgpOmZvbGQoYXZnKVxuKTpkZWZhdWx0KDEpIiwic3BsaXRCeSI6W119XSwidmlzdWFsQ29uZmlnIjp7InRocmVzaG9sZHMiOlt7InZpc2libGUiOnRydWUsInJ1bGVzIjpbeyJjb2xvciI6IiM3ZGM1NDAifSx7ImNvbG9yIjoiI2Y1ZDMwZiJ9LHsiY29sb3IiOiIjZGMxNzJhIn1dfV0sImdsb2JhbCI6e30sInJ1bGVzIjpbXSwidHlwZSI6IlNJTkdMRV9WQUxVRSIsImhlYXRtYXBTZXR0aW5ncyI6eyJ5QXhpcyI6IlZBTFVFIiwic2hvd0xhYmVscyI6ZmFsc2V9LCJob25leWNvbWJTZXR0aW5ncyI6eyJzaG93TGVnZW5kIjp0cnVlLCJzaG93SGl2ZSI6dHJ1ZX0sImdyYXBoQ2hhcnRTZXR0aW5ncyI6eyJjb25uZWN0TnVsbHMiOmZhbHNlfSwic2luZ2xlVmFsdWVTZXR0aW5ncyI6eyJsaW5rVGlsZUNvbG9yVG9UaHJlc2hvbGQiOnRydWUsInNob3dTcGFya0xpbmUiOnRydWUsInNob3dUcmVuZCI6dHJ1ZX0sImlzVGFibGVQYWdpbmF0aW9uRW5hYmxlZCI6ZmFsc2V9LCJxdWVyaWVzU2V0dGluZ3MiOnsicmVzb2x1dGlvbiI6IiJ9LCJiYXNlbGluZUNvbmZpZ3MiOltdfX0=)&nbsp;will help you in SLO definition, just it breaks the graph representation, as it provides a single value. With more complex SLO expressions, I ended with this approach.

But your case can be different. Also worth mentioning:

- You miss splitby in the metric selectors in the expression. this can produce unexpected results. use splitby, ideally removing all dimensions if it suits your case - e.g. :splitby()
- There is a success rate metric&nbsp;builtin:service.successes.server.rate and also success count metrics
- Generally, if there is no value, you can’t measure. If there is zero traffic, you can’t say your success rate is 100% - as there was no success.

---

<div class="post-metadata">

**Author:** ![deni](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/deni/32/163_2.png) [@deni](https://community.dynatrace.com/u/deni)\
**Post date:** [January 8, 2026, 11:28am UTC](https://community.dynatrace.com/t/how-to-correctly-model-a-traffic-based-slo-when-total-request-count-can-be-zero/54558/3 "2026-01-08T11:28:34Z")

</div>

Hi&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;,

Thank you for the references — I’ll review them.

Below is some additional context together with screenshots from my **test environment**.  
The setup is intentionally simple: I’m using a small demo application that I wrote only to reproduce a real customer scenario.

I’ve defined calculated service metrics for:

- total request count
- failed request count

This setup exists for **two endpoints** :

- login
- register

In total, there are **four metrics** (2× total, 2× failed), which are combined into a **single, traffic-based SLO**.

 ![deni_0-1767869666956.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/3cff2f8f4a2865c3ace839e571b7954bdbeb1f0d.png)

There is no business use case behind this setup — the goal is only to reproduce and validate the customer’s real production behavior with minimal endpoints.

To generate traffic, I run a script that sends requests for a short period of time.  
Once the script finishes, **traffic stops completely**.

On the customer side, this situation can legitimately happen as well (for example during **maintenance windows or upgrades** ).

Currently:

- There are **no failed requests** (error generation is not yet part of the test).
- Example data looks like:
  - 20 total - 0 failed / 20 total
  - later: 0 total - 0 failed / 0 total when traffic stops

The SLO expression **compiles successfully**

 ![deni_1-1767870246525.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5c6281914f0604636c12107e5bfb8cd7461049b1.png)

but when I press **“Evaluate SLO”** , the evaluation shows this - I don’t understand where these % comes from.

 ![deni_2-1767870611106.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/d/0dda73a2c29a86fc8a0983233c862de210b8ef41.png)

If I try to apply a default() to the **total request metrics** , for example:

 ![deni_3-1767870710939.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/8/9833bc86b923d9ae78b037e1cba90114fcf38ade.png)

or

 ![deni_4-1767870764476.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7222a3baa60f22d066d14aaa8111436e1bc18fbb.png)

I don’t know why the error is different even that the code is the same - sometimes I see the first error and sometimes the second one.

I can write it like this:

 ![deni_5-1767870864555.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/9/d9ea6949cb27accf630bd039aaca979819e4feea.png)

but when I press **“Evaluate SLO”** , the evaluation shows this - Again, I don’t understand where these % comes from.

 ![deni_6-1767870908852.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/c/1ccb1b883ad7a1b3061c6a9ea3f46a3d07698b34.png)

Regards, Deni

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 8, 2026, 11:57am UTC](https://community.dynatrace.com/t/how-to-correctly-model-a-traffic-based-slo-when-total-request-count-can-be-zero/54558/4 "2026-01-08T11:57:01Z")

</div>

[@deni](https://community.dynatrace.com/user/90225)&nbsp;as I wrote before - add :splitBy() and :auto&nbsp; tranformations. Also add the :fold(avg) (see my example above).  
Always model this in Data Explorer first (easier) and use single value (don’t change the fold aggreation in the chart options).
