---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/metrics](../index.md) / METRICS\_RETENTION\_SAFETY\_MARGIN\_MS

# Variable: METRICS\_RETENTION\_SAFETY\_MARGIN\_MS

> `const` **METRICS\_RETENTION\_SAFETY\_MARGIN\_MS**: `number`

Defined in: [packages/b2c-tooling-sdk/src/operations/metrics/index.ts:176](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/operations/metrics/index.ts#L176)

Safety margin kept *inside* the retention window when clamping `from`. Because
the server evaluates retention against its own clock at request time, a `from`
computed as exactly "30 days ago" on the client is reliably rejected once
request latency and client/server clock skew are added. [resolveMetricsWindow](../functions/resolveMetricsWindow.md)
therefore clamps a `from` that lands within this margin of the retention floor
up to `now - 30 days + margin`, so edge requests (e.g. `--from 30d`) succeed.
5 minutes comfortably covers latency and typical skew while costing a
negligible fraction of the 30-day window.
